:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --sidebar: #041428;
    --sidebar-mid: #0b2f66;
    --background: #e8eef6;
    --surface: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --text-body: #1e293b;
    --border: #e2e8f0;
    --card-border: #e5e7eb;
    --danger: #ef4444;
    --success: #16a34a;
    --shadow: 0 24px 60px rgba(15, 23, 42, 0.12);
    --radius-card: 24px;
    --radius-control: 10px;
    --font: "Inter", "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

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

body {
    font-family: var(--font);
    font-size: 14px;
    font-weight: 400;
    color: var(--text-body);
    background: var(--background);
}

button,
input,
select {
    font: inherit;
}

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

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.auth-shell {
    width: min(1120px, 100%);
    min-height: 680px;
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    background: var(--surface);
    border-radius: var(--radius-card);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.auth-brand {
    position: relative;
    overflow: hidden;
    color: #fff;
    padding: 36px 40px 28px;
    background:
        radial-gradient(circle at 80% 120%, rgba(37, 99, 235, 0.45), transparent 42%),
        linear-gradient(165deg, #041428 0%, #07244d 48%, #0b3a7a 100%);
}

.auth-brand::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 800 600' preserveAspectRatio='none'%3E%3Cpath fill='none' stroke='rgba(125,211,252,0.18)' stroke-width='2' d='M-40 420C80 360 180 500 320 430c140-70 180-20 280 10 120 36 220-40 280-80'/%3E%3Cpath fill='none' stroke='rgba(96,165,250,0.14)' stroke-width='2' d='M-40 480C90 410 210 560 360 470c130-78 210 10 300 40 110 36 200-30 260-70'/%3E%3C/svg%3E");
    background-size: cover;
    pointer-events: none;
}

.auth-promo {
    position: relative;
    z-index: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.auth-lockup {
    display: flex;
    align-items: center;
    gap: 10px;
}

.auth-lockup-mark {
    width: 40px;
    height: 40px;
    object-fit: contain;
    flex-shrink: 0;
}

.auth-lockup-name,
.auth-lockup-tag {
    margin: 0;
}

.auth-lockup-name {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.1;
}

.auth-lockup-tag {
    margin-top: 2px;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.01em;
}

.auth-lockup-light .auth-lockup-name {
    color: #fff;
}

.auth-lockup-light .auth-lockup-tag {
    color: #93c5fd;
}

.auth-lockup-dark {
    justify-content: center;
    margin-bottom: 28px;
}

.auth-lockup-dark .auth-lockup-name {
    color: var(--text-primary);
}

.auth-lockup-dark .auth-lockup-tag {
    color: var(--text-muted);
}

.auth-promo-title {
    margin: 36px 0 12px;
    max-width: 18ch;
    font-size: 34px;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.03em;
}

.auth-promo-copy {
    margin: 0 0 28px;
    max-width: 42ch;
    color: #cbd5e1;
    line-height: 1.55;
}

.auth-features {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 16px;
}

.auth-features li {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.auth-feature-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(15, 35, 80, 0.55);
    color: #fff;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.auth-features strong {
    display: block;
    font-size: 14px;
    font-weight: 600;
}

.auth-features li span span {
    display: block;
    margin-top: 2px;
    font-size: 12px;
    color: #94a3b8;
}

.auth-preview {
    position: absolute;
    right: -48px;
    bottom: -70px;
    width: 360px;
    margin: 0;
    transform: rotate(-8deg);
    pointer-events: none;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
    background: #041428;
}

.auth-preview img {
    display: block;
    width: 100%;
    height: auto;
}

.auth-promo-footer {
    position: relative;
    z-index: 2;
    margin-top: auto;
    max-width: 55%;
    padding-top: 28px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    color: #93c5fd;
    font-size: 12px;
}

.auth-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 48px;
    background: var(--surface);
}

.auth-form {
    width: 100%;
    max-width: 360px;
}

.auth-form h1 {
    margin: 0 0 6px;
    text-align: center;
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.03em;
}

.lede {
    margin: 0 0 24px;
    text-align: center;
    color: var(--text-muted);
}

form label {
    display: block;
    margin: 14px 0 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.auth-input {
    position: relative;
}

.auth-input-icon,
.auth-password-toggle {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
}

.auth-input-icon {
    left: 12px;
    pointer-events: none;
}

.auth-password-toggle {
    right: 8px;
    width: 32px;
    height: 32px;
    border: 0;
    background: transparent;
    display: grid;
    place-items: center;
    cursor: pointer;
}

.auth-password-toggle .icon-hide,
.auth-password-toggle[aria-pressed="true"] .icon-show {
    display: none;
}

.auth-password-toggle[aria-pressed="true"] .icon-hide {
    display: block;
}

.form-control {
    width: 100%;
    height: 44px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-control);
    background: var(--surface);
    color: var(--text-primary);
}

.auth-input .form-control {
    padding-left: 40px;
}

.auth-input .form-control[type="password"],
.auth-input .form-control[name="password"] {
    padding-right: 40px;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.form-control::placeholder {
    color: #94a3b8;
}

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.workspace-choice {
    margin: 28px 0 0;
    padding: 0;
    border: 0;
}

.workspace-choice legend {
    margin: 0 0 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.workspace-choice .req {
    color: var(--danger);
    text-decoration: none;
}

.workspace-options {
    display: grid;
    gap: 10px;
}

.workspace-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-control);
    cursor: pointer;
    background: var(--surface);
}

.workspace-option:hover {
    border-color: #cbd5e1;
}

.workspace-option:has(input:checked) {
    border-color: var(--primary);
    background: #eff6ff;
}

.workspace-option input {
    margin-top: 3px;
    accent-color: var(--primary);
}

.workspace-option-body {
    display: grid;
    gap: 2px;
}

.workspace-option-body strong {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.workspace-option-body span {
    font-size: 13px;
    line-height: 1.4;
    color: var(--text-muted);
}

.auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 14px 0 6px;
}

.auth-remember {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
}

.auth-remember input {
    width: 15px;
    height: 15px;
    accent-color: var(--primary);
}

.auth-forgot {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
}

.auth-forgot:hover {
    color: var(--primary-hover);
}

.auth-consent {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 18px 0 0;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-control);
    font-size: 13px;
    font-weight: 400;
    line-height: 1.45;
    color: var(--text-secondary);
    cursor: pointer;
}

