:root {
    color-scheme: dark;
    --background: #090b11;
    --surface: #11151e;
    --surface-raised: #171c27;
    --surface-soft: #1d2330;
    --border: #2a3140;
    --border-strong: #3d4659;
    --text: #f7f8fb;
    --muted: #9ca8ba;
    --muted-bright: #bdc6d4;
    --purple: #8d5cf6;
    --purple-bright: #a77cff;
    --pink: #ec4899;
    --orange: #ff8a3d;
    --green: #58d68d;
    --red: #ff6b7a;
    --shadow: 0 28px 80px rgba(0, 0, 0, .35);
    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
    margin: 0;
}

body {
    background:
        radial-gradient(
            circle at 80% 15%,
            rgba(141, 92, 246, .12),
            transparent 30rem
        ),
        var(--background);
    color: var(--text);
}

a {
    color: var(--purple-bright);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

button,
input {
    font: inherit;
}

.auth-shell {
    display: grid;
    grid-template-columns: minmax(420px, 1fr) minmax(480px, 1fr);
    min-height: 100vh;
}

.brand-panel {
    align-items: flex-start;
    background:
        radial-gradient(
            circle at 30% 25%,
            rgba(236, 72, 153, .19),
            transparent 24rem
        ),
        radial-gradient(
            circle at 80% 70%,
            rgba(255, 138, 61, .12),
            transparent 24rem
        ),
        linear-gradient(
            145deg,
            #121727,
            #0b0e16 65%
        );
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(3rem, 7vw, 8rem);
    position: relative;
    overflow: hidden;
}

.brand-panel::after {
    background-image:
        linear-gradient(
            rgba(255, 255, 255, .025) 1px,
            transparent 1px
        ),
        linear-gradient(
            90deg,
            rgba(255, 255, 255, .025) 1px,
            transparent 1px
        );
    background-size: 42px 42px;
    content: "";
    inset: 0;
    mask-image:
        linear-gradient(
            to bottom right,
            black,
            transparent 70%
        );
    pointer-events: none;
    position: absolute;
}

.brand-mark {
    align-items: center;
    background:
        conic-gradient(
            from 30deg,
            var(--orange),
            var(--pink),
            var(--purple),
            var(--orange)
        );
    clip-path:
        polygon(
            25% 7%,
            75% 7%,
            100% 50%,
            75% 93%,
            25% 93%,
            0 50%
        );
    display: flex;
    height: 76px;
    justify-content: center;
    margin-bottom: 2rem;
    position: relative;
    width: 76px;
}

.brand-mark::before {
    background: #111522;
    clip-path: inherit;
    content: "";
    inset: 7px;
    position: absolute;
}

.brand-mark-core {
    background:
        linear-gradient(
            135deg,
            var(--pink),
            var(--purple)
        );
    clip-path: inherit;
    height: 30px;
    position: relative;
    width: 30px;
    z-index: 1;
}

.brand-mark.small {
    height: 38px;
    margin: 0;
    width: 38px;
}

.brand-mark.small::before {
    inset: 4px;
}

.brand-mark.small .brand-mark-core {
    height: 15px;
    width: 15px;
}

.brand-mark.tiny {
    height: 36px;
    margin: 0;
    width: 36px;
}

.brand-mark.tiny::before {
    inset: 4px;
}

.brand-mark.tiny .brand-mark-core {
    height: 14px;
    width: 14px;
}

.eyebrow {
    color: var(--purple-bright);
    font-size: .76rem;
    font-weight: 750;
    letter-spacing: .13em;
    margin: 0 0 .8rem;
    text-transform: uppercase;
}

.brand-panel h1 {
    font-size: clamp(2.5rem, 4.2vw, 5rem);
    letter-spacing: -.055em;
    line-height: 1.02;
    margin: 0;
    max-width: 850px;
}

.brand-copy {
    color: var(--muted-bright);
    font-size: 1.1rem;
    line-height: 1.75;
    margin: 2rem 0;
    max-width: 610px;
}

.trust-row {
    color: var(--muted);
    display: flex;
    flex-wrap: wrap;
    font-size: .86rem;
    gap: 1.4rem;
}

.trust-row span::before {
    color: var(--green);
    content: "●";
    margin-right: .55rem;
}

.login-panel {
    align-items: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2rem;
}

.login-card {
    max-width: 440px;
    width: 100%;
}

.login-card h2 {
    font-size: 2rem;
    letter-spacing: -.035em;
    margin: 0 0 .6rem;
}

.muted {
    color: var(--muted);
    line-height: 1.6;
}

.mobile-brand {
    align-items: center;
    display: none;
    font-weight: 700;
    gap: .85rem;
    margin-bottom: 3rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    margin-top: 2rem;
}

.login-form label {
    color: var(--muted-bright);
    font-size: .9rem;
    font-weight: 650;
    margin-bottom: .55rem;
}

.login-form input[type="email"],
.login-form input[type="password"] {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    height: 50px;
    margin-bottom: 1.35rem;
    outline: none;
    padding: 0 1rem;
    transition:
        border-color .18s ease,
        box-shadow .18s ease;
}

.login-form input:focus {
    border-color: var(--purple);
    box-shadow:
        0 0 0 4px rgba(141, 92, 246, .13);
}

.field-heading {
    align-items: center;
    display: flex;
    justify-content: space-between;
}

.field-heading a {
    font-size: .83rem;
    margin-bottom: .55rem;
}

.checkbox-row {
    align-items: center;
    cursor: pointer;
    display: flex;
    gap: .65rem;
    margin-bottom: 1.5rem !important;
}

.checkbox-row input {
    accent-color: var(--purple);
    height: 17px;
    width: 17px;
}

.login-form button {
    background:
        linear-gradient(
            135deg,
            var(--purple),
            var(--pink)
        );
    border: 0;
    border-radius: 10px;
    color: white;
    cursor: pointer;
    font-weight: 750;
    height: 50px;
    transition:
        filter .18s ease,
        transform .18s ease;
}

.login-form button:hover {
    filter: brightness(1.09);
    transform: translateY(-1px);
}

.register-copy {
    color: var(--muted);
    margin-top: 1.8rem;
    text-align: center;
}

.alert {
    border-radius: 9px;
    font-size: .9rem;
    margin-top: 1.4rem;
    padding: .85rem 1rem;
}

.alert-error {
    background: rgba(255, 107, 122, .1);
    border: 1px solid rgba(255, 107, 122, .28);
    color: #ffabb4;
}

.login-panel footer {
    bottom: 2rem;
    color: #707b8d;
    display: flex;
    font-size: .78rem;
    gap: 1.25rem;
    position: absolute;
}

.login-panel footer a {
    color: #8c97a9;
}

.topbar {
    align-items: center;
    backdrop-filter: blur(15px);
    background: rgba(9, 11, 17, .84);
    border-bottom: 1px solid var(--border);
    display: flex;
    height: 68px;
    justify-content: space-between;
    padding: 0 clamp(1.25rem, 4vw, 4rem);
    position: sticky;
    top: 0;
    z-index: 10;
}

.topbar-brand {
    align-items: center;
    color: var(--text);
    display: flex;
    gap: .85rem;
}

.topbar-brand:hover {
    text-decoration: none;
}

.topbar-brand span {
    display: flex;
    flex-direction: column;
}

.topbar-brand small {
    color: var(--muted);
}

.account-menu {
    align-items: center;
    color: var(--muted-bright);
    display: flex;
    gap: 1rem;
}

.account-menu form {
    margin: 0;
}

.button-secondary,
.button-danger-subtle {
    background: transparent;
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    color: var(--text);
    cursor: pointer;
    padding: .62rem .9rem;
}

.button-secondary:hover {
    background: var(--surface-raised);
}

.button-danger-subtle {
    border-color: rgba(255, 107, 122, .3);
    color: #ff9aa5;
}

.dashboard-shell {
    margin: 0 auto;
    max-width: 1380px;
    padding: clamp(2rem, 5vw, 5rem);
}

.dashboard-heading {
    align-items: flex-start;
    display: flex;
    justify-content: space-between;
    margin-bottom: 2.25rem;
}

.dashboard-heading h1 {
    font-size: clamp(2rem, 4vw, 3.4rem);
    letter-spacing: -.045em;
    margin: 0 0 .45rem;
}

.status-badge,
.current-session {
    background: rgba(88, 214, 141, .1);
    border: 1px solid rgba(88, 214, 141, .24);
    border-radius: 999px;
    color: var(--green);
    font-size: .8rem;
    font-weight: 700;
    padding: .5rem .8rem;
}

.summary-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(3, 1fr);
    margin-bottom: 1rem;
}

