/* ============================================
   HM AUTH v2 - Estilos HM Medical
   Azul: #3498db
   ============================================ */

.hm-auth-wrapper, .hm-modal-container {
    --hm-primary: #3498db;
    --hm-primary-dark: #2980b9;
    --hm-secondary: #e0e0e0;
    --hm-secondary-text: #555;
    --hm-bg: #ffffff;
    --hm-text: #333333;
    --hm-text-light: #777777;
    --hm-border: #dddddd;
    --hm-error: #e74c3c;
    --hm-success: #27ae60;
    --hm-radius: 4px;
    --hm-font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* ---------- Página ---------- */
.hm-auth-wrapper {
    max-width: 500px;
    margin: 40px auto;
    padding: 0 20px;
    font-family: var(--hm-font);
}

.hm-auth-box {
    background: var(--hm-bg);
    border-radius: var(--hm-radius);
    padding: 40px;
}

.hm-auth-title {
    font-size: 22px;
    font-weight: 600;
    color: var(--hm-text);
    margin: 0 0 25px 0;
    text-align: center;
}

.hm-auth-subtitle {
    font-size: 14px;
    color: var(--hm-text-light);
    text-align: center;
    margin: -15px 0 20px 0;
}

/* ---------- Form ---------- */
.hm-form-group {
    margin-bottom: 18px;
}

.hm-form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--hm-text);
    margin-bottom: 6px;
}

.hm-form-group label .required {
    color: var(--hm-error);
    margin-left: 2px;
}

.hm-form-control {
    width: 100%;
    padding: 12px 14px;
    font-size: 15px;
    border: 1px solid var(--hm-border);
    border-radius: var(--hm-radius);
    background: #fff;
    color: var(--hm-text);
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    font-family: var(--hm-font);
}

.hm-form-control:focus {
    outline: none;
    border-color: var(--hm-primary);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
}

.hm-form-control.error {
    border-color: var(--hm-error);
    background: #fdf2f2;
}

/* ---------- Password ---------- */
.hm-password-wrapper {
    position: relative;
}

.hm-toggle-password {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--hm-text-light);
    font-size: 16px;
    padding: 4px 8px;
    line-height: 1;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.hm-toggle-password:hover {
    opacity: 1;
}

/* ---------- Strength ---------- */
.hm-strength-bar {
    height: 3px;
    background: var(--hm-border);
    border-radius: 2px;
    margin-top: 6px;
    overflow: hidden;
    display: none;
}

.hm-strength-bar.show {
    display: block;
}

.hm-strength-fill {
    height: 100%;
    width: 0;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.hm-strength-weak { width: 33%; background: var(--hm-error); }
.hm-strength-medium { width: 66%; background: #f39c12; }
.hm-strength-strong { width: 100%; background: var(--hm-success); }

.hm-strength-text {
    font-size: 12px;
    margin-top: 4px;
    display: none;
}

.hm-strength-text.show {
    display: block;
}

/* ---------- Checkbox ---------- */
.hm-checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
}

.hm-checkbox-group input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--hm-primary);
    cursor: pointer;
    margin: 0;
}

.hm-checkbox-group label {
    font-size: 14px;
    color: var(--hm-text-light);
    cursor: pointer;
    margin: 0;
    font-weight: 400;
}

/* ---------- Buttons ---------- */
.hm-btn {
    display: inline-block;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 500;
    border: none;
    border-radius: var(--hm-radius);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    text-decoration: none;
    font-family: var(--hm-font);
}

.hm-btn-primary {
    background: var(--hm-primary);
    color: #fff;
}

.hm-btn-primary:hover {
    background: var(--hm-primary-dark);
}

.hm-btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.hm-btn-secondary {
    background: var(--hm-secondary);
    color: var(--hm-secondary-text);
}

.hm-btn-secondary:hover {
    background: #d0d0d0;
}

.hm-btn-loading::after {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: hm-spin 0.7s linear infinite;
    margin-left: 8px;
    vertical-align: middle;
}

@keyframes hm-spin {
    to { transform: rotate(360deg); }
}

/* ---------- Actions ---------- */
.hm-form-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 15px;
}

.hm-form-actions .hm-btn {
    flex: 1;
}

/* ---------- Links ---------- */
.hm-form-links {
    text-align: center;
}

.hm-form-links a {
    color: var(--hm-text-light);
    font-size: 14px;
    text-decoration: none;
    transition: color 0.2s;
}

.hm-form-links a:hover {
    color: var(--hm-primary);
    text-decoration: underline;
}

/* ---------- Messages ---------- */
.hm-message {
    padding: 12px 16px;
    border-radius: var(--hm-radius);
    margin-bottom: 18px;
    font-size: 14px;
    display: none;
    align-items: center;
    gap: 8px;
}

.hm-message.show {
    display: flex;
}

.hm-message-success {
    background: #eafaf1;
    color: var(--hm-success);
    border: 1px solid #a9dfbf;
}

.hm-message-error {
    background: #fdf2f2;
    color: var(--hm-error);
    border: 1px solid #f5c6cb;
}

/* ---------- Footer ---------- */
.hm-auth-footer {
    text-align: center;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid var(--hm-border);
}

.hm-auth-footer p {
    margin: 0;
    font-size: 14px;
    color: var(--hm-text-light);
}

.hm-auth-footer a {
    color: var(--hm-primary);
    text-decoration: none;
    font-weight: 500;
}

.hm-auth-footer a:hover {
    text-decoration: underline;
}

/* ---------- Honeypot ---------- */
.hm-website-field {
    position: absolute;
    left: -9999px;
    opacity: 0;
    height: 0;
    width: 0;
}

/* ============================================
   MODAL
   ============================================ */

.hm-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.hm-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.hm-modal-container {
    background: #fff;
    border-radius: 8px;
    width: 100%;
    max-width: 420px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 30px;
    position: relative;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    transform: translateY(-20px);
    transition: transform 0.3s;
}

.hm-modal-overlay.active .hm-modal-container {
    transform: translateY(0);
}

.hm-modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 28px;
    color: #aaa;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.hm-modal-close:hover {
    color: #333;
    background: #f0f0f0;
}

.hm-modal-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 25px;
    border-bottom: 2px solid var(--hm-border);
}

.hm-modal-tab {
    flex: 1;
    padding: 12px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    font-size: 15px;
    font-weight: 500;
    color: var(--hm-text-light);
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--hm-font);
}

.hm-modal-tab.active {
    color: var(--hm-primary);
    border-bottom-color: var(--hm-primary);
}

.hm-modal-tab:hover {
    color: var(--hm-primary);
}

.hm-modal-panel {
    animation: hm-fade-in 0.25s ease;
}

@keyframes hm-fade-in {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---------- Responsive ---------- */
@media (max-width: 520px) {
    .hm-auth-box { padding: 25px 20px; }
    .hm-auth-title { font-size: 20px; }
    .hm-form-control { padding: 11px 12px; font-size: 16px; }
    .hm-modal-container { padding: 20px; max-height: 95vh; }
    .hm-form-actions { flex-direction: column; }
}

.hm-modal-container::-webkit-scrollbar { width: 6px; }
.hm-modal-container::-webkit-scrollbar-track { background: transparent; }
.hm-modal-container::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }
