@font-face {
    font-family: "Outfit";
    font-style: normal;
    font-weight: 400 900;
    font-display: swap;
    src: url("/public/fonts/outfit-latin-variable.woff2") format("woff2");
}

@font-face {
    font-family: "Work Sans";
    font-style: normal;
    font-weight: 300 700;
    font-display: swap;
    src: url("/public/fonts/work-sans-latin-variable.woff2") format("woff2");
}

:root {
    --auth-type-2xs: 11px;
    --auth-type-xs: 12px;
    --auth-type-sm: 13px;
    --auth-type-ui: 14px;
    --auth-type-body: 16px;
    --auth-type-lg: 18px;
    --auth-type-xl: 20px;
    --auth-type-2xl: 24px;
    --auth-type-display: 28px;
    --auth-purple: #8a2be2;
    --auth-purple-bright: #a855f7;
    --auth-purple-strong: #6d1dba;
    --auth-purple-soft: #b57aff;
    --auth-purple-deep: #45107f;
    --auth-lime: #c6fb2f;
    --auth-lime-bright: #dcff6b;
    --auth-lime-deep: #93c400;
    --auth-lime-ink: #12200a;
    --auth-dark: #0a0611;
    --auth-dark-1: #0c0717;
    --auth-dark-2: #150b28;
    --auth-dark-3: #1d1138;
    --auth-paper: #f6f4fb;
    --auth-white: #fff;
    --auth-on-dark: #f5f1fc;
    --auth-muted: #a9a0bd;
    --auth-dim: #706782;
    --auth-body: #322b40;
    --auth-line: rgba(255, 255, 255, .12);
    --auth-line-soft: rgba(255, 255, 255, .08);
    --auth-field: rgba(5, 3, 12, .54);
    --auth-danger: #ff9da8;
    --auth-danger-bg: rgba(255, 93, 112, .1);
    --auth-success: #d7ff82;
    --auth-success-bg: rgba(198, 251, 47, .1);
    --auth-ease: cubic-bezier(.16, 1, .3, 1);
    --auth-shadow: 0 30px 80px rgba(0, 0, 0, .34);
    --auth-shadow-purple: 0 16px 40px rgba(109, 29, 186, .3);
}

* { box-sizing: border-box; }

html {
    min-height: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.auth-page {
    min-height: 100vh;
    margin: 0;
    padding: 28px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
    color: var(--auth-on-dark);
    background: var(--auth-dark);
    font-family: "Work Sans", system-ui, sans-serif;
    line-height: 1.55;
    position: relative;
}

body.auth-page::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: .5;
    background-image: linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: linear-gradient(to bottom, black, transparent 80%);
}

body.auth-page::after {
    content: '';
    position: fixed;
    inset: -35%;
    pointer-events: none;
    background: radial-gradient(circle at 25% 20%, rgba(138, 43, 226, .25), transparent 28%), radial-gradient(circle at 78% 18%, rgba(198, 251, 47, .08), transparent 22%), radial-gradient(circle at 60% 80%, rgba(109, 29, 186, .18), transparent 30%);
    animation: auth-drift 24s ease-in-out infinite alternate;
}

body.auth-page > * { position: relative; z-index: 1; }

@keyframes auth-drift {
    from { transform: translate3d(0, 0, 0) rotate(0deg); }
    to { transform: translate3d(-2%, 2%, 0) rotate(2deg); }
}

.auth-stage,
.login-container,
.shell,
.panel,
body.auth-page > .card {
    width: min(100%, 560px);
}

.login-container { max-width: 440px; }

.login-box,
.shell,
.panel,
body.auth-page > .card {
    padding: clamp(28px, 5vw, 44px);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(181, 122, 255, .22);
    border-radius: 10px;
    background: linear-gradient(145deg, rgba(29, 17, 56, .93), rgba(12, 7, 23, .94));
    box-shadow: var(--auth-shadow), 0 0 0 1px rgba(255, 255, 255, .025) inset;
    backdrop-filter: blur(18px) saturate(130%);
    animation: auth-enter .6s var(--auth-ease) both;
}

.login-box::before,
.shell::before,
.panel::before,
body.auth-page > .card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--auth-lime), var(--auth-purple-bright), transparent 78%);
}

@keyframes auth-enter {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: translateY(0); }
}