.summary-card,
.panel {
    background:
        linear-gradient(
            145deg,
            rgba(255, 255, 255, .018),
            transparent
        ),
        var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
}

.summary-card {
    display: flex;
    flex-direction: column;
    min-height: 150px;
    padding: 1.4rem;
}

.summary-label {
    color: var(--muted);
    font-size: .75rem;
    letter-spacing: .08em;
    margin-bottom: 1.3rem;
    text-transform: uppercase;
}

.summary-card strong {
    font-size: 1.05rem;
    overflow-wrap: anywhere;
}

.summary-note {
    color: var(--muted);
    font-size: .82rem;
    margin-top: .45rem;
}

.dashboard-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: 1fr 1fr;
}

.panel-heading {
    border-bottom: 1px solid var(--border);
    padding: 1.35rem 1.45rem;
}

.panel-heading h2 {
    font-size: 1.1rem;
    margin: 0 0 .3rem;
}

.panel-heading p {
    color: var(--muted);
    font-size: .85rem;
    margin: 0;
}

.settings-row,
.service-row,
.session-row {
    align-items: center;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    display: flex;
    justify-content: space-between;
    min-height: 78px;
    padding: 1rem 1.45rem;
}

.settings-row:last-child,
.service-row:last-child,
.session-row:last-child {
    border-bottom: 0;
}

