/* ==========================================================================
   Loftybits public site
   Brand: indigo #4F46E5 · sky #0EA5E9 · emerald #10B981 · navy #0F172A · neutral #E2E8F0
   Every class is lb- prefixed and element rules are scoped to .lb-site, so this
   sheet can load globally next to Bootstrap without touching admin pages.
   ========================================================================== */
@font-face {
    font-family: "Plus Jakarta Sans";
    src: url("/fonts/PlusJakartaSans.woff2") format("woff2");
    font-weight: 200 800;
    font-style: normal;
    font-display: swap;
}

:root {
    /* Navy scale */
    --navy-950: #0a1020;
    --navy-900: #0f172a;
    --navy-800: #162036;
    --navy-700: #1e2a47;

    /* Brand colours (+ lighter tints that keep contrast on navy) */
    --indigo-700: #3730a3;
    --indigo-600: #4f46e5;
    --indigo-500: #6366f1;
    --indigo-400: #818cf8;
    --sky-500: #0ea5e9;
    --sky-400: #38bdf8;
    --emerald-600: #059669;
    --emerald-500: #10b981;
    --emerald-400: #34d399;

    /* Neutrals */
    --slate-50: #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-300: #cbd5e1;
    --slate-400: #94a3b8;
    --slate-500: #64748b;
    --slate-600: #475569;
    --slate-700: #334155;

    /* Semantic: dark surfaces */
    --on-dark: #f8fafc;
    --on-dark-muted: #a8b4c8;
    --line-dark: rgba(148, 163, 184, 0.16);
    --glass: rgba(22, 32, 54, 0.72);

    /* Semantic: light surfaces */
    --on-light: var(--navy-900);
    --on-light-muted: var(--slate-600);
    --line-light: var(--slate-200);

    --grad-brand: linear-gradient(135deg, var(--sky-500) 0%, var(--indigo-600) 100%);
    --grad-text: linear-gradient(100deg, #38bdf8 0%, #818cf8 52%, #34d399 100%);

    --font-sans: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

    --radius-sm: 0.75rem;
    --radius-md: 1.15rem;
    --radius-lg: 1.6rem;
    --radius-xl: 2rem;

    --shadow-card: 0 1px 2px rgba(15, 23, 42, 0.06), 0 12px 32px -12px rgba(15, 23, 42, 0.18);
    --shadow-dark: 0 24px 60px -24px rgba(2, 6, 23, 0.7);
    --shadow-glow: 0 10px 30px -8px rgba(79, 70, 229, 0.6);

    --container: 76rem;
    --gutter: clamp(1rem, 4vw, 2rem);
    --header-offset: 6.5rem;
}

/* ---- Public site wrapper ------------------------------------------------
   Base element rules use :where(.lb-site) so they carry no extra specificity:
   component classes (buttons, nav links) must always be able to override them.
   Everything below is scoped to .lb-site so Bootstrap/admin pages are untouched.
   The wrapper also re-points AffirmBackend's theme variables at the brand, so the
   legacy public cards (support, legal) pick up the new palette automatically. */

.lb-site {
    --page-bg: var(--navy-900);
    --panel-bg: linear-gradient(180deg, rgba(22, 32, 54, 0.86), rgba(15, 23, 42, 0.86));
    --panel-border: var(--line-dark);
    --ink: var(--on-dark);
    --muted: var(--on-dark-muted);
    --accent: var(--sky-400);
    --accent-2: var(--emerald-400);
    --accent-soft: rgba(56, 189, 248, 0.12);
    --shadow: var(--shadow-dark);
    --field-bg: rgba(2, 6, 23, 0.4);
    --field-border: rgba(148, 163, 184, 0.28);
    --danger: #fca5a5;

    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: clip;
    background: var(--navy-900);
    color: var(--on-dark);
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.6;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

body:has(.lb-site) {
    background: var(--navy-900);
}

html:has(.lb-site) {
    scroll-behavior: smooth;
    scroll-padding-top: var(--header-offset);
}

:where(.lb-site) :is(h1, h2, h3, h4, h5, h6) {
    font-family: inherit;
    color: inherit;
}

:where(.lb-site) a {
    color: inherit;
}

:where(.lb-site) :is(button, input, textarea, select) {
    font: inherit;
}

:where(.lb-site) ::selection {
    background: rgba(79, 70, 229, 0.4);
    color: #fff;
}

:where(.lb-site) :focus-visible {
    outline: 3px solid var(--sky-400);
    outline-offset: 3px;
    border-radius: 0.35rem;
}

.lb-main {
    flex: 1 0 auto;
}

.lb-skip-link {
    position: fixed;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 100;
    padding: 0.6rem 1rem;
    border-radius: 999px;
    background: var(--indigo-600);
    color: #fff;
    font-weight: 700;
    text-decoration: none;
    transform: translateY(-200%);
    transition: transform 160ms ease;
}

.lb-skip-link:focus-visible {
    transform: translateY(0);
}

/* ---- Layout primitives, type, buttons ---------------------------------- */

/* ---- Layout primitives ------------------------------------------------- */

.lb-container {
    width: 100%;
    max-width: calc(var(--container) + var(--gutter) * 2);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.lb-band {
    position: relative;
    padding-block: clamp(3.5rem, 8vw, 6rem);
}

.lb-band-dark {
    background: var(--navy-900);
    color: var(--on-dark);
}

.lb-band-deep {
    background: var(--navy-950);
    color: var(--on-dark);
}

.lb-band-light {
    background: var(--slate-50);
    color: var(--on-light);
}

/* ---- Type -------------------------------------------------------------- */

.lb-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    margin: 0 0 1rem;
    color: var(--sky-400);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.lb-eyebrow::before {
    content: "";
    width: 1.6rem;
    height: 2px;
    border-radius: 2px;
    background: var(--grad-brand);
}

.lb-band-light .lb-eyebrow {
    color: var(--indigo-600);
}

.lb-gradient-text {
    background: var(--grad-text);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.lb-section-heading {
    max-width: 46rem;
    margin-bottom: clamp(1.75rem, 4vw, 2.75rem);
}

.lb-section-heading h2 {
    margin: 0;
    font-size: clamp(2rem, 4.2vw, 3.1rem);
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: -0.035em;
}

.lb-section-heading p:not(.lb-eyebrow) {
    margin: 1.1rem 0 0;
    color: var(--on-dark-muted);
    font-size: 1.08rem;
    line-height: 1.7;
}

.lb-band-light .lb-section-heading p:not(.lb-eyebrow) {
    color: var(--on-light-muted);
}

/* ---- Buttons ----------------------------------------------------------- */

.lb-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    min-height: 3rem;
    padding: 0.8rem 1.5rem;
    border: 1px solid transparent;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.97rem;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition:
        transform 160ms ease,
        background-color 160ms ease,
        border-color 160ms ease,
        box-shadow 160ms ease,
        color 160ms ease;
}

.lb-btn:hover {
    transform: translateY(-1px);
}

.lb-btn:active {
    transform: translateY(0);
}

.lb-btn-primary {
    background: var(--indigo-600);
    color: #fff;
    box-shadow: var(--shadow-glow);
}

.lb-btn-primary:hover {
    background: var(--indigo-500);
}

.lb-btn-light {
    background: #fff;
    color: var(--navy-900);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

.lb-btn-light:hover {
    background: var(--slate-100);
}

.lb-btn-secondary {
    border-color: rgba(203, 213, 225, 0.28);
    background: rgba(255, 255, 255, 0.04);
    color: var(--on-dark);
}

.lb-btn-secondary:hover {
    border-color: rgba(203, 213, 225, 0.5);
    background: rgba(255, 255, 255, 0.09);
}

.lb-band-light .lb-btn-secondary {
    border-color: var(--slate-300);
    background: #fff;
    color: var(--navy-900);
}

.lb-band-light .lb-btn-secondary:hover {
    border-color: var(--slate-400);
    background: var(--slate-100);
}

.lb-btn[disabled],
.lb-btn:disabled {
    opacity: 0.7;
    cursor: wait;
    transform: none;
}

/* ---- Status pages (404 / error) ----------------------------------------- */

/* ---- Status pages (404 / error) ---------------------------------------- */

.lb-status-page {
    display: grid;
    align-items: center;
    min-height: 100vh;
    overflow: clip;
    padding-block: 8rem 5rem;
}

.lb-status-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(44rem 30rem at 90% 0%, rgba(79, 70, 229, 0.5), transparent 70%),
        radial-gradient(38rem 26rem at 0% 100%, rgba(16, 185, 129, 0.2), transparent 70%);
}

.lb-status-body {
    position: relative;
    max-width: 46rem;
    text-align: center;
}

.lb-status-code {
    margin: 0;
    font-size: clamp(5rem, 18vw, 9rem);
    font-weight: 800;
    letter-spacing: -0.06em;
    line-height: 1;
}

.lb-status-body h1 {
    margin: 0.5rem 0 0;
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 800;
    letter-spacing: -0.035em;
    line-height: 1.1;
}

.lb-status-copy {
    max-width: 34rem;
    margin: 1.2rem auto 0;
    color: var(--on-dark-muted);
    font-size: 1.08rem;
    line-height: 1.75;
}

.lb-status-copy a {
    color: var(--sky-400);
    font-weight: 700;
}

.lb-status-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.85rem;
    margin-top: 2rem;
}

/* ---- Legacy public content (support, legal) inside the new chrome -------- */

.lb-public-content {
    padding-top: clamp(7rem, 11vw, 8.5rem);
    padding-bottom: clamp(3rem, 6vw, 4.5rem);
}

:is(.lb-public-content, .lb-auth-card) :is(.legal-shell, .section-card) {
    border-radius: var(--radius-xl);
}

:is(.lb-public-content, .lb-auth-card) .legal-shell {
    max-width: 52rem;
}

/* "← App name" link above an app's support/privacy/terms content. */
.lb-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 1.25rem;
    color: var(--on-dark-muted);
    font-size: 0.92rem;
    font-weight: 600;
    text-decoration: none;
    transition: color 150ms ease;
}

.lb-back-link:hover {
    color: #fff;
}

:is(.lb-public-content, .lb-auth-card) .legal-content a,
:is(.lb-public-content, .lb-auth-card) .section-card a:not(.btn) {
    color: var(--sky-400);
    font-weight: 600;
}

:is(.lb-public-content, .lb-auth-card) .legal-content :is(p, li) {
    color: var(--on-dark-muted);
    line-height: 1.75;
}

:is(.lb-public-content, .lb-auth-card) :is(h1, h2) {
    font-weight: 800;
    letter-spacing: -0.03em;
}

:is(.lb-public-content, .lb-auth-card) .btn {
    border-radius: 999px;
    padding: 0.6rem 1.25rem;
    font-weight: 700;
}

:is(.lb-public-content, .lb-auth-card) .btn-primary {
    border-color: var(--indigo-600);
    background: var(--indigo-600);
    color: #fff;
}

:is(.lb-public-content, .lb-auth-card) .btn-primary:hover,
:is(.lb-public-content, .lb-auth-card) .btn-primary:focus {
    border-color: var(--indigo-500);
    background: var(--indigo-500);
    color: #fff;
}

:is(.lb-public-content, .lb-auth-card) .btn-outline-dark {
    border-color: rgba(203, 213, 225, 0.28);
    color: var(--on-dark);
}

:is(.lb-public-content, .lb-auth-card) :is(.form-control, .form-select) {
    border-color: rgba(148, 163, 184, 0.28);
    background: rgba(2, 6, 23, 0.4);
    color: var(--on-dark);
}

@media (max-width: 820px) {
    /* The header stops floating on small screens, so no clearance is needed. */
    .lb-public-content {
        padding-top: 1.5rem;
    }
}

:is(.lb-public-content, .lb-auth-card) :is(.form-control, .form-select):focus {
    border-color: var(--sky-400);
    background: rgba(2, 6, 23, 0.55);
    color: var(--on-dark);
    box-shadow: 0 0 0 0.25rem rgba(56, 189, 248, 0.2);
}

/* ---- Motion ------------------------------------------------------------ */


/* ---- Sign-in and account pages (Identity) ------------------------------- */

.lb-auth {
    align-items: center;
    padding: 1.25rem var(--gutter) 1.5rem;
}

.lb-auth-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(44rem 30rem at 90% -5%, rgba(79, 70, 229, 0.45), transparent 70%),
        radial-gradient(36rem 26rem at 0% 105%, rgba(16, 185, 129, 0.18), transparent 70%);
}

