/* Shared chrome for every screen in the standalone auth app: warm dark-mode
   palette, animated dot background, and the site footer. Loaded after
   css/app-theme.css so its rules (same specificity, later in cascade) win. */

body.login-page--auth {
    color: var(--app-ink, #0b1c30);
    background: #FBF9F4;
}

html[data-bs-theme="dark"] body.login-page--auth {
    background: #10120F;
    /* Re-point app-theme.css's dark palette vars (cool navy) to a warm palette
       matching mdd-homepage-marketplace-v2.html's dark theme, so every
       component reading var(--app-surface)/var(--app-ink)/etc. picks it up. */
    --app-surface: #1C201B;
    --app-surface-2: #171A15;
    --app-canvas: #10120F;
    --app-canvas-2: #171A15;
    --app-border: rgba(252, 175, 59, 0.14);
    --app-border-strong: rgba(252, 175, 59, 0.28);
    --app-ink: #F7F4EA;
    --app-ink-muted: #a9a496;
    --app-brand: #FCAF3B;
    --app-brand-dark: #E0961F;
}

html[data-bs-theme="dark"] .login-auth-submit,
html[data-bs-theme="dark"] .login-auth-submit-inline {
    color: #1B1D1C;
}

/* mdd-logo.svg is drawn in near-black ink; invert it to read on the dark card. */
.login-auth-logo { display: flex; justify-content: center; margin-bottom: 1.25rem; }
.login-auth-logo img { height: 32px; width: auto; }
html[data-bs-theme="dark"] .login-auth-logo img { filter: invert(1) brightness(1.7); }

.login-auth-title { margin-top: 0.5rem; }
.login-auth-newuser { text-align: center; font-size: 0.9rem; margin-top: 0.35rem; margin-bottom: 1.5rem; line-height: 1.5; color: var(--app-ink-muted, #565e74); }
.login-auth-newuser a { font-weight: 600; text-decoration: none; color: var(--app-brand, #0040e0); }
.login-auth-newuser a:hover { text-decoration: underline; }
.login-auth-help { text-align: center; margin-top: 1rem; font-size: 0.9rem; color: var(--app-ink-muted, #565e74); }
.login-auth-help a { color: var(--app-brand, #0040e0); }

.login-auth-back { display: block; text-align: center; margin-top: 1.25rem; font-size: 0.85rem; color: var(--app-ink-muted, #565e74); text-decoration: none; }
.login-auth-back:hover { text-decoration: underline; }

.login-auth-success-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    background: rgba(34, 197, 94, 0.14);
    color: #16a34a;
}

/* .login-theme-bar .app-icon-btn is styled white-on-transparent for the dark
   login-shell background; login-page--auth's background is light, so the
   toggle button is invisible there in light mode. Override for light mode. */
body.login-page--auth .login-theme-bar .app-icon-btn {
    background: rgba(11, 28, 48, 0.06);
    color: var(--app-ink, #0b1c30);
    border-color: rgba(11, 28, 48, 0.14);
}
body.login-page--auth .login-theme-bar .app-icon-btn:hover {
    background: rgba(11, 28, 48, 0.12);
    color: var(--app-ink, #0b1c30);
}
html[data-bs-theme="dark"] body.login-page--auth .login-theme-bar .app-icon-btn {
    background: rgba(255, 255, 255, 0.08);
    color: #f8fafc;
    border-color: rgba(255, 255, 255, 0.16);
}
html[data-bs-theme="dark"] body.login-page--auth .login-theme-bar .app-icon-btn:hover {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
}
.login-theme-bar { z-index: 2; }

/* Keep the card centered AND the footer visible in one viewport, without scrolling. */
.login-auth-page { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; position: relative; z-index: 1; }
.login-auth-page .login-auth-shell { min-height: 0; flex: 1 1 auto; }

/* Animated luminance-dot background (ported from mdd-homepage-marketplace-v2.html hero). */
.login-auth-bg-dots {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: .7;
}
html[data-bs-theme="dark"] .login-auth-bg-dots { opacity: .82; }

.login-auth-sitefooter {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.4rem 1rem;
    padding: 1.25rem 1rem;
    font-size: 0.8rem;
    color: var(--app-ink-muted, #565e74);
    flex: 0 0 auto;
    position: relative;
    z-index: 1;
    background: rgba(255, 255, 255, 0.6);
    border-top: 1px solid var(--app-border, rgba(11, 28, 48, 0.08));
    backdrop-filter: blur(6px);
}
html[data-bs-theme="dark"] .login-auth-sitefooter {
    background: rgba(16, 18, 15, 0.75);
}
.login-auth-sitefooter-links { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; }
.login-auth-sitefooter-links a { color: inherit; text-decoration: none; }
.login-auth-sitefooter-links a:hover { text-decoration: underline; }
.login-auth-sitefooter-sep { opacity: 0.4; }

/* Coming-soon social icons: keep them muted/monochrome in both themes so a
   brand color (e.g. Facebook's blue) doesn't pop against the warm dark palette. */
.login-auth-social-btn svg { filter: grayscale(1); }

/* --- Step signup flow (request-account.php) --- */
.login-auth-step { text-align: center; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--app-ink-muted, #565e74); margin-bottom: 0.5rem; }
.login-auth-social-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.65rem; margin: 1.25rem 0; }
.login-auth-social-circle {
    width: 3rem;
    height: 3rem;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--app-border-strong);
    background: var(--app-surface);
    cursor: not-allowed;
    opacity: 0.55;
}
.login-auth-social-circle svg { width: 1.35rem; height: 1.35rem; filter: grayscale(1); }
.login-auth-email-label { text-align: center; font-weight: 700; font-size: 0.92rem; margin: 0 0 0.75rem; }
.login-auth-step-actions { display: flex; justify-content: flex-end; margin-top: 1.5rem; }
.login-auth-submit-inline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.65rem 1.6rem;
    font-weight: 700;
    font-size: 0.92rem;
    border-radius: 0.75rem;
    border: none;
    background: #0b1c30;
    color: #fff;
    cursor: pointer;
    transition: background .15s ease;
}
.login-auth-submit-inline:hover { background: var(--app-brand-dark); }
html[data-bs-theme="dark"] .login-auth-submit-inline { background: var(--app-brand); }
html[data-bs-theme="dark"] .login-auth-submit-inline:hover { background: var(--app-brand-dark); }

textarea.login-auth-textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 0.7rem 0.9rem;
    border-radius: 0.75rem;
    border: 1px solid var(--app-border-strong);
    background: var(--app-surface-2);
    color: var(--app-ink);
    font-size: 0.9rem;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
}
textarea.login-auth-textarea:focus {
    outline: none;
    border-color: var(--app-brand);
    background: var(--app-surface);
}

/* --- Get help hub (get-help.php, find-account.php) --- */
.login-auth-icon-circle {
    width: 3rem;
    height: 3rem;
    border-radius: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    background: var(--app-surface-2);
    border: 1px solid var(--app-border);
    color: var(--app-ink-muted, #565e74);
}

.login-auth-help-list { margin-top: 1.5rem; }
.login-auth-help-row {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 1rem 0.25rem;
    border-top: 1px solid var(--app-border, rgba(11, 28, 48, .08));
    text-decoration: none;
    color: inherit;
    transition: background .12s ease;
    border-radius: 0.5rem;
}
.login-auth-help-row:first-child { border-top: none; }
.login-auth-help-row:hover { background: var(--app-border, rgba(11, 28, 48, .05)); color: inherit; }
.login-auth-help-row-icon {
    flex: 0 0 auto;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--app-surface-2);
    color: var(--app-ink, #0b1c30);
}
.login-auth-help-row-body { flex: 1 1 auto; min-width: 0; }
.login-auth-help-row-title { font-weight: 700; font-size: 0.95rem; }
.login-auth-help-row-sub { font-size: 0.8rem; color: var(--app-ink-muted, #565e74); margin-top: 0.15rem; }
.login-auth-help-row-chevron { flex: 0 0 auto; color: var(--app-ink-muted, #565e74); }

.login-auth-btn-row { display: flex; justify-content: flex-end; gap: 0.75rem; margin-top: 1.5rem; }
.login-auth-btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.65rem 1.3rem;
    font-weight: 700;
    font-size: 0.92rem;
    border-radius: 0.75rem;
    border: 1px solid var(--app-border-strong, rgba(11, 28, 48, .14));
    background: transparent;
    color: var(--app-ink, #0b1c30);
    text-decoration: none;
    cursor: pointer;
}
.login-auth-btn-secondary:hover { background: var(--app-border, rgba(11, 28, 48, .06)); color: var(--app-ink, #0b1c30); }

/* --- Long-form content pages (terms, privacy, common-sign-in-issues) ---
   These still sit inside the same card (background/border/shadow) as every
   other screen, just wider and left-aligned, instead of floating bare text
   directly on top of the animated dot background. */
.login-auth-card--wide { max-width: 640px; text-align: left; }
.login-auth-card--wide h1 { margin-bottom: 0.25rem; }
.login-auth-card--wide .login-legal-updated { opacity: 0.65; font-size: 0.85rem; margin-bottom: 1.75rem; }
.login-auth-card--wide h2 { font-size: 1.05rem; margin-top: 1.75rem; margin-bottom: 0.5rem; }
.login-auth-card--wide p,
.login-auth-card--wide li { opacity: 0.85; }
.login-auth-card--wide .login-auth-newuser,
.login-auth-card--wide .login-auth-help { text-align: left; }

/* --- Identity verification / OTP / update-password step pages --- */
.login-auth-envelope {
    width: 3rem;
    height: 3rem;
    border-radius: 0.5rem;
    border: 1px solid var(--app-border-strong, rgba(11, 28, 48, .16));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
    color: var(--app-ink-muted, #565e74);
}

.login-auth-masked-email { font-weight: 700; letter-spacing: 0.02em; }

.login-auth-otp-row { display: flex; justify-content: center; gap: 0.6rem; margin: 1.5rem 0; }
.login-auth-otp-box {
    width: 3rem;
    height: 3.5rem;
    text-align: center;
    font-size: 1.4rem;
    font-weight: 700;
    border-radius: 0.75rem;
    border: 1px solid var(--app-border-strong);
    background: var(--app-surface-2);
    color: var(--app-ink);
}
.login-auth-otp-box:focus {
    outline: none;
    border-color: var(--app-brand);
    background: var(--app-surface);
    box-shadow: 0 0 0 3px rgba(var(--wl-primary-rgb), 0.16);
}

.login-auth-resend-row { display: flex; justify-content: center; margin: 1rem 0 1.5rem; }

/* verify-identity.php / verify-code.php center their Continue button, unlike
   the right-aligned step actions on the account-creation flow. */
.login-auth-step-actions--center { justify-content: center; }
.login-auth-resend-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1.1rem;
    font-weight: 700;
    font-size: 0.85rem;
    border-radius: 999px;
    border: 1px solid var(--app-border-strong);
    background: transparent;
    color: var(--app-ink-muted, #565e74);
    cursor: pointer;
}
.login-auth-resend-btn:hover:not(:disabled) { background: var(--app-border, rgba(11, 28, 48, .06)); color: var(--app-ink); }
.login-auth-resend-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.login-auth-identity-card {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin: 1rem 0 1.75rem;
}
.login-auth-avatar {
    width: 3rem;
    height: 3rem;
    border-radius: 999px;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    color: #fff;
    background: linear-gradient(135deg, #d63bd8 0%, #8a3ffc 55%, #3f6bfc 100%);
}
.login-auth-identity-name { font-weight: 700; font-size: 0.95rem; }
.login-auth-identity-email { font-size: 0.82rem; color: var(--app-ink-muted, #565e74); }
.login-auth-identity-tag { font-size: 0.75rem; font-weight: 700; color: var(--app-brand, #0040e0); margin-top: 0.1rem; }

.login-auth-check-row { display: flex; align-items: flex-start; gap: 0.6rem; margin: 0.25rem 0 1.5rem; font-size: 0.85rem; }
.login-auth-check-row input[type="checkbox"] { margin-top: 0.2rem; width: 1rem; height: 1rem; accent-color: var(--app-brand, #0040e0); }
