/* Pocket Doctor auth — dark theme matching Care Desk */
:root {
    --bg-app: #0d1117;
    --bg-elevated: #161b22;
    --bg-hover: #21262d;
    --border-color: #30363d;
    --border-soft: #21262d;
    --text-dark: #e6edf3;
    --text-muted: #8b949e;
    --text-faint: #6e7681;
    --accent: #3dd6c6;
    --accent-dim: #1a9e91;
    --primary-blue: #3dd6c6;
    --dark-blue: #e6edf3;
    --bg-light: #010409;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Helvetica, Arial, sans-serif;
}

body {
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-app);
    color: var(--text-dark);
}

header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 28px;
    background: var(--bg-light);
    border-bottom: 1px solid var(--border-soft);
    flex-shrink: 0;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    flex-shrink: 0;
}

.auth-menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-elevated);
    color: var(--text-dark);
    cursor: pointer;
    flex-shrink: 0;
    font-size: 15px;
}

.auth-menu-toggle:hover {
    background: var(--bg-hover);
}

.auth-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 80;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.auth-backdrop.show {
    opacity: 1;
    pointer-events: auto;
}

.auth-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    left: auto;
    bottom: 0;
    width: min(280px, 84vw);
    background: #010409;
    border-left: 1px solid var(--border-soft);
    border-right: 0;
    z-index: 90;
    transform: translateX(105%);
    transition: transform 0.25s ease;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 14px 12px;
}

.auth-sidebar.open {
    transform: translateX(0);
}

body.auth-menu-open {
    overflow: hidden;
}

.auth-sidebar-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.auth-sidebar-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 700;
    font-size: 15px;
}

.auth-sidebar-brand img {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    object-fit: cover;
}

.auth-sidebar-close {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-elevated);
    color: var(--text-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.auth-side-links {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.auth-side-links a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    color: var(--text-dark);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    background: transparent;
}

.auth-side-links a:hover,
.auth-side-links a.is-active {
    background: var(--bg-hover);
    border-color: var(--accent-dim);
    color: var(--accent);
}

.auth-side-links a i {
    width: 16px;
    text-align: center;
}

.nav-brand {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-dark);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-brand img,
.brand-logo {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    object-fit: cover;
    flex-shrink: 0;
    display: block;
}

.nav-brand i { color: var(--accent); }

.nav-links {
    display: flex;
    gap: 28px;
    justify-self: center;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
}

.nav-links a:hover { color: var(--accent); }

.nav-auth {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-auth .btn-nav,
.nav-auth .login-link,
.nav-auth .btn-signup {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 96px;
    height: 36px;
    padding: 0 16px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 650;
    line-height: 1;
    white-space: nowrap;
    border: 1px solid var(--border-color);
    box-sizing: border-box;
}

.nav-auth .login-link,
.nav-auth .btn-nav-ghost {
    background: transparent;
    color: var(--text-dark);
}

.nav-auth .login-link:hover,
.nav-auth .btn-nav-ghost:hover {
    background: var(--bg-hover);
    color: var(--text-dark);
}

.nav-auth .btn-signup,
.nav-auth .btn-nav-solid {
    background: var(--accent);
    color: #04120f;
    border-color: var(--accent);
}

.nav-auth .btn-signup:hover,
.nav-auth .btn-nav-solid:hover {
    background: #5eead4;
    border-color: #5eead4;
}

.nav-auth .btn-nav.is-current {
    background: var(--bg-hover);
    border-color: var(--accent-dim);
    color: var(--accent);
}

.nav-auth .btn-signup.is-current,
.nav-auth .btn-nav-solid.is-current {
    background: var(--accent);
    border-color: var(--accent);
    color: #04120f;
}

/* Top disclaimer popup / banner */
.disclaimer-popup {
    flex-shrink: 0;
    background: rgba(210, 153, 34, 0.12);
    border-bottom: 1px solid rgba(210, 153, 34, 0.35);
    padding: 10px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.disclaimer-popup-inner {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.disclaimer-popup[hidden] {
    display: none !important;
}

.disclaimer-popup-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(210, 153, 34, 0.18);
    color: #e3b341;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 13px;
}

.disclaimer-popup-body {
    flex: 1;
    min-width: 0;
}

.disclaimer-popup-body strong {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: #e3b341;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 4px;
}

.disclaimer-popup-body p {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-muted);
}

.disclaimer-popup-body a {
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
}

.disclaimer-popup-close {
    border: 1px solid var(--border-color);
    background: var(--bg-elevated);
    color: var(--text-muted);
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.disclaimer-popup-close:hover {
    color: var(--text-dark);
    background: var(--bg-hover);
}

.split-container {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.split-left {
    flex: 1;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(61, 214, 198, 0.18), transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(31, 111, 235, 0.15), transparent 45%),
        linear-gradient(160deg, #010409 0%, #0d1117 55%, #161b22 100%);
    color: #fff;
    padding: 56px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-right: 1px solid var(--border-soft);
}

.split-left h1 {
    font-size: 36px;
    line-height: 1.2;
    margin-bottom: 18px;
    max-width: 420px;
    letter-spacing: -0.02em;
    font-weight: 650;
}

.split-left p {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-muted);
    margin-bottom: 36px;
    max-width: 400px;
}

.feature-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dark);
}

.feature-icon {
    width: 34px;
    height: 34px;
    background: rgba(61, 214, 198, 0.1);
    border: 1px solid rgba(61, 214, 198, 0.25);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
}

.split-right {
    flex: 1;
    background: var(--bg-app);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    padding: 28px 24px;
}

.form-wrapper {
    width: 100%;
    max-width: 420px;
    margin: 0;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 26px 24px 22px;
}

.form-wrapper h2 {
    color: var(--text-dark);
    font-size: 22px;
    margin: 0 0 4px;
    letter-spacing: -0.02em;
    font-weight: 650;
}

.form-wrapper > p {
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.45;
    margin: 0 0 20px;
}

.form-note {
    display: block;
    margin: 0 0 16px;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--border-soft);
    background: var(--bg-app);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.45;
}