.auth-page h1 {
    margin: 0;
    color: var(--auth-white);
    font-family: "Outfit", system-ui, sans-serif;
    font-size: clamp(24px, 4vw, 34px);
    font-weight: 800;
    letter-spacing: -.04em;
    line-height: .98;
}

.login-box h1 { text-align: center; }
.auth-logo { display: block; width: 56px; height: 56px; margin: 0 auto 24px; border-radius: 6px; box-shadow: var(--auth-shadow-purple); }

.subtitle,
.sub,
.auth-page p {
    color: var(--auth-muted);
    font-size: var(--auth-type-ui);
    line-height: 1.65;
}

.subtitle { margin: 10px 0 30px; text-align: center; }
.login-box .subtitle { margin-bottom: 32px; }

.eyebrow,
.invite-chip,
.label,
.sec-label,
.auth-kicker {
    color: var(--auth-lime);
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: var(--auth-type-2xs);
    font-weight: 700;
    letter-spacing: .13em;
    line-height: 1.3;
    text-transform: uppercase;
}

.eyebrow { margin-bottom: 10px; }

.eyebrow::before,
.auth-kicker::before {
    content: '';
    display: inline-block;
    width: 22px;
    height: 2px;
    margin: 0 9px 3px 0;
    background: var(--auth-lime);
}

.auth-page a {
    color: var(--auth-purple-soft);
    text-decoration: none;
    transition: color .2s var(--auth-ease), opacity .2s var(--auth-ease);
}

.auth-page a:hover { color: var(--auth-lime); }

.auth-page form { position: relative; z-index: 1; }

.auth-page label {
    display: block;
    margin: 0 0 7px;
    color: var(--auth-muted);
    font-family: "Outfit", system-ui, sans-serif;
    font-size: var(--auth-type-2xs);
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.auth-page input:not([type='hidden']) {
    width: 100%;
    min-height: 46px;
    margin: 0 0 18px;
    padding: 11px 14px;
    border: 1px solid var(--auth-line);
    border-radius: 6px;
    outline: 0;
    color: var(--auth-on-dark);
    background: var(--auth-field);
    font: inherit;
    font-size: var(--auth-type-ui);
    transition: border-color .22s var(--auth-ease), box-shadow .22s var(--auth-ease), background .22s var(--auth-ease);
}

.auth-page input:not([type='hidden'])::placeholder { color: var(--auth-dim); }

.auth-page input:not([type='hidden']):focus {
    border-color: var(--auth-purple-bright);
    background: rgba(5, 3, 12, .72);
    box-shadow: 0 0 0 3px rgba(168, 85, 247, .18);
}

.auth-page button,
.auth-page .btn {
    display: inline-flex;
    width: 100%;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    padding: 12px 18px;
    border: 0;
    border-radius: 6px;
    color: var(--auth-lime-ink);
    background: linear-gradient(135deg, var(--auth-lime-bright), var(--auth-lime-deep));
    box-shadow: 0 14px 34px rgba(147, 196, 0, .22);
    cursor: pointer;
    font-family: "Outfit", system-ui, sans-serif;
    font-size: var(--auth-type-xs);
    font-weight: 800;
    letter-spacing: .04em;
    line-height: 1.2;
    text-decoration: none;
    text-transform: uppercase;
    transition: transform .22s var(--auth-ease), box-shadow .22s var(--auth-ease), filter .22s var(--auth-ease);
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%);
}

.auth-page button:hover,
.auth-page .btn:hover { filter: brightness(1.08); transform: translateY(-2px); box-shadow: 0 18px 40px rgba(147, 196, 0, .3); }
.auth-page button:active,
.auth-page .btn:active { transform: translateY(0); }

.auth-page button:focus-visible,
.auth-page a:focus-visible,
.auth-page input:focus-visible { outline: 3px solid rgba(198, 251, 47, .7); outline-offset: 3px; }

.error,
.success,
.sec-error,
.sec-ok {
    margin: 0 0 20px;
    padding: 13px 15px;
    border-radius: 6px;
    font-size: var(--auth-type-sm);
    line-height: 1.55;
}

.error,
.sec-error { color: var(--auth-danger); background: var(--auth-danger-bg); border: 1px solid rgba(255, 93, 112, .24); }
.success,
.sec-ok { color: var(--auth-success); background: var(--auth-success-bg); border: 1px solid rgba(198, 251, 47, .24); }
.error ul { margin: 0; padding-left: 18px; }

.divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 22px 0 16px;
    color: var(--auth-dim);
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: var(--auth-type-2xs);
    letter-spacing: .08em;
    text-transform: uppercase;
}

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

.auth-page .google-btn {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 46px;
    padding: 11px 16px;
    border: 1px solid var(--auth-line);
    border-radius: 6px;
    color: var(--auth-on-dark);
    background: rgba(255, 255, 255, .045);
    font-family: "Outfit", system-ui, sans-serif;
    font-size: var(--auth-type-xs);
    font-weight: 700;
    transition: transform .22s var(--auth-ease), border-color .22s var(--auth-ease), background .22s var(--auth-ease);
}

.auth-page .google-btn:hover { border-color: rgba(198, 251, 47, .4); background: rgba(255, 255, 255, .08); transform: translateY(-2px); }

.footer,
.back,
.already { color: var(--auth-dim); font-size: var(--auth-type-xs); text-align: center; }
.auth-link-row { position: relative; z-index: 1; margin-top: 16px; color: var(--auth-muted); font-size: var(--auth-type-sm); text-align: center; }
.auth-link-row a { color: var(--auth-muted); font-weight: 600; }
.auth-legal { display: flex; justify-content: center; gap: 14px; margin-top: 16px; position: relative; z-index: 1; font-size: var(--auth-type-2xs); }
.auth-legal a { color: var(--auth-dim); }
.footer { margin-top: 20px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; line-height: 1.6; letter-spacing: .04em; }
.footer span { color: var(--auth-lime); }
.back { margin-top: 22px; }
.already { margin: 18px 0 0; }
.back a,
.already a { color: var(--auth-muted); }

.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.brand img { width: 44px; height: 44px; border-radius: 6px; box-shadow: var(--auth-shadow-purple); }
.brand strong { color: var(--auth-white); font-family: "Outfit", system-ui, sans-serif; font-size: var(--auth-type-ui); letter-spacing: -.02em; }

.invite-chip,
.scope {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 26px;
    padding: 5px 10px;
    border: 1px solid rgba(198, 251, 47, .3);
    border-radius: 999px;
    color: var(--auth-lime);
    background: rgba(198, 251, 47, .08);
    letter-spacing: .08em;
}

.auth-page .card,
.auth-page .sec-card {
    border: 1px solid var(--auth-line);
    border-radius: 6px;
    background: rgba(255, 255, 255, .035);
}

.card { margin: 22px 0; padding: 18px 20px; }
.row,
.sec-row { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--auth-line-soft); }
.row:last-child,
.sec-row:last-child { border-bottom: 0; }
.label,
.sec-label { color: var(--auth-dim); font-size: var(--auth-type-2xs); }
.value,
.sec-value { color: var(--auth-on-dark); font-size: var(--auth-type-ui); font-weight: 700; text-align: right; overflow-wrap: anywhere; }
.mono,
.sec-note code,
.codes code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.mono { max-width: 65%; color: var(--auth-muted); font-size: var(--auth-type-2xs); }
.hint,
.sec-note { color: var(--auth-dim); font-size: var(--auth-type-xs); line-height: 1.6; }
.auth-form-action { margin-top: 16px; }

.actions { display: flex; gap: 12px; margin-top: 28px; }
.actions button { flex: 1; }
.actions .deny { color: var(--auth-on-dark); background: transparent; border: 1px solid var(--auth-line); box-shadow: none; clip-path: none; }
.actions .deny:hover { background: rgba(255, 255, 255, .06); box-shadow: none; }
.expired { padding: 16px 0; text-align: center; }
.expired h1 { margin-top: 14px; }
.expired p { margin: 10px 0 22px; }