.auth-consent input {
    width: 15px;
    height: 15px;
    margin-top: 3px;
    flex-shrink: 0;
    accent-color: var(--primary);
}

.auth-consent a {
    font-weight: 600;
}

.btn-primary {
    width: 100%;
    margin-top: 18px;
    height: 44px;
    padding: 0 14px;
    border: 0;
    border-radius: var(--radius-control);
    background: var(--primary);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

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

.otp-input .otp-control {
    height: 52px;
    padding: 0 12px;
    text-align: center;
    font-size: 22px;
    font-weight: 600;
    letter-spacing: 0.4em;
}

.auth-verify-email {
    color: var(--text-primary);
    font-weight: 600;
}

.auth-resend {
    margin-top: 14px;
    text-align: center;
}

.auth-text-button {
    border: 0;
    background: transparent;
    padding: 0;
    color: var(--primary);
    font-weight: 600;
    cursor: pointer;
}

.auth-text-button:hover {
    color: var(--primary-hover);
}

.auth-switch {
    margin: 22px 0 0;
    text-align: center;
    color: var(--text-muted);
}

.auth-switch a {
    font-weight: 600;
}

.field-error,
.form-errors {
    color: var(--danger);
    font-size: 12px;
    margin: 6px 0 0;
}

.form-errors ul {
    margin: 0;
    padding-left: 18px;
}

.flash-stack {
    display: grid;
    gap: 8px;
    margin: 0 0 16px;
}

.flash-stack.is-leaving {
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.flash {
    background: var(--surface);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 10px 14px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.flash-success {
    border-color: #bbf7d0;
    color: var(--success);
}

.flash-error {
    border-color: #fecaca;
    color: var(--danger);
}

.flash-info,
.flash-warning {
    border-color: #fed7aa;
    color: #9a3412;
}

@media (max-width: 920px) {
    .auth-shell {
        grid-template-columns: 1fr;
        min-height: 0;
    }

    .auth-brand {
        padding: 28px 24px 120px;
        min-height: 420px;
    }

    .auth-promo-title {
        font-size: 28px;
    }

    .auth-panel {
        padding: 32px 24px;
    }
}

@media (max-width: 600px) {
    .auth-page {
        padding: 0;
    }

    .auth-shell {
        border-radius: 0;
        min-height: 100vh;
    }

    .field-row {
        grid-template-columns: 1fr;
    }

    .auth-preview {
        width: 280px;
        right: -64px;
        bottom: -90px;
    }
}