.settings-row:hover {
    background: rgba(255, 255, 255, .015);
    text-decoration: none;
}

.settings-row span:first-child,
.service-row span:nth-child(2),
.session-device {
    display: flex;
    flex-direction: column;
    gap: .3rem;
}

.settings-row small,
.service-row small,
.session-device small {
    color: var(--muted);
}

.settings-row > span:last-child {
    color: var(--muted);
    font-size: .78rem;
}

.settings-row.disabled {
    cursor: default;
}

.service-row {
    justify-content: flex-start;
    gap: 1rem;
}

.service-icon {
    align-items: center;
    background:
        linear-gradient(
            135deg,
            rgba(141, 92, 246, .3),
            rgba(236, 72, 153, .2)
        );
    border: 1px solid rgba(167, 124, 255, .28);
    border-radius: 9px;
    display: flex;
    font-weight: 750;
    height: 42px;
    justify-content: center;
    width: 42px;
}

.status-dot {
    color: var(--green);
    font-size: .8rem;
    margin-left: auto;
}

.empty-state {
    color: var(--muted);
    padding: 2rem 1.45rem;
}

.sessions-panel {
    margin-top: 1rem;
}

.session-row {
    gap: 1rem;
}

@media (max-width: 900px) {
    .auth-shell {
        display: block;
    }

    .brand-panel {
        display: none;
    }

    .login-panel {
        min-height: 100vh;
        padding: 2rem 1.4rem 6rem;
    }

    .mobile-brand {
        display: flex;
    }

    .summary-grid,
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-heading {
        gap: 1rem;
    }
}

@media (max-width: 620px) {
    .topbar {
        padding: 0 1rem;
    }

    .account-menu > span {
        display: none;
    }

    .dashboard-shell {
        padding: 2rem 1rem;
    }

    .dashboard-heading {
        display: block;
    }

    .status-badge {
        display: inline-block;
        margin-top: 1rem;
    }

    .session-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .login-panel footer {
        flex-wrap: wrap;
        justify-content: center;
        padding: 0 1rem;
    }
}