/* Account security */
.auth-page--security { align-items: flex-start; }
.sec-shell { width: min(100%, 1040px); padding: 32px 0 56px; }
.sec-hero { margin-bottom: 18px; padding: 28px; border: 1px solid rgba(181, 122, 255, .22); border-radius: 10px; background: linear-gradient(135deg, rgba(69, 16, 127, .48), rgba(21, 11, 40, .8)); box-shadow: var(--auth-shadow); }
.sec-hero h1 { margin-bottom: 10px; }
.sec-hero p { max-width: 720px; margin: 0; }
.sec-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 18px; }
.sec-card { padding: 22px; }
.sec-card h2 { margin: 0 0 14px; color: var(--auth-white); font-family: "Outfit", system-ui, sans-serif; font-size: var(--auth-type-body); letter-spacing: -.02em; }
.sec-form { display: grid; gap: 12px; margin-top: 14px; }
.sec-form input:not([type='hidden']) { margin: 0; }
.sec-form button { margin-top: 2px; }
.sec-ok,
.sec-error { margin-bottom: 16px; }
.security-codes { margin-bottom: 16px; }
.codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.codes code { display: block; padding: 10px 12px; border: 1px solid var(--auth-line); border-radius: 6px; color: var(--auth-lime); background: rgba(0, 0, 0, .18); font-size: var(--auth-type-sm); letter-spacing: .08em; }
.qr-shell { margin-top: 14px; padding: 14px; border: 1px solid var(--auth-line); border-radius: 6px; background: rgba(0, 0, 0, .14); }
.qr-grid { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 16px; align-items: start; }
.qr-box { width: 240px; height: 240px; display: flex; align-items: center; justify-content: center; padding: 12px; border: 1px solid rgba(0, 0, 0, .08); border-radius: 6px; background: #fff; box-shadow: 0 10px 30px rgba(0, 0, 0, .18); }
.qr-box canvas { display: block; width: 100%; height: 100%; }
.qr-copy { display: grid; gap: 10px; }
.qr-copy h3 { margin: 0; color: var(--auth-white); font-family: "Outfit", system-ui, sans-serif; font-size: var(--auth-type-ui); }
.qr-copy p { margin: 0; }
.secret-card { padding: 12px; }
.secret-value { margin-top: 6px; color: var(--auth-lime); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: var(--auth-type-lg); font-weight: 900; letter-spacing: .12em; overflow-wrap: anywhere; }
.provisioning-uri { overflow-wrap: anywhere; }
.auth-badge { display: inline-flex; align-items: center; min-height: 24px; padding: 4px 9px; border: 1px solid var(--auth-line); border-radius: 999px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: var(--auth-type-2xs); letter-spacing: .07em; text-transform: uppercase; }
.auth-badge--ok { color: var(--auth-lime); border-color: rgba(198, 251, 47, .28); background: rgba(198, 251, 47, .08); }
.auth-badge--warn { color: #ffd479; border-color: rgba(255, 212, 121, .28); background: rgba(255, 212, 121, .08); }
.auth-badge--pending { color: var(--auth-purple-soft); border-color: rgba(181, 122, 255, .28); background: rgba(181, 122, 255, .08); }
.auth-badge--ghost { color: var(--auth-muted); background: rgba(255, 255, 255, .04); }
.auth-page .button--danger { color: #fff; background: linear-gradient(135deg, #d94b5c, #9f2435); box-shadow: 0 14px 34px rgba(159, 36, 53, .22); }

@media (max-width: 900px) {
    .sec-grid { grid-template-columns: 1fr; }
    .qr-grid { grid-template-columns: 1fr; }
    .qr-box { width: min(100%, 240px); }
}

@media (max-width: 640px) {
    body.auth-page { padding: 18px 14px; }
    .login-box,
    .shell,
    .panel,
    body.auth-page > .card { padding: 26px 20px; }
    .sec-shell { padding-top: 18px; }
    .sec-hero,
    .sec-card { padding: 20px; }
    .row,
    .sec-row { display: grid; gap: 5px; }
    .value,
    .sec-value { text-align: left; }
    .mono { max-width: 100%; }
    .actions { flex-direction: column-reverse; }
    .codes { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Auth, account, and recovery views share the portal's no-overflow contract. */
html, body { min-width: 0; overflow-x: hidden; }
*, *::before, *::after { box-sizing: border-box; }
img, svg, input, select, textarea, button { max-width: 100%; }
@media (max-width: 640px) {
    .auth-page { min-width: 0; }
    .login-box, .shell, .panel, .sec-shell, body.auth-page > .card { width: 100%; max-width: 100%; }
    .sec-grid, .qr-grid { grid-template-columns: 1fr; }
    .qr-box { width: min(240px, 100%); height: auto; aspect-ratio: 1; margin-inline: auto; }
    .actions { width: 100%; }
    .actions > * { width: 100%; max-width: 100%; }
}
