
    /* Unified Auth Page */
    .auth-wrapper {
        min-height: calc(100vh - 200px);
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 2rem 1rem;
        position: relative;
        overflow: hidden;
    }

    .auth-container {
        background: rgba(255, 255, 255, 0.08);
        -webkit-backdrop-filter: blur(20px);
        border: 1px solid rgba(255, 255, 255, 0.18);
        border-radius: 24px;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
        padding: 2.5rem;
        max-width: 440px;
        width: 100%;
        position: relative;
        z-index: 1;
        animation: fadeIn 0.6s ease;
    }

    @supports (backdrop-filter: blur(20px)) {
        .auth-container {
            backdrop-filter: blur(20px);
        }
    }

    @keyframes fadeIn {
        from { opacity: 0; transform: translateY(15px); }
        to { opacity: 1; transform: translateY(0); }
    }

    /* Header */
    .auth-header {
        text-align: center;
        margin-bottom: 2rem;
    }

    .auth-logo {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 72px;
        height: 72px;
        margin-bottom: 1rem;
    }

    .auth-logo img {
        width: 72px;
        height: 72px;
        filter: contrast(1.2) brightness(1.1);
    }

    .auth-title {
        font-size: 1.75rem;
        font-weight: 700;
        color: #ffffff !important;
        margin-bottom: 0.25rem;
        font-family: 'Playfair Display', serif;
    }

    .auth-subtitle {
        color: rgba(255, 255, 255, 0.7) !important;
        font-size: 0.95rem;
    }

    /* Social Buttons */
    .btn-social {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.6rem;
        width: 100%;
        padding: 0.875rem;
        border-radius: 12px;
        color: white !important;
        text-decoration: none;
        font-weight: 600;
        font-size: 1rem;
        transition: all 0.3s ease;
        cursor: pointer;
        border: none;
    }

    .btn-social:hover {
        transform: translateY(-2px);
        color: white !important;
        text-decoration: none;
    }

    .btn-apple {
        background: #000000;
        margin-bottom: 0.75rem;
    }

    .btn-apple:hover {
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
    }

    .btn-google {
        background: rgba(255, 255, 255, 0.12);
        border: 2px solid rgba(255, 255, 255, 0.2) !important;
        margin-bottom: 0.75rem;
    }

    .btn-google:hover {
        background: rgba(255, 255, 255, 0.18);
        border-color: rgba(255, 255, 255, 0.3) !important;
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    }

    /* Divider */
    .auth-divider {
        text-align: center;
        margin: 1.5rem 0;
        position: relative;
    }

    .auth-divider::before {
        content: '';
        position: absolute;
        top: 50%;
        left: 0;
        right: 0;
        height: 1px;
        background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
    }

    .auth-divider span {
        background: transparent;
        padding: 0 1rem;
        color: rgba(255, 255, 255, 0.5) !important;
        font-size: 0.875rem;
        position: relative;
    }

    /* Toggle Tabs */
    .auth-tabs {
        display: flex;
        background: rgba(255, 255, 255, 0.08);
        border-radius: 12px;
        padding: 0.25rem;
        margin-bottom: 1.5rem;
        position: relative;
    }

    .auth-tabs .tab-indicator {
        position: absolute;
        top: 0.25rem;
        bottom: 0.25rem;
        width: calc(50% - 0.25rem);
        background: rgba(255, 255, 255, 0.15);
        border-radius: 10px;
        transition: left 0.3s ease;
        left: 0.25rem;
    }

    .auth-tabs.signup-active .tab-indicator {
        left: calc(50%);
    }

    .tab-btn {
        flex: 1;
        padding: 0.75rem;
        background: transparent;
        border: none;
        border-radius: 10px;
        color: rgba(255, 255, 255, 0.5) !important;
        font-weight: 500;
        font-size: 0.95rem;
        cursor: pointer;
        transition: color 0.3s ease;
        position: relative;
        z-index: 1;
    }

    .tab-btn.active {
        color: #ffffff !important;
        font-weight: 600;
    }

    .tab-btn:hover:not(.active) {
        color: rgba(255, 255, 255, 0.8) !important;
    }

    /* Form */
    .auth-form .form-group {
        margin-bottom: 1rem;
    }

    .auth-form label {
        color: rgba(255, 255, 255, 0.8) !important;
        font-size: 0.85rem;
        font-weight: 500;
        margin-bottom: 0.4rem;
        display: block;
    }

    .auth-form input[type="text"],
    .auth-form input[type="password"],
    .auth-form input[type="email"] {
        background: rgba(255, 255, 255, 0.1) !important;
        border: 2px solid rgba(255, 255, 255, 0.2) !important;
        border-radius: 12px !important;
        color: #ffffff !important;
        padding: 0.875rem 1rem !important;
        font-size: 1rem;
        transition: all 0.3s ease;
        width: 100%;
        height: auto !important;
    }

    .auth-form input:focus {
        background: rgba(255, 255, 255, 0.15) !important;
        border-color: rgba(102, 126, 234, 0.6) !important;
        box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1) !important;
        outline: none;
    }

    .auth-form input::placeholder {
        color: rgba(255, 255, 255, 0.4) !important;
    }

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

    .password-wrapper input {
        padding-right: 3rem !important;
    }

    .password-toggle {
        position: absolute;
        right: 12px;
        top: 50%;
        transform: translateY(-50%);
        background: none;
        border: none;
        color: rgba(255, 255, 255, 0.5);
        cursor: pointer;
        padding: 0.5rem;
        font-size: 1rem;
        transition: color 0.3s ease;
        z-index: 10;
    }

    .password-toggle:hover {
        color: rgba(255, 255, 255, 0.8);
    }

    /* Primary button */
    .btn-primary-auth {
        width: 100%;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
        border: none !important;
        border-radius: 12px !important;
        color: white !important;
        font-size: 1.05rem !important;
        font-weight: 600 !important;
        padding: 0.875rem !important;
        transition: all 0.3s ease;
        cursor: pointer;
        position: relative;
        overflow: hidden;
        letter-spacing: 0.5px;
        margin-top: 0.5rem;
    }

    .btn-primary-auth:hover {
        transform: translateY(-2px);
        box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
    }

    .btn-primary-auth.loading {
        color: transparent !important;
    }

    .btn-primary-auth.loading::after {
        content: '';
        position: absolute;
        width: 20px;
        height: 20px;
        top: 50%;
        left: 50%;
        margin: -10px 0 0 -10px;
        border: 2px solid rgba(255,255,255,0.3);
        border-radius: 50%;
        border-top-color: white;
        animation: spin 0.8s linear infinite;
    }

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

    /* Forgot password */
    .forgot-link {
        display: block;
        text-align: center;
        color: rgba(255, 255, 255, 0.6) !important;
        text-decoration: none;
        font-size: 0.875rem;
        margin-top: 0.75rem;
        transition: color 0.3s ease;
    }

    .forgot-link:hover {
        color: #667eea !important;
    }

    /* Alerts */
    .auth-alert {
        border-radius: 12px;
        padding: 0.875rem 1rem;
        margin-bottom: 1rem;
        font-size: 0.9rem;
    }

    .auth-alert.error {
        background: rgba(220, 53, 69, 0.1);
        border: 1px solid rgba(220, 53, 69, 0.3);
        color: #ff6b6b !important;
    }

    .auth-alert.success {
        background: rgba(34, 197, 94, 0.1);
        border: 1px solid rgba(34, 197, 94, 0.3);
        color: #4ade80 !important;
    }

    .auth-alert ul {
        list-style: none;
        padding: 0;
        margin: 0;
    }

    .auth-alert li {
        color: #ff6b6b !important;
        margin-bottom: 0.25rem;
    }

    .auth-alert li i {
        margin-right: 0.5rem;
    }

    /* Footer text */
    .auth-footer {
        text-align: center;
        margin-top: 1.25rem;
        font-size: 0.8rem;
        color: rgba(255, 255, 255, 0.45) !important;
        line-height: 1.5;
    }

    .auth-footer a {
        color: rgba(255, 255, 255, 0.6) !important;
        text-decoration: underline;
    }

    .auth-footer a:hover {
        color: #667eea !important;
    }

    /* Slide animation for form fields */
    .signup-fields {
        overflow: hidden;
        transition: max-height 0.3s ease, opacity 0.3s ease;
    }

    .signup-fields.hidden {
        max-height: 0;
        opacity: 0;
        pointer-events: none;
    }

    .signup-fields.visible {
        max-height: 500px;
        opacity: 1;
    }

    /* Input autofill */
    input:-webkit-autofill,
    input:-webkit-autofill:hover,
    input:-webkit-autofill:focus {
        -webkit-text-fill-color: white !important;
        -webkit-box-shadow: 0 0 0 1000px rgba(255, 255, 255, 0.1) inset !important;
        transition: background-color 5000s ease-in-out 0s;
    }

    /* Mobile */
    @media (max-width: 576px) {
        .auth-container {
            padding: 2rem 1.5rem;
            margin: 0.5rem;
        }
        .auth-title {
            font-size: 1.5rem;
        }
    }