.security-shell {
    margin: 0 auto;
    max-width: 1120px;
    padding: clamp(2rem, 5vw, 5rem);
}

.security-heading {
    margin-bottom: 2rem;
    max-width: 720px;
}

.security-heading h1 {
    font-size: clamp(2rem, 4vw, 3.35rem);
    letter-spacing: -.045em;
    margin: 0 0 .6rem;
}

.security-layout {
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(0, 1.3fr) minmax(300px, .7fr);
}

.security-form-body {
    padding: 1.45rem;
}

.security-form {
    display: flex;
    flex-direction: column;
}

.security-form label {
    color: var(--muted-bright);
    font-size: .9rem;
    font-weight: 650;
    margin-bottom: .55rem;
}

.security-form input {
    background: var(--surface-raised);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    height: 50px;
    margin-bottom: 1.35rem;
    outline: none;
    padding: 0 1rem;
}

.security-form input:focus {
    border-color: var(--purple);
    box-shadow:
        0 0 0 4px rgba(141, 92, 246, .13);
}

.security-form button {
    background:
        linear-gradient(
            135deg,
            var(--purple),
            var(--pink)
        );
    border: 0;
    border-radius: 10px;
    color: white;
    cursor: pointer;
    font-weight: 750;
    height: 50px;
    margin-top: .25rem;
}

.alert-success {
    background: rgba(88, 214, 141, .1);
    border: 1px solid rgba(88, 214, 141, .26);
    color: #8ce8b2;
    margin: 0 0 1.4rem;
}

.password-guidance {
    align-self: start;
}

.guidance-list {
    display: flex;
    flex-direction: column;
}

.guidance-list div {
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: .45rem;
    padding: 1.25rem 1.45rem;
}

.guidance-list div:last-child {
    border-bottom: 0;
}

.guidance-list span {
    color: var(--muted);
    font-size: .85rem;
    line-height: 1.55;
}

.back-link {
    display: inline-flex;
    text-decoration: none;
}

.back-link:hover {
    text-decoration: none;
}

@media (max-width: 820px) {
    .security-layout {
        grid-template-columns: 1fr;
    }
}

.mfa-qr-wrap {
    background: white;
    border-radius: 14px;
    display: inline-flex;
    padding: 1rem;
}

.mfa-qr {
    display: block;
    height: 220px;
    width: 220px;
}

.manual-key-label {
    color: var(--muted);
    font-size: .8rem;
    margin: 1.4rem 0 .5rem;
    text-transform: uppercase;
}

.manual-key {
    background: var(--surface-raised);
    border: 1px solid var(--border);
    border-radius: 8px;
    display: block;
    letter-spacing: .12em;
    overflow-wrap: anywhere;
    padding: 1rem;
}

.challenge-shell {
    align-items: center;
    display: flex;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
}

.challenge-card {
    width: min(440px, 100%);
}

.challenge-brand {
    display: flex;
}

.recovery-shell {
    max-width: 760px;
}

.recovery-panel {
    padding: 1.5rem;
}

.recovery-grid {
    display: grid;
    gap: .8rem;
    grid-template-columns: repeat(2, 1fr);
}

.recovery-grid code {
    background: var(--surface-raised);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    letter-spacing: .08em;
    padding: 1rem;
    text-align: center;
}

.recovery-actions {
    border-top: 1px solid var(--border);
    margin-top: 1.5rem;
    padding-top: 1.5rem;
}

.button-primary-link {
    background:
        linear-gradient(
            135deg,
            var(--purple),
            var(--pink)
        );
    border-radius: 9px;
    color: white;
    display: inline-flex;
    font-weight: 750;
    padding: .85rem 1.1rem;
}

.button-primary-link:hover {
    text-decoration: none;
}

.mfa-enabled-state {
    color: var(--muted);
}

@media (max-width: 620px) {
    .mfa-qr {
        height: 190px;
        width: 190px;
    }

    .recovery-grid {
        grid-template-columns: 1fr;
    }
}