.lb-auth-top,
.lb-auth-main,
.lb-auth-foot {
    position: relative;
    width: 100%;
    max-width: 30rem;
}

.lb-auth-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: clamp(1.5rem, 6vh, 3.5rem);
}

.lb-auth-brand img {
    display: block;
    width: auto;
    height: 2rem;
}

.lb-auth-back,
.lb-auth-foot a {
    color: var(--on-dark-muted);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
}

.lb-auth-back:hover,
.lb-auth-foot a:hover {
    color: #fff;
}

.lb-auth-main {
    flex: 1 0 auto;
}

.lb-auth-card {
    padding: clamp(1.5rem, 5vw, 2.25rem);
    border: 1px solid var(--line-dark);
    border-radius: var(--radius-xl);
    background:
        linear-gradient(160deg, rgba(79, 70, 229, 0.16), transparent 45%),
        var(--glass);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    box-shadow: var(--shadow-dark), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.lb-auth-card h1 {
    margin: 0 0 0.6rem;
    font-size: clamp(1.7rem, 4vw, 2.1rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.15;
}

.lb-auth-card h2,
.lb-auth-card h3 {
    margin: 0 0 1rem;
    font-size: 1.1rem;
    font-weight: 700;
}

.lb-auth-card hr {
    border-color: var(--line-dark);
    opacity: 1;
}

.lb-auth-kicker {
    margin: 0 0 0.75rem;
    color: var(--sky-400);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.lb-auth-lead {
    margin: 0 0 1.5rem;
    color: var(--on-dark-muted);
    line-height: 1.6;
}

/* Identity pages wrap forms in Bootstrap grid columns; inside the card they should span the full width. */
.lb-auth-card .row {
    margin-inline: 0;
}

.lb-auth-card .row > [class*="col-"] {
    flex: 0 0 100%;
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    padding-inline: 0;
}

.lb-auth-card a:not(.btn) {
    color: var(--sky-400);
    font-weight: 600;
    text-decoration: none;
}

.lb-auth-card a:not(.btn):hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.lb-auth-card :is(p, label, .form-label) {
    color: var(--on-dark-muted);
}

.lb-auth-card .form-floating > label {
    color: var(--on-dark-muted);
}

.lb-auth-card .form-floating > .form-control:focus ~ label,
.lb-auth-card .form-floating > .form-control:not(:placeholder-shown) ~ label {
    color: var(--on-dark-muted);
}

.lb-auth-card .form-floating > .form-control:focus ~ label::after,
.lb-auth-card .form-floating > .form-control:not(:placeholder-shown) ~ label::after {
    background: transparent;
}

.lb-auth-card .form-control {
    border-radius: var(--radius-sm);
}

.lb-auth-card .form-check-input {
    border-color: rgba(148, 163, 184, 0.5);
    background-color: rgba(2, 6, 23, 0.4);
}

.lb-auth-card .form-check-input:checked {
    border-color: var(--indigo-600);
    background-color: var(--indigo-600);
}

.lb-auth-card .btn-link {
    color: var(--sky-400);
    font-weight: 600;
    text-decoration: none;
}

.lb-auth-card .text-danger,
.lb-auth-card .validation-message {
    color: #fca5a5 !important;
}

.lb-auth-card .alert {
    border-radius: var(--radius-sm);
}

.lb-auth-divider {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin: 1.25rem 0 0.5rem;
    color: var(--slate-400);
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.lb-auth-divider::before,
.lb-auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--line-dark);
}

.lb-auth-links {
    display: grid;
    gap: 0.4rem;
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--line-dark);
}

.lb-auth-links p {
    margin: 0;
}

/* Two per row on wider screens: "Forgot password" and "Register" side by side. */
@media (min-width: 560px) {
    .lb-auth-links {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 1.5rem;
    }

    .lb-auth-links p:nth-child(even) {
        text-align: right;
    }

    /* An odd link out (e.g. "Resend email confirmation") gets the full row instead of wrapping. */
    .lb-auth-links p:last-child:nth-child(odd) {
        grid-column: 1 / -1;
    }
}

.lb-auth-external {
    margin-top: 1.25rem;
}

.lb-auth-foot {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.4rem 1.25rem;
    margin-top: 2rem;
    color: var(--slate-400);
    font-size: 0.85rem;
}

@media (prefers-reduced-motion: reduce) {
    html:has(.lb-site) {
        scroll-behavior: auto;
    }

    .lb-site *,
    .lb-site *::before,
    .lb-site *::after {
        animation-duration: 0.01ms !important;
        animation-delay: 0ms !important;
        transition-duration: 0.01ms !important;
    }
}