/* Literary branding with theme-aware form surfaces. Scoped IDs protect this
   page from the site's general heading, form, and serif typography overrides. */
#auth-entry {
    --auth-surface: var(--card-bg, #fff);
    --auth-text: var(--text-primary, #263040);
    --auth-muted: color-mix(in srgb, var(--auth-text) 76%, var(--auth-surface));
    --auth-accent: var(--accent-color, #7865c8);
    --auth-border: color-mix(in srgb, var(--auth-text) 18%, transparent);
    --auth-field: color-mix(in srgb, var(--auth-surface) 93%, var(--auth-text));
    background: radial-gradient(ellipse at 20% 20%, color-mix(in srgb, var(--auth-accent) 20%, transparent), transparent 55%), radial-gradient(ellipse at 85% 75%, #506ab412, transparent 50%);
    padding: 40px 20px; overflow: visible;
}
body:is(.dark-mode, .night-mode) #auth-entry,
body[data-theme="midnight"] #auth-entry,
body[data-theme="luma"] #auth-entry { --auth-surface: #171b29; --auth-text: #f1edf6; --auth-field: #222838; }
#auth-entry, #auth-entry * { box-sizing: border-box; }
#auth-entry .auth-container { width: 100%; max-width: 440px; margin: 0; padding: 32px; background: var(--auth-surface); border: 1px solid var(--auth-border); border-radius: 22px; box-shadow: 0 18px 70px #080e2528; animation: none; }
#auth-entry :is(p,div,a,span,label,button,input,li) { font-family: Inter, system-ui, sans-serif !important; }
#auth-entry .auth-header { margin-bottom: 26px; }
#auth-entry .auth-brand-mark { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; margin: 0 auto 16px; background: color-mix(in srgb, var(--auth-accent) 16%, var(--auth-surface)); color: var(--auth-accent); }
#auth-entry .auth-title { font-family: Lora, Georgia, serif !important; font-size: clamp(25px, 5vw, 30px); font-weight: 600; letter-spacing: -.6px; line-height: 1.3; color: var(--auth-text) !important; -webkit-text-fill-color: var(--auth-text) !important; text-shadow: none; margin: 0 0 8px; }
#auth-entry .auth-subtitle { color: var(--auth-muted) !important; -webkit-text-fill-color: var(--auth-muted) !important; font-size: 13px; line-height: 1.6; margin: 0; }
#auth-entry .auth-tabs { background: var(--auth-field); border: 1px solid var(--auth-border); padding: 4px; margin-bottom: 24px; }
#auth-entry .tab-indicator { background: color-mix(in srgb, var(--auth-accent) 22%, var(--auth-surface)); box-shadow: 0 1px 4px #00000012; transition: left 180ms ease; }
#auth-entry .tab-btn { font-size: 14px; padding: 12px; color: var(--auth-muted) !important; -webkit-text-fill-color: var(--auth-muted) !important; }
#auth-entry .tab-btn.active { color: var(--auth-text) !important; -webkit-text-fill-color: var(--auth-text) !important; font-weight: 700; }
#auth-entry .auth-form label { color: var(--auth-text) !important; -webkit-text-fill-color: var(--auth-text) !important; font-size: 13px; font-weight: 500; margin-bottom: 8px; }
#auth-entry .auth-form input { min-height: 52px; padding: 13px 15px; background: var(--auth-field); border: 1px solid var(--auth-border); color: var(--auth-text) !important; -webkit-text-fill-color: var(--auth-text) !important; border-radius: 11px; font-size: 15px; }
#auth-entry .auth-form input[type="hidden"] { display: none; }
#auth-entry .password-wrapper input { padding-right: 48px; }
#auth-entry .auth-form input::placeholder { color: var(--auth-muted) !important; -webkit-text-fill-color: var(--auth-muted) !important; opacity: 1; }
#auth-entry .auth-form input:focus { border-color: var(--auth-accent); outline: 2px solid color-mix(in srgb, var(--auth-accent) 65%, transparent); outline-offset: 2px; box-shadow: none; background: var(--auth-field); }
#auth-entry .password-toggle { color: var(--auth-muted) !important; padding: 8px; }
#auth-entry .btn-primary-auth { min-height: 52px; font-size: 15px; font-weight: 600; background: linear-gradient(120deg, #7863c2, #5366b7); border: 1px solid transparent; border-radius: 11px; color: #fff !important; -webkit-text-fill-color: #fff !important; transition: filter 180ms ease; }
#auth-entry .btn-primary-auth:hover:not(:disabled) { filter: brightness(1.08); transform: none; box-shadow: 0 5px 18px #6252b02b; }
#auth-entry .auth-divider { margin: 22px 0 16px; color: var(--auth-muted); }
#auth-entry .auth-divider::before, #auth-entry .auth-divider::after { background: var(--auth-border); }
#auth-entry .auth-divider span { color: var(--auth-muted) !important; -webkit-text-fill-color: var(--auth-muted) !important; font-size: 12px; }
#auth-entry .auth-social-options { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 10px; }
#auth-entry .btn-social { min-height: 48px; padding: 10px 8px; margin: 0; gap: 9px; border: 1px solid var(--auth-border); border-radius: 10px; background: var(--auth-field); color: var(--auth-text) !important; -webkit-text-fill-color: var(--auth-text) !important; font-size: 14px; font-weight: 500; transition: border-color 180ms ease; }
#auth-entry .btn-social:hover { transform: none; background: var(--auth-field); border-color: var(--auth-accent); }
#auth-entry :is(.forgot-link, .auth-footer, .auth-closing-line) { color: var(--auth-muted) !important; -webkit-text-fill-color: var(--auth-muted) !important; font-size: 12px; line-height: 1.7; }
#auth-entry .forgot-link { margin-top: 18px; }
#auth-entry .auth-footer { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--auth-border); }
#auth-entry .auth-footer a { color: var(--auth-text) !important; -webkit-text-fill-color: var(--auth-text) !important; text-decoration: underline; text-underline-offset: 3px; }
#auth-entry .auth-closing-line { text-align: center; margin: 20px 0 0; }
#auth-entry :is(button,a):focus-visible { outline: 2px solid var(--auth-accent); outline-offset: 3px; }
#auth-entry .auth-alert { font-size: 13px; line-height: 1.6; }
@media (max-width: 480px) { #auth-entry { padding: 24px 16px; } #auth-entry .auth-container { padding: 24px 20px; } }
@media (prefers-reduced-motion: reduce) { #auth-entry * { animation: none !important; transition: none !important; } }
#auth-entry .auth-brand-mark, #auth-entry .auth-brand-mark svg { color: var(--auth-accent) !important; }
#auth-entry .btn-social { border-width: 1px !important; border-style: solid !important; border-color: var(--auth-border) !important; }
#auth-entry .btn-social:hover { border-color: var(--auth-accent) !important; }
#auth-entry { --auth-danger: #b42336; --auth-success: #166b36; }
body:is(.dark-mode, .night-mode) #auth-entry, body[data-theme="midnight"] #auth-entry, body[data-theme="luma"] #auth-entry { --auth-danger: #fda4af; --auth-success: #86efac; }
#auth-entry .auth-alert.error, #auth-entry .auth-alert.error li { color: var(--auth-danger) !important; -webkit-text-fill-color: var(--auth-danger) !important; }
#auth-entry .auth-alert.success { color: var(--auth-success) !important; -webkit-text-fill-color: var(--auth-success) !important; }
