:root {
    --aubergine-950: #2c1027;
    --aubergine-800: #4a193f;
    --aubergine-700: #5b214e;
    --aubergine-600: #73305f;
    --coral-500: #e66a59;
    --coral-100: #fbe5df;
    --ivory-50: #fbf8f3;
    --ivory-100: #f4eee6;
    --ink-900: #2b252a;
    --ink-700: #554c52;
    --ink-500: #7b7077;
    --line: #e6ddd8;
    --white: #ffffff;
    --success-bg: #edf7f1;
    --success-text: #226142;
    --danger-bg: #fff0ed;
    --danger-text: #a23930;
    --shadow: 0 18px 48px rgba(57, 29, 49, 0.1);
    --radius-lg: 18px;
    --radius-md: 10px;
    color-scheme: light;
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    background: var(--ivory-50);
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--ink-900);
    background: var(--ivory-50);
    font-size: 14px;
    line-height: 1.55;
}

button,
input {
    font: inherit;
}

a {
    color: inherit;
}

.auth-shell {
    display: grid;
    min-height: 100vh;
    grid-template-columns: minmax(360px, 0.92fr) minmax(520px, 1.08fr);
}

.auth-context {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 36px clamp(34px, 5vw, 76px) 28px;
    overflow: hidden;
    color: var(--white);
    background: var(--aubergine-950);
}

.auth-context::before,
.auth-context::after {
    position: absolute;
    content: "";
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 50%;
    pointer-events: none;
}

.auth-context::before {
    width: 340px;
    height: 340px;
    top: 42%;
    right: -235px;
}

.auth-context::after {
    width: 170px;
    height: 170px;
    right: -94px;
    bottom: 46px;
    border-color: rgba(230, 106, 89, 0.42);
}

.brand,
.mobile-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.brand {
    width: fit-content;
    color: var(--white);
    text-decoration: none;
}

.brand-mark {
    display: inline-grid;
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 11px;
    color: var(--white);
    background: var(--coral-500);
    font-size: 20px;
    font-weight: 750;
    letter-spacing: -0.06em;
}

.brand strong,
.brand small {
    display: block;
}

.brand strong {
    font-size: 14px;
    letter-spacing: 0.01em;
}

.brand small {
    margin-top: 1px;
    color: rgba(255, 255, 255, 0.62);
    font-size: 11px;
}

.context-copy {
    position: relative;
    z-index: 1;
    max-width: 560px;
    margin: auto 0 42px;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--coral-500);
    font-size: 11px;
    font-weight: 750;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.context-copy h1 {
    max-width: 520px;
    margin: 0;
    font-size: clamp(32px, 4vw, 50px);
    font-weight: 680;
    letter-spacing: -0.04em;
    line-height: 1.08;
}

.context-copy > p:last-child {
    max-width: 530px;
    margin: 22px 0 0;
    color: rgba(255, 255, 255, 0.67);
    font-size: 14px;
}

.benefit-list {
    display: grid;
    position: relative;
    z-index: 1;
    gap: 0;
    max-width: 540px;
    margin: 0 0 36px;
    padding: 0;
    list-style: none;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.benefit-list li {
    display: flex;
    align-items: center;
    min-height: 46px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.81);
    font-size: 12px;
}

.benefit-list span {
    width: 38px;
    color: var(--coral-500);
    font-size: 10px;
    font-weight: 700;
}

.context-footer {
    margin: 0;
    color: rgba(255, 255, 255, 0.42);
    font-size: 11px;
}

.auth-panel {
    display: grid;
    min-height: 100vh;
    padding: 32px clamp(28px, 6vw, 88px);
    place-items: center;
}

.auth-card {
    width: min(100%, 520px);
}

.mobile-brand {
    display: none;
    margin-bottom: 28px;
}

.auth-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin-bottom: 30px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--ivory-100);
}

.auth-tab {
    min-height: 38px;
    padding: 8px 12px;
    border-radius: 8px;
    color: var(--ink-500);
    font-size: 12px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.auth-tab.is-active {
    color: var(--aubergine-700);
    background: var(--white);
    box-shadow: 0 2px 8px rgba(58, 33, 51, 0.08);
}

.form-header {
    margin-bottom: 24px;
}

.form-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.25;
}

