body.app-shell {
    --app-primary: var(--primary-color);
    --app-secondary: var(--secondary-color);
    --app-bg: #f8fafc;
    --app-surface: #ffffff;
    --app-surface-muted: #f8fafc;
    --app-surface-strong: #f1f5f9;
    --app-text: #1d3557;
    --app-text-soft: #64748b;
    --app-text-muted: #94a3b8;
    --app-border: #e2e8f0;
    --app-shadow: 0 14px 38px rgba(15, 23, 42, .08);
    --app-primary-faint: #fff7f7;
    --app-primary-strong: var(--app-primary);
    margin: 0;
    background: var(--app-bg);
    color: var(--app-text);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
}

@supports (color: color-mix(in srgb, white 50%, black)) {
    body.app-shell {
        --app-primary-faint: color-mix(in srgb, var(--app-primary) 7%, #fff);
        --app-primary-strong: color-mix(in srgb, var(--app-primary) 78%, #111827);
    }
}

html[data-app-theme="dark"] body.app-shell {
    --app-bg: #0b1120;
    --app-surface: #111827;
    --app-surface-muted: #172033;
    --app-surface-strong: #1f2937;
    --app-text: #e5eefb;
    --app-text-soft: #a7b4c8;
    --app-text-muted: #7f8da3;
    --app-border: #273548;
    --app-shadow: 0 18px 44px rgba(0, 0, 0, .28);
    --app-primary-faint: rgba(230, 57, 70, .12);
    --app-primary-strong: #ff7a87;
}

@supports (color: color-mix(in srgb, white 50%, black)) {
    html[data-app-theme="dark"] body.app-shell {
        --app-primary-faint: color-mix(in srgb, var(--app-primary) 16%, #111827);
        --app-primary-strong: color-mix(in srgb, var(--app-primary) 62%, #fff);
    }
}

.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 2rem;
}

.auth-shell {
    width: min(100%, 820px);
    display: grid;
    grid-template-columns: minmax(260px, .78fr) minmax(0, 1.22fr);
    overflow: hidden;
}

.auth-brand {
    position: relative;
    display: flex;
    align-items: flex-start;
    flex-direction: column;
    gap: 1rem;
    min-height: 470px;
    margin: 0;
    padding: 1.65rem;
    overflow: hidden;
}

.auth-logo {
    width: 68px;
    height: 68px;
    flex: 0 0 68px;
    border: 1px solid var(--app-border);
    border-radius: .4rem;
    object-fit: contain;
}

.auth-logo-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: var(--app-primary);
    font-size: 1.5rem;
    font-weight: 850;
}

.auth-brand-mark {
    position: relative;
    z-index: 1;
}

.auth-brand-copy {
    position: relative;
    z-index: 1;
    margin-top: auto;
}

.auth-brand-kicker,
.auth-kicker {
    font-size: .68rem;
    font-weight: 850;
    letter-spacing: 0;
}

.auth-brand-kicker {
    margin-bottom: .45rem;
    color: #26d7cf;
}

.auth-brand-track {
    position: absolute;
    inset: auto -20px 24px auto;
    display: grid;
    gap: .48rem;
    width: 170px;
    transform: rotate(-8deg);
    opacity: .36;
}

.auth-brand-track span {
    display: block;
    height: 3px;
    background: #26d7cf;
}

.auth-brand-track span:nth-child(2) {
    width: 72%;
    margin-left: auto;
    background: #9ada3a;
}

.auth-brand-track span:nth-child(3) {
    width: 48%;
    margin-left: auto;
    background: #f6b73c;
}

.auth-theme-toggle {
    width: 38px;
    height: 38px;
    position: absolute;
    z-index: 2;
    top: 1.35rem;
    right: 1.35rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    border: 1px solid var(--app-border);
    border-radius: .7rem;
    background: var(--app-surface);
    color: var(--app-text-soft);
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.auth-theme-toggle:hover,
.auth-theme-toggle:focus {
    border-color: var(--app-primary);
    background: var(--app-primary-faint);
    color: var(--app-primary-strong);
}

.auth-theme-icon {
    display: inline-flex;
}

.auth-theme-icon svg {
    width: 1.05rem;
    height: 1.05rem;
}

.auth-theme-icon-sun {
    display: none;
}

html[data-app-theme="dark"] .auth-theme-icon-moon {
    display: none;
}

html[data-app-theme="dark"] .auth-theme-icon-sun {
    display: inline-flex;
}

.auth-brand-name {
    color: var(--app-text);
    max-width: 220px;
    font-size: 1.45rem;
    line-height: 1.08;
    font-weight: 850;
}

.auth-brand-subtitle,
.auth-muted {
    color: var(--app-text-soft);
    font-size: .84rem;
}

.auth-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    border: 0;
    border-radius: 0;
    background: var(--app-surface);
    box-shadow: none;
    padding: 2.15rem;
}

html[data-app-theme="dark"] body.app-shell :is(
    .form-control,
    .form-select,
    .form-check-input,
    .input-group-text,
    textarea
) {
    background-color: var(--app-surface-strong) !important;
    border-color: var(--app-border) !important;
    color: var(--app-text) !important;
}

html[data-app-theme="dark"] body.app-shell :is(
    .form-control,
    .form-select,
    textarea
)::placeholder {
    color: var(--app-text-muted) !important;
}

html[data-app-theme="dark"] body.app-shell :is(
    .form-control,
    .form-select,
    textarea
):focus {
    border-color: var(--app-primary-strong) !important;
    box-shadow: 0 0 0 .16rem rgba(255, 122, 135, .18) !important;
}

.auth-title {
    color: var(--app-text);
    font-size: 1.25rem;
    font-weight: 850;
    margin-bottom: .3rem;
}

.auth-card-head {
    position: relative;
    margin-bottom: 1rem;
    padding-bottom: .9rem;
    border-bottom: 1px solid var(--app-border);
}

.auth-card-head::after {
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 58px;
    height: 3px;
    background: var(--app-primary);
    content: "";
}

.auth-kicker {
    margin-bottom: .35rem;
    color: var(--app-primary-strong);
}

.auth-state-head {
    text-align: left;
}

.auth-state-code {
    color: var(--app-primary-strong);
    font-size: 2rem;
    font-weight: 900;
    line-height: 1;
}

.auth-description {
    color: var(--app-text-soft);
    font-size: .88rem;
    margin-bottom: 1rem;
}

.auth-actions {
    display: grid;
    gap: .75rem;
}

.auth-field {
    padding-left: .7rem;
    border-left: 2px solid var(--app-border);
}

.auth-field:focus-within {
    border-left-color: var(--app-primary);
}

.auth-link-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin-top: .85rem;
}

.auth-legal-links {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: .35rem .65rem;
    margin-top: .85rem;
    padding-top: .75rem;
    border-top: 1px solid var(--app-border);
    color: var(--app-text-muted);
    font-size: .72rem;
}

.auth-legal-links a {
    color: inherit;
    text-decoration: none;
}

.auth-legal-links a:hover,
.auth-legal-links a:focus {
    color: var(--app-primary-strong);
}

.auth-access-actions {
    display: grid;
    gap: .55rem;
}

@media (max-width: 767.98px) {
    .auth-page {
        align-items: start;
        padding: 1rem;
    }

    .auth-shell {
        grid-template-columns: minmax(0, 1fr);
    }

    .auth-brand {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) auto;
        align-items: center;
        min-height: 0;
        padding: 1rem;
    }

    .auth-brand-copy {
        margin-top: 0;
    }

    .auth-brand-name {
        max-width: none;
        font-size: 1rem;
    }

    .auth-brand-kicker,
    .auth-brand-track {
        display: none;
    }

    .auth-logo {
        width: 48px;
        height: 48px;
        flex-basis: 48px;
    }

    .auth-theme-toggle {
        position: static;
    }

    .auth-card {
        padding: 1.25rem;
    }
}

@media (max-width: 575.98px) {
    .auth-page {
        padding: 0;
    }

    .auth-shell {
        display: grid;
        align-content: start;
        min-height: 100vh;
        min-height: 100svh;
        border: 0 !important;
        border-radius: 0 !important;
    }

    .auth-link-row {
        align-items: stretch;
        flex-direction: column;
    }
}