.role-selector-label {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    display: block;
}

.role-options {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.role-option {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-muted);
    background: var(--bg-app);
}

.role-option.active {
    background: rgba(61, 214, 198, 0.1);
    border-color: var(--accent-dim);
    color: var(--accent);
}

.role-option input { display: none; }

.form-wrapper form {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.form-group {
    margin-bottom: 14px;
}

.form-row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.form-row .form-group {
    flex: 1;
    min-width: 0;
}

.label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
}

.label-row label {
    margin-bottom: 0;
}

.label-row .forgot-link {
    color: var(--accent);
    font-weight: 600;
    font-size: 12px;
    text-decoration: none;
    white-space: nowrap;
}

.label-row .forgot-link:hover {
    text-decoration: underline;
}

label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-muted);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="number"],
select,
textarea {
    width: 100%;
    height: 42px;
    padding: 0 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    background: var(--bg-app);
    color: var(--text-dark);
}

textarea {
    height: auto;
    padding: 11px 12px;
}

input::placeholder,
textarea::placeholder {
    color: var(--text-faint);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent-dim);
    box-shadow: 0 0 0 2px rgba(61, 214, 198, 0.15);
}

.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 2px 0 16px;
}

.checkbox-group input {
    margin-top: 3px;
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

.checkbox-group label {
    font-size: 12px;
    font-weight: 400;
    color: var(--text-muted);
    line-height: 1.45;
    margin: 0;
}

.checkbox-group label a {
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
}

.btn-submit {
    width: 100%;
    height: 42px;
    background: var(--accent);
    color: #04120f;
    padding: 0 12px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-submit:hover { background: #5eead4; }

.form-wrapper > .login-link,
.auth-switch {
    text-align: center;
    margin: 16px 0 0;
    font-size: 13px;
    color: var(--text-muted);
}

.form-wrapper > .login-link a,
.auth-switch a {
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
}

footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 14px 28px;
    background: var(--bg-light);
    border-top: 1px solid var(--border-soft);
    flex-shrink: 0;
}

.footer-brand h3 {
    font-size: 15px;
    color: var(--text-dark);
    margin-bottom: 2px;
}

.footer-brand p {
    font-size: 12px;
    color: var(--text-faint);
}

.footer-links {
    display: flex;
    gap: 18px;
}

.footer-links a {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 600;
    text-decoration: none;
}

.alert {
    padding: 11px 12px;
    border-radius: 8px;
    margin-bottom: 18px;
    font-size: 14px;
}

.alert.error {
    background: rgba(248, 81, 73, 0.12);
    color: #ff7b72;
    border: 1px solid rgba(248, 81, 73, 0.35);
}

.alert.success {
    background: rgba(61, 214, 198, 0.12);
    color: var(--accent);
    border: 1px solid rgba(61, 214, 198, 0.3);
}

.alert.info,
.alert-chat {
    background: rgba(61, 214, 198, 0.1);
    color: var(--accent);
    border: 1px solid rgba(61, 214, 198, 0.28);
}

#doctor-fields {
    display: none;
    border-top: 1px solid var(--border-color);
    padding-top: 18px;
    margin-top: 18px;
}

@media (max-width: 900px) {
    .split-left { display: none; }
    .nav-links { display: none; }
    .legal-page .nav-links { display: flex; }

    .auth-menu-toggle {
        display: inline-flex;
    }

    .nav-auth {
        display: none;
    }

    header {
        padding: 12px 16px;
    }

    .brand-text {
        font-size: 15px;
    }

    .split-right {
        padding: 20px 14px;
    }

    .form-wrapper {
        max-width: 100%;
    }

    footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 14px 16px;
    }
}

/* Legal pages (Terms / Privacy) — same dark shell */
body.legal-page {
    height: auto;
    min-height: 100vh;
    overflow: auto;
}

.nav-links a.is-active {
    color: var(--accent);
}

.legal-main {
    flex: 1;
    padding: 32px 20px 40px;
    display: flex;
    justify-content: center;
}

.legal-card {
    width: 100%;
    max-width: 760px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 32px 28px 36px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
}

.legal-kicker {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 8px;
}

.legal-card > h1 {
    font-size: 28px;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
    font-weight: 650;
}

.legal-meta {
    color: var(--text-faint);
    font-size: 13px;
    margin-bottom: 20px;
}

.legal-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 28px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border-soft);
}

.legal-nav a {
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-app);
}

.legal-nav a:hover {
    color: var(--accent);
    border-color: var(--accent-dim);
}

.legal-nav a.is-active {
    color: #04120f;
    background: var(--accent);
    border-color: var(--accent);
}

.legal-card section {
    margin-bottom: 22px;
}

.legal-card h2 {
    font-size: 16px;
    font-weight: 650;
    margin-bottom: 8px;
    color: var(--text-dark);
}

.legal-card p,
.legal-card li {
    font-size: 14px;
    line-height: 1.65;
    color: var(--text-muted);
}

.legal-card p + p {
    margin-top: 10px;
}

.legal-card ul {
    margin: 8px 0 0 18px;
}

.legal-card li {
    margin-bottom: 6px;
}

.legal-card strong {
    color: var(--text-dark);
    font-weight: 650;
}

.footer-links a:hover {
    color: var(--accent);
}

@media (max-width: 600px) {
    .legal-card {
        padding: 24px 18px 28px;
        border-radius: 14px;
    }

    .legal-card > h1 {
        font-size: 22px;
    }

    footer {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
}