.form-header > p:last-child {
    margin: 7px 0 0;
    color: var(--ink-500);
    font-size: 13px;
}

.auth-form {
    display: grid;
    gap: 16px;
}

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

.field-group {
    display: grid;
    gap: 6px;
}

.field-group label,
.label-row label {
    color: var(--ink-700);
    font-size: 12px;
    font-weight: 700;
}

.field-group input {
    width: 100%;
    height: 42px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    outline: 0;
    color: var(--ink-900);
    background: var(--white);
    font-size: 13px;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.field-group input::placeholder {
    color: #aaa0a6;
}

.field-group input:focus {
    border-color: var(--aubergine-600);
    box-shadow: 0 0 0 3px rgba(115, 48, 95, 0.1);
}

.password-wrap {
    position: relative;
}

.password-wrap input {
    padding-right: 62px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 9px;
    padding: 4px 5px;
    border: 0;
    color: var(--aubergine-600);
    background: transparent;
    font-size: 11px;
    font-weight: 750;
    cursor: pointer;
    transform: translateY(-50%);
}

.field-error {
    color: var(--danger-text);
    font-size: 11px;
}

.check-field {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    color: var(--ink-500);
    font-size: 11px;
    cursor: pointer;
}

.check-field input {
    width: 15px;
    height: 15px;
    margin: 1px 0 0;
    accent-color: var(--aubergine-700);
}

.button {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    padding: 9px 16px;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    font-size: 12px;
    font-weight: 750;
    text-decoration: none;
    cursor: pointer;
    transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.button-primary {
    color: var(--white);
    background: var(--aubergine-700);
}

.button-primary:hover {
    background: var(--aubergine-600);
}

.button-secondary {
    color: var(--aubergine-700);
    border-color: var(--line);
    background: var(--white);
}

.button:active {
    transform: translateY(1px);
}

.button:disabled {
    opacity: 0.68;
    cursor: wait;
}

.notice {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin: -14px 0 20px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    font-size: 12px;
}

.notice span {
    display: grid;
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 50%;
    color: currentColor;
    font-size: 10px;
    font-weight: 800;
}

.notice p {
    margin: 0;
}

.notice-success {
    color: var(--success-text);
    background: var(--success-bg);
}

.notice-error {
    color: var(--danger-text);
    background: var(--danger-bg);
}

.security-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin: 22px 0 0;
    color: var(--ink-500);
    font-size: 10px;
    text-align: center;
}

.security-note span {
    color: #51916c;
    font-size: 7px;
}

.dashboard-preview {
    display: grid;
    padding: 24px;
    place-items: center;
}

.preview-card {
    width: min(100%, 520px);
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--white);
    box-shadow: var(--shadow);
}

.preview-card h1 {
    margin: 4px 0 8px;
    font-size: 24px;
}

.preview-card > p:not(.eyebrow) {
    margin: 0 0 22px;
    color: var(--ink-500);
}

@media (max-width: 900px) {
    .auth-shell {
        grid-template-columns: 330px minmax(0, 1fr);
    }

    .auth-context {
        padding: 30px;
    }

    .context-copy h1 {
        font-size: 34px;
    }

    .auth-panel {
        padding: 28px;
    }
}

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

    .auth-context {
        display: none;
    }

    .auth-panel {
        min-height: 100svh;
        padding: 24px 20px;
        place-items: start center;
    }

    .auth-card {
        margin: auto 0;
    }

    .mobile-brand {
        display: flex;
    }

    .mobile-brand .brand-mark {
        width: 36px;
        height: 36px;
        border-radius: 9px;
        font-size: 18px;
    }

    .mobile-brand strong {
        color: var(--aubergine-950);
        font-size: 14px;
    }
}

@media (max-width: 520px) {
    .field-grid {
        grid-template-columns: 1fr;
    }

    .form-header h2 {
        font-size: 21px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
