/* Holistic Hub — /login and code-verify screens.
   Uses the hub-theme tokens when body.hub-ui-website is active and falls back to
   the legacy palette otherwise, so the page looks right under either HUB_UI_THEME. */

.auth-wrap {
    max-width: 460px;
    margin: 0 auto;
    padding: 0.5rem 0 2rem;
}

.auth-card {
    background: var(--hub-bg-card, #ffffff);
    border: 1px solid var(--hub-border, #e5e7eb);
    border-radius: 20px;
    box-shadow: var(--hub-shadow-lg, 0 16px 36px rgba(15, 23, 42, 0.08));
    padding: 1.75rem 1.25rem;
}
@media (min-width: 576px) {
    .auth-card { padding: 2.5rem 2.5rem; }
}

.auth-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 1.25rem;
}
.auth-logo img {
    height: 56px;
    width: auto;
    max-width: 100%;
}

.auth-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--hub-text, #0f172a);
    text-align: center;
    margin: 0 0 0.25rem;
    letter-spacing: -0.01em;
}
.auth-subtitle {
    color: var(--hub-text-muted, #6b7280);
    text-align: center;
    margin: 0 0 1.5rem;
    font-size: 0.95rem;
}

/* Segmented switch between "Email code" and "Password" (dual mode only) */
.auth-switch {
    display: flex;
    background: var(--hub-secondary, #eef0f3);
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 1.25rem;
}
.auth-switch button {
    flex: 1 1 0;
    border: 0;
    background: transparent;
    color: var(--hub-text-muted, #6b7280);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.6rem 0.5rem;
    border-radius: 9px;
    min-height: 44px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.auth-switch button[aria-selected="true"] {
    background: var(--hub-bg-card, #ffffff);
    color: var(--hub-primary, #3B4252);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
}
.auth-switch button:focus-visible {
    outline: 2px solid var(--hub-primary, #3B4252);
    outline-offset: 2px;
}

.auth-field { margin-bottom: 1rem; }
.auth-field label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--hub-text, #374151);
    margin-bottom: 0.35rem;
}
.auth-field .form-control {
    font-size: 16px;            /* 16px stops iOS Safari zooming on focus */
    min-height: 48px;
    padding: 0.65rem 0.9rem;
    border-radius: 10px;
    border: 1px solid var(--hub-border, #d1d5db);
}
.auth-field .form-control:focus {
    border-color: var(--hub-primary, #3B4252);
    box-shadow: 0 0 0 0.25rem rgba(31, 66, 48, 0.15);
}

/* Password field with show/hide toggle */
.auth-password-wrap { position: relative; }
.auth-password-wrap .form-control { padding-right: 3rem; }
.auth-password-toggle {
    position: absolute;
    right: 0.35rem;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: var(--hub-text-muted, #6b7280);
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
}
.auth-password-toggle:hover,
.auth-password-toggle:focus-visible {
    color: var(--hub-primary, #3B4252);
    background: var(--hub-secondary, #f3f4f6);
    outline: none;
}

.auth-row-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin: -0.25rem 0 1rem;
    font-size: 0.875rem;
}
.auth-link {
    color: var(--hub-primary, #3B4252);
    font-weight: 600;
    text-decoration: none;
}
.auth-link:hover { text-decoration: underline; color: var(--hub-primary-light, #232936); }

.auth-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 48px;
    border: 0;
    border-radius: 12px;
    background: var(--hub-primary, #3B4252);
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: 0.01em;
    padding: 0.7rem 1rem;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease, opacity 0.15s ease;
}
.auth-btn:hover { background: var(--hub-primary-light, #232936); color: #fff; }
.auth-btn:active { transform: translateY(1px); }
.auth-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.auth-btn:focus-visible { outline: 2px solid var(--hub-accent, #e77c66); outline-offset: 2px; }
.auth-btn-secondary {
    background: var(--hub-secondary, #e5e7eb);
    color: var(--hub-primary, #3B4252);
}
.auth-btn-secondary:hover { background: var(--hub-border, #d1d5db); color: var(--hub-primary, #3B4252); }

.auth-hint {
    font-size: 0.85rem;
    color: var(--hub-text-muted, #6b7280);
    text-align: center;
    margin: 0.85rem 0 0;
}

/* Therapist access-code section */
.auth-code-section {
    margin-top: 1.75rem;
    padding-top: 1.5rem;
    border-top: 1px dashed var(--hub-border, #e5e7eb);
}
.auth-code-section h2 {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--hub-text-muted, #6b7280);
    margin: 0 0 0.35rem;
}
.auth-code-section p {
    font-size: 0.9rem;
    color: var(--hub-text-muted, #6b7280);
    margin: 0 0 0.85rem;
}
.auth-code-row {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}
.auth-code-row .form-control {
    font-size: 16px;
    min-height: 48px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
    border-radius: 10px;
    border: 1px solid var(--hub-border, #d1d5db);
}
.auth-code-row .form-control::placeholder {
    text-transform: none;
    letter-spacing: normal;
    font-weight: 400;
}
.auth-code-row .auth-btn { width: 100%; }
@media (min-width: 576px) {
    .auth-code-row { flex-direction: row; }
    .auth-code-row .form-control { flex: 1 1 auto; }
    .auth-code-row .auth-btn { width: auto; flex: 0 0 auto; padding-left: 1.5rem; padding-right: 1.5rem; }
}

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.85rem;
    color: var(--hub-text-muted, #6b7280);
}
.auth-footer a { color: inherit; }

/* Verify screen */
.auth-email-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    max-width: 100%;
    background: var(--hub-secondary, #f3f4f6);
    color: var(--hub-text, #111827);
    border-radius: 999px;
    padding: 0.35rem 0.9rem;
    font-weight: 600;
    font-size: 0.95rem;
    overflow-wrap: anywhere;
}
.auth-otp {
    text-align: center;
    font-size: 1.9rem;
    font-weight: 700;
    letter-spacing: 0.45em;
    text-indent: 0.45em;       /* keeps the digits visually centred despite letter-spacing */
    font-variant-numeric: tabular-nums;
    min-height: 64px !important;
    border-radius: 14px !important;
}
.auth-otp::placeholder {
    color: var(--hub-border, #d1d5db);
    font-weight: 400;
}
.auth-timer {
    font-variant-numeric: tabular-nums;
    text-align: center;
    font-size: 0.9rem;
    color: var(--hub-text-muted, #6b7280);
    margin: 0.75rem 0 0;
}
.auth-timer.expired { color: #b42318; font-weight: 600; }
.auth-verify-links {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem 1rem;
    margin-top: 1.25rem;
    font-size: 0.9rem;
}
.auth-verify-links .btn-link {
    padding: 0;
    font-size: inherit;
    font-weight: 600;
    color: var(--hub-primary, #3B4252);
    text-decoration: none;
    min-height: 44px;
}
.auth-verify-links .btn-link:hover { text-decoration: underline; }
.auth-verify-links .btn-link:disabled { color: var(--hub-text-muted, #9ca3af); opacity: 1; cursor: not-allowed; text-decoration: none; }
.auth-verify-links a { color: var(--hub-primary, #3B4252); font-weight: 600; text-decoration: none; }
.auth-verify-links a:hover { text-decoration: underline; }

[hidden] { display: none !important; }
