/* ============================================================
   patient-auth.css — Patient Login/Register Modal
   Patient Portal Colors: Navy #043259, Teal #64ada9,
   Steel Blue #4d6F8C, Mint #dbece7, Coral #FF6B4A
   ============================================================ */

/* ── Mi Cuenta Header Button ── */
.patient-account-btn {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.patient-account-wrapper {
    position: relative;
    z-index: 300;
}

.patient-account-dropdown {
    position: absolute;
    top: 44px;
    right: 0;
    background: #ffffff;
    border: 1px solid #dbece7;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(4,50,89,0.12);
    min-width: 150px;
    z-index: 200;
    overflow: hidden;
}

.patient-account-dropdown a {
    display: block;
    padding: 10px 14px;
    font-size: 13px;
    color: #043259;
    text-decoration: none;
}

.patient-account-dropdown a:hover {
    background: #f4f8f7;
}

.patient-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: #f4f8f7;
    border-radius: 6px;
    border: 1.5px solid #dbece7;
    transition: background 0.2s;
    cursor: pointer;
}

.patient-badge:hover { background: #dbece7; }
.patient-badge img { width: 20px; height: 20px; }

/* ── Modal Overlay ── */
.patient-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(4, 50, 89, 0.5);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.patient-modal-overlay.active { display: flex; }

/* ── Modal Box ── */
.patient-modal {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(4, 50, 89, 0.18);
    width: 100%;
    max-width: 420px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    padding: 32px 28px 24px;
    font-family: 'Nunito Sans', sans-serif;
    color: #043259;
}

.patient-modal-close {
    position: absolute;
    top: 16px;
    right: 20px;
    font-size: 26px;
    font-weight: 700;
    cursor: pointer;
    color: #4d6F8C;
    background: transparent;
    border: none;
    line-height: 1;
    transition: color 0.2s;
}

.patient-modal-close:hover { color: #043259; }

/* ── Modal Header ── */
.patient-modal-header {
    text-align: center;
    margin-bottom: 20px;
}

.patient-logo-circle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    margin: 0 auto 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.patient-logo-circle img { width: 36px; height: 36px; }

.patient-modal-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: #043259;
    margin: 0 0 4px;
}

.patient-modal-header p {
    font-size: 12px;
    color: #64ada9;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin: 0;
}

/* ── Tabs ── */
.patient-tabs {
    display: flex;
    border-bottom: 2px solid #dbece7;
    margin-bottom: 20px;
}

.patient-tab {
    flex: 1;
    padding: 10px;
    background: transparent;
    border: none;
    font-family: 'Nunito Sans', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #4d6F8C;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.patient-tab.active {
    color: #FF6B4A;
    border-bottom-color: #FF6B4A;
}

.patient-tab:hover:not(.active) { color: #043259; }

/* ── Tab Content ── */
.patient-tab-content { display: none; }
.patient-tab-content.active { display: block; }

/* ── Form Elements ── */
.patient-form-group {
    margin-bottom: 16px;
}

.patient-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #043259;
    margin-bottom: 6px;
}

.patient-required { color: #FF6B4A; }

.patient-input {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid #dbece7;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Nunito Sans', sans-serif;
    color: #043259;
    background: rgba(219, 236, 231, 0.15);
    box-sizing: border-box;
    transition: border-color 0.2s;
    outline: none;
}

.patient-input:focus { border-color: #64ada9; }
.patient-input.input-error { border-color: #E56163; background: #fff8f8; }

.patient-input-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.patient-input-icon .patient-input { padding-right: 40px; }

.patient-toggle-pw {
    position: absolute;
    right: 10px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.patient-toggle-pw img { pointer-events: none; opacity: 0.6; }
.patient-toggle-pw:hover img { opacity: 1; }

/* ── Errors ── */
.patient-field-error {
    display: block;
    font-size: 12px;
    color: #E56163;
}

.patient-field-error:not(:empty) {
    margin-top: 4px;
}

.patient-server-error {
    font-size: 13px;
    color: #E56163;
    margin-bottom: 12px;
    display: none;
    text-align: center;
}

.patient-server-error.visible { display: block; }

/* ── Password Requirements ── */
.patient-pw-requirements {
    margin-top: 8px;
    padding: 10px 12px;
    background: rgba(219, 236, 231, 0.2);
    border-radius: 6px;
}

.patient-pw-requirements p {
    font-size: 12px;
    color: #8aacbc;
    margin: 3px 0;
}

.patient-pw-requirements p::before { content: '○ '; }

.patient-pw-requirements p.valid {
    color: #64ada9;
    font-weight: 600;
}

.patient-pw-requirements p.valid::before { content: '✓ '; }

.patient-toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 5000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.patient-toast {
    background: #ffffff;
    border-left: 4px solid #64ada9;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(4,50,89,0.15);
    padding: 14px 18px;
    font-family: 'Nunito Sans', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #043259;
    min-width: 260px;
    max-width: 360px;
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0;
    transform: translateX(20px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    pointer-events: auto;
}

.patient-toast.show { opacity: 1; transform: translateX(0); }
.patient-toast.success { border-left-color: #64ada9; }
.patient-toast.error { border-left-color: #E56163; }
.patient-toast.info { border-left-color: #4d6F8C; }
.patient-toast-icon { width: 18px; height: 18px; flex-shrink: 0; }


/* ── Confirm Modal ── */
.patient-confirm-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(4,50,89,0.4);
    z-index: 5100;
    align-items: center;
    justify-content: center;
}

.patient-confirm-overlay.active { display: flex; }

.patient-confirm-box {
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    max-width: 340px;
    width: 90%;
    text-align: center;
    box-shadow: 0 12px 32px rgba(4,50,89,0.2);
}

.patient-confirm-message {
    font-size: 14px;
    color: #043259;
    line-height: 1.6;
    margin-bottom: 20px;
    font-weight: 600;
}

.patient-confirm-actions { display: flex; gap: 10px; }

.patient-confirm-actions button {
    flex: 1;
    padding: 10px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    font-family: 'Nunito Sans', sans-serif;
    border: none;
}

.patient-confirm-cancel {
    background: transparent;
    border: 1.5px solid #dbece7 !important;
    color: #4d6F8C;
}

.patient-confirm-ok {
    background: #FF6B4A;
    color: #ffffff;
}

/* ── Buttons ── */
.patient-btn-primary {
    width: 100%;
    padding: 13px;
    background: #FF6B4A;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    font-family: 'Nunito Sans', sans-serif;
    cursor: pointer;
    transition: background 0.2s;
    margin-bottom: 10px;
}

.patient-btn-primary:hover { background: #e55a3a; }
.patient-btn-primary:disabled { background: #c8b8b4; cursor: not-allowed; }

.patient-btn-link {
    width: 100%;
    padding: 8px;
    background: transparent;
    color: #64ada9;
    border: none;
    font-size: 13px;
    font-weight: 600;
    font-family: 'Nunito Sans', sans-serif;
    cursor: pointer;
    text-align: center;
    transition: color 0.2s;
}

.patient-btn-link:hover { color: #043259; }

/* ── Terms Note ── */
.patient-terms-note {
    font-size: 11px;
    color: #8aacbc;
    text-align: center;
    line-height: 1.6;
    margin-top: 8px;
}

.patient-terms-note a {
    color: #64ada9;
    text-decoration: none;
    font-weight: 600;
}

.patient-terms-note a:hover { text-decoration: underline; }

/* ── Forgot Password ── */
.patient-forgot-intro {
    font-size: 13px;
    color: #4d6F8C;
    line-height: 1.7;
    margin-bottom: 16px;
    text-align: center;
}

.patient-forgot-success h3 {
    font-size: 18px;
    font-weight: 700;
    color: #043259;
    margin-bottom: 8px;
}

.patient-forgot-success p {
    font-size: 13px;
    color: #4d6F8C;
    line-height: 1.7;
}

.patient-consent-box {
    background: rgba(219, 236, 231, 0.2);
    border: 1.5px solid #dbece7;
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 16px;
}

.patient-consent-box label {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    font-size: 11px;
    color: #4d6F8C;
    line-height: 1.6;
    cursor: pointer;
}

.patient-consent-box input[type="checkbox"] {
    margin-top: 2px;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    appearance: none;
    -webkit-appearance: none;
    background: #ffffff;
    border: 1.5px solid #64ada9;
    border-radius: 4px;
    cursor: pointer;
    position: relative;
}

.patient-consent-box input[type="checkbox"]:checked {
    background: #FF6B4A;
    border-color: #FF6B4A;
    border: none;
}

.patient-consent-box input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 5px;
    height: 9px;
    border: solid #ffffff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.patient-consent-box a {
    color: #64ada9;
    text-decoration: none;
    font-weight: 600;
}

.patient-consent-box label span {
    flex: 1;
}

.patient-consent-box a:hover { text-decoration: underline; }

/* ── Responsive ── */
@media (max-width: 480px) {
    .patient-modal {
        padding: 24px 18px 20px;
        border-radius: 12px;
    }

    .patient-tab { font-size: 13px; padding: 8px; }
    .patient-btn-primary { padding: 12px; font-size: 13px; }
}