@font-face {
    font-family: "Builder Sans";
    src: url("/static/fonts/BuilderSans-Regular.woff2") format("woff2");
    font-style: normal;
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: "Builder Sans";
    src: url("/static/fonts/BuilderSans-SemiBold.woff2") format("woff2");
    font-style: normal;
    font-weight: 600;
    font-display: swap;
}

@font-face {
    font-family: "Builder Sans";
    src: url("/static/fonts/BuilderSans-Bold.woff2") format("woff2");
    font-style: normal;
    font-weight: 700;
    font-display: swap;
}

@font-face {
    font-family: "Builder Extended";
    src: url("/static/fonts/BuilderExtended-Bold.woff2") format("woff2");
    font-style: normal;
    font-weight: 700;
    font-display: swap;
}

:root {
    --surface-page: rgb(18, 18, 21);
    --surface-card: rgb(25, 26, 31);
    --surface-control: rgb(31, 32, 38);
    --surface-control-hover: rgb(38, 39, 46);
    --text-primary: rgb(247, 247, 248);
    --text-secondary: rgb(213, 215, 221);
    --text-muted: rgb(153, 155, 165);
    --border-muted: rgba(208, 217, 251, 0.12);
    --border-control: rgba(208, 217, 251, 0.2);
    --accent-blue: rgb(51, 95, 255);
    --accent-blue-hover: rgb(76, 115, 255);
    --success: rgb(85, 209, 139);
    --error: rgb(255, 124, 133);
}

* {
    box-sizing: border-box;
}

html {
    color-scheme: dark;
}

body {
    min-width: 320px;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    background:
        radial-gradient(circle at 10% 0%, rgba(51, 95, 255, 0.12), transparent 34%),
        var(--surface-page);
    color: var(--text-secondary);
    font-family: "Builder Sans", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

button,
input {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

button {
    border: 0;
    cursor: pointer;
}

a {
    color: inherit;
    text-decoration: none;
}

[hidden] {
    display: none !important;
}

.auth-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(420px, 520px);
    width: min(1120px, calc(100% - 64px));
    min-height: 680px;
    margin: 48px auto;
    overflow: hidden;
    border: 1px solid var(--border-muted);
    border-radius: 24px;
    background: var(--surface-card);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
}

.auth-intro {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 40px 48px;
    overflow: hidden;
    border-right: 1px solid var(--border-muted);
    background:
        radial-gradient(circle at 90% 15%, rgba(51, 95, 255, 0.28), transparent 42%),
        linear-gradient(145deg, rgb(27, 29, 38), rgb(20, 20, 25));
}

.auth-intro::after {
    position: absolute;
    right: -130px;
    bottom: -160px;
    width: 390px;
    height: 390px;
    border: 1px solid rgba(141, 162, 255, 0.13);
    border-radius: 50%;
    box-shadow:
        0 0 0 60px rgba(141, 162, 255, 0.035),
        0 0 0 120px rgba(141, 162, 255, 0.025);
    content: "";
    pointer-events: none;
}

.auth-brand {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    gap: 12px;
    color: var(--text-primary);
}

.auth-brand-mark {
    width: 30px;
    height: 30px;
}

.auth-brand-name {
    font-family: "Builder Extended", "Builder Sans", sans-serif;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.auth-intro-content {
    position: relative;
    z-index: 1;
    margin: auto 0;
    padding: 56px 0;
}

.auth-eyebrow,
.auth-panel-kicker {
    color: rgb(145, 166, 255);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.6px;
}

.auth-intro h1 {
    max-width: 480px;
    margin: 16px 0 20px;
    color: var(--text-primary);
    font-size: clamp(38px, 4vw, 54px);
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: -1.8px;
}

.auth-intro-content > p {
    max-width: 430px;
    margin: 0;
    color: var(--text-secondary);
    font-size: 16px;
    line-height: 1.65;
}

.auth-benefits {
    display: grid;
    gap: 18px;
    margin: 42px 0 0;
    padding: 0;
    list-style: none;
}

.auth-benefits li {
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--text-muted);
}

.auth-benefits strong {
    color: var(--text-secondary);
    font-weight: 600;
}

.auth-benefit-icon {
    display: grid;
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid var(--border-muted);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
}

.auth-benefit-icon svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.auth-intro-footer {
    position: relative;
    z-index: 1;
    margin: 0;
    color: var(--text-muted);
    font-size: 12px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.auth-content {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 28px 48px 40px;
    background: var(--surface-card);
}

.auth-language-switcher {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-bottom: 24px;
    color: var(--text-muted);
    font-size: 13px;
}

.auth-language-switcher select {
    min-width: 116px;
    height: 40px;
    padding: 0 32px 0 12px;
    border: 1px solid var(--border-control);
    border-radius: 10px;
    outline: none;
    background: var(--surface-control);
    color: var(--text-primary);
    cursor: pointer;
}

.auth-language-switcher select:hover {
    border-color: rgba(208, 217, 251, 0.32);
}

.auth-language-switcher select:focus-visible {
    outline: 2px solid var(--text-primary);
    outline-offset: 3px;
}

.auth-panel {
    width: 100%;
    margin: auto 0;
}

.auth-panel-heading {
    margin-bottom: 28px;
}

.auth-panel-heading h2 {
    margin: 9px 0 8px;
    color: var(--text-primary);
    font-size: 30px;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.6px;
}

.auth-panel-heading h2:focus {
    outline: none;
}

.auth-panel-heading p {
    margin: 0;
    color: var(--text-muted);
    font-size: 14px;
}

.google-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 46px;
    gap: 12px;
    padding: 10px 16px;
    border: 1px solid rgb(218, 220, 224);
    border-radius: 10px;
    background: rgb(255, 255, 255);
    color: rgb(31, 31, 31);
    font-weight: 600;
    transition: background 150ms ease, transform 150ms ease;
}

.google-button:hover {
    background: rgb(242, 243, 245);
}

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

.google-icon {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 24px 0;
    color: var(--text-muted);
    font-size: 12px;
    white-space: nowrap;
}

.auth-divider::before,
.auth-divider::after {
    width: 100%;
    height: 1px;
    background: var(--border-muted);
    content: "";
}

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

.form-field {
    display: grid;
    gap: 8px;
}

.form-field label {
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
}

.form-field input {
    width: 100%;
    min-width: 0;
    height: 46px;
    padding: 0 14px;
    border: 1px solid var(--border-control);
    border-radius: 10px;
    outline: none;
    background: var(--surface-control);
    color: var(--text-primary);
    caret-color: var(--text-primary);
    transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.form-field input::placeholder {
    color: rgb(122, 124, 135);
    opacity: 1;
}

.form-field input:hover {
    border-color: rgba(208, 217, 251, 0.32);
}

.form-field input:focus {
    border-color: var(--accent-blue-hover);
    background: rgb(33, 34, 42);
    box-shadow: 0 0 0 2px rgba(51, 95, 255, 0.18);
}

.form-hint {
    color: var(--text-muted);
    font-size: 12px;
}

.primary-button,
.secondary-button {
    width: 100%;
    min-height: 46px;
    padding: 11px 16px;
    border-radius: 10px;
    font-weight: 600;
    transition: background 150ms ease, transform 150ms ease;
}

.primary-button {
    margin-top: 2px;
    background: var(--accent-blue);
    color: rgb(255, 255, 255);
}

.primary-button:hover {
    background: var(--accent-blue-hover);
}

.secondary-button {
    margin-top: -6px;
    border: 1px solid var(--border-control);
    background: transparent;
    color: var(--text-secondary);
}

.secondary-button:hover {
    background: var(--surface-control-hover);
    color: var(--text-primary);
}

.primary-button:active,
.secondary-button:active {
    transform: translateY(1px);
}

.primary-button:disabled,
.secondary-button:disabled,
.google-button[aria-disabled="true"] {
    cursor: not-allowed;
    opacity: 0.55;
}

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

.auth-switch a,
.text-button {
    color: rgb(145, 166, 255);
    font-weight: 600;
}

.auth-switch a:hover,
.text-button:hover {
    color: var(--text-primary);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.text-button {
    display: block;
    margin: 18px auto 0;
    padding: 0;
    background: transparent;
}

.verification-shortcut {
    font-size: 13px;
}

.verification-icon {
    display: grid;
    width: 52px;
    height: 52px;
    margin-bottom: 24px;
    place-items: center;
    border: 1px solid rgba(145, 166, 255, 0.2);
    border-radius: 14px;
    background: rgba(51, 95, 255, 0.12);
    color: rgb(145, 166, 255);
}

.verification-icon svg {
    width: 26px;
    height: 26px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.verification-heading strong {
    display: inline-block;
    max-width: 100%;
    overflow-wrap: anywhere;
    color: var(--text-secondary);
    font-weight: 600;
}

.form-field .verification-code-input {
    height: 58px;
    padding: 0 18px;
    font-size: 25px;
    font-weight: 600;
    letter-spacing: 8px;
    text-align: center;
}

.verification-code-input::placeholder {
    color: rgb(100, 102, 113);
    letter-spacing: 8px;
}

.form-feedback {
    margin: -2px 0 0;
    padding: 10px 12px;
    border: 1px solid var(--border-muted);
    border-radius: 8px;
    background: var(--surface-control);
    color: var(--text-secondary);
    font-size: 13px;
    overflow-wrap: anywhere;
}

.form-feedback:empty {
    display: none;
}

.form-feedback.is-success {
    border-color: rgba(85, 209, 139, 0.3);
    background: rgba(85, 209, 139, 0.08);
    color: var(--success);
}

.form-feedback.is-error {
    border-color: rgba(255, 124, 133, 0.35);
    background: rgba(255, 124, 133, 0.08);
    color: var(--error);
}

.form-feedback.is-loading {
    color: var(--text-secondary);
}

.auth-legal {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px 12px;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--border-muted);
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.5;
    text-align: center;
}

.auth-legal a {
    color: var(--text-secondary);
    font-weight: 600;
}

.google-button:focus-visible,
.primary-button:focus-visible,
.secondary-button:focus-visible,
.text-button:focus-visible,
.auth-switch a:focus-visible,
.auth-legal a:focus-visible {
    outline: 2px solid var(--text-primary);
    outline-offset: 3px;
}

@media (max-width: 900px) {
    .auth-layout {
        grid-template-columns: minmax(0, 0.85fr) minmax(390px, 1fr);
        width: calc(100% - 40px);
        margin: 20px auto;
    }

    .auth-intro {
        padding: 32px;
    }

    .auth-content {
        padding: 36px;
    }

    .auth-intro h1 {
        font-size: 38px;
    }

    .auth-benefits {
        align-items: start;
    }
}

@media (max-width: 720px) {
    .auth-layout {
        display: block;
        width: min(480px, calc(100% - 32px));
        min-height: 0;
        margin: 16px auto;
        border-radius: 20px;
    }

    .auth-intro {
        display: block;
        padding: 24px;
        border-right: 0;
        border-bottom: 1px solid var(--border-muted);
    }

    .auth-intro-content,
    .auth-intro-footer {
        display: none;
    }

    .auth-brand {
        margin: 0 auto;
    }

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

@media (max-width: 400px) {
    .auth-layout {
        width: calc(100% - 24px);
        margin: 12px auto;
    }

    .auth-intro {
        padding: 20px;
    }

    .auth-content {
        padding: 28px 20px;
    }

    .auth-panel-heading h2 {
        font-size: 27px;
    }
}

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