:root {
    --auth-bg: #faf9f7;
    --auth-surface: #ffffff;
    --auth-surface-soft: #f5f3f3;
    --auth-ink: #24262b;
    --auth-muted: #62666f;
    --auth-line: #e6e3df;
    --auth-primary: #991b2f;
    --auth-primary-hover: #76001c;
    --auth-primary-soft: #fcedef;
    --auth-info: #356aa0;
    --auth-success: #257a57;
    --auth-success-soft: #eaf7f0;
    --auth-danger: #ba1a1a;
    --auth-danger-soft: #ffdad6;
    --auth-warning: #b86e12;
    --auth-warning-soft: #fff4de;
    --auth-shadow: 0 12px 32px rgb(36 38 43 / 0.08);
}

* {
    box-sizing: border-box;
}

[x-cloak] {
    display: none !important;
}

html {
    min-width: 320px;
    min-height: 100%;
    background: var(--auth-bg);
}

body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    color: var(--auth-ink);
    background: var(--auth-bg);
    font-family: "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;
    text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea {
    font: inherit;
}

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

button {
    cursor: pointer;
}

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

svg {
    display: block;
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(360px, 46%) minmax(0, 54%);
}

.auth-story {
    position: sticky;
    top: 0;
    min-height: 100vh;
    overflow: hidden;
    color: #fff;
    background: #4b0b18;
}

.auth-story-image,
.auth-story-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.auth-story-image {
    object-fit: cover;
}

.auth-story-overlay {
    background:
        linear-gradient(180deg, rgb(40 7 13 / 0.18), rgb(52 5 15 / 0.82)),
        linear-gradient(90deg, rgb(40 7 13 / 0.25), transparent 70%);
}

.auth-story-inner {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 40px clamp(28px, 4vw, 64px);
}

.auth-brand {
    width: fit-content;
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.auth-brand-mark {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border: 1px solid rgb(255 255 255 / 0.3);
    border-radius: 14px;
    color: #fff;
    background: rgb(255 255 255 / 0.16);
    backdrop-filter: blur(12px);
}

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

.auth-brand-copy {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.auth-brand-copy strong {
    font-size: 16px;
    letter-spacing: -0.02em;
}

.auth-brand-copy span {
    color: rgb(255 255 255 / 0.72);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.auth-story-content {
    max-width: 580px;
    margin: 15vh 0 8vh;
}

.auth-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 16px;
    color: #ffdada;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.auth-eyebrow::before {
    content: "";
    width: 28px;
    height: 2px;
    border-radius: 999px;
    background: #ffb3b4;
}

.auth-story-content h1 {
    margin: 0;
    color: #fff;
    font-size: clamp(38px, 4vw, 64px);
    line-height: 1.08;
    letter-spacing: -0.055em;
}

.auth-story-content > p {
    max-width: 540px;
    margin: 20px 0 0;
    color: rgb(255 255 255 / 0.78);
    font-size: 15px;
    line-height: 1.75;
}

.auth-trust-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 28px;
}

.auth-trust-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid rgb(255 255 255 / 0.22);
    border-radius: 999px;
    color: rgb(255 255 255 / 0.9);
    background: rgb(255 255 255 / 0.1);
    backdrop-filter: blur(10px);
    font-size: 10px;
    font-weight: 700;
}

.auth-trust-item svg {
    width: 15px;
    height: 15px;
}

.auth-story-note {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgb(255 255 255 / 0.66);
    font-size: 10px;
}

.auth-story-note svg {
    width: 16px;
    height: 16px;
}

.auth-main {
    min-width: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px clamp(24px, 5vw, 72px);
}

.auth-main--top {
    align-items: flex-start;
}

.auth-card {
    width: 100%;
    max-width: 480px;
}

.auth-card--wide {
    max-width: 820px;
}

.auth-mobile-brand {
    display: none;
    margin-bottom: 32px;
    color: var(--auth-primary);
}

.auth-mobile-brand .auth-brand-mark {
    border-color: var(--auth-line);
    color: var(--auth-primary);
    background: var(--auth-primary-soft);
}

.auth-mobile-brand .auth-brand-copy span {
    color: var(--auth-muted);
}

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

.auth-heading-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.auth-kicker {
    margin: 0 0 8px;
    color: var(--auth-primary);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.auth-heading h2 {
    margin: 0;
    color: var(--auth-ink);
    font-size: clamp(28px, 3vw, 36px);
    line-height: 1.2;
    letter-spacing: -0.04em;
}

.auth-heading > p,
.auth-heading-copy > p {
    margin: 10px 0 0;
    color: var(--auth-muted);
    font-size: 14px;
    line-height: 1.65;
}

.auth-back-link,
.auth-text-link {
    color: var(--auth-primary);
    font-size: 12px;
    font-weight: 800;
}

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

.auth-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 20px;
    padding: 13px 14px;
    border: 1px solid;
    border-radius: 12px;
    font-size: 12px;
    line-height: 1.55;
}

.auth-alert svg {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    margin-top: 1px;
}

.auth-alert--success {
    color: var(--auth-success);
    border-color: #b8e2ce;
    background: var(--auth-success-soft);
}

.auth-alert--danger {
    color: #93000a;
    border-color: #f2b8b5;
    background: var(--auth-danger-soft);
}

.auth-alert--warning {
    color: var(--auth-warning);
    border-color: #f0d3a1;
    background: var(--auth-warning-soft);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.auth-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.auth-grid--three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.auth-span-full {
    grid-column: 1 / -1;
}

.auth-section {
    margin-top: 28px;
    padding-top: 26px;
    border-top: 1px solid var(--auth-line);
}

.auth-section:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

.auth-section-title {
    margin-bottom: 18px;
}

.auth-section-title h3 {
    margin: 0;
    font-size: 17px;
    letter-spacing: -0.025em;
}

.auth-section-title p {
    margin: 5px 0 0;
    color: var(--auth-muted);
    font-size: 12px;
    line-height: 1.5;
}

.auth-field {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.auth-field-label {
    color: var(--auth-ink);
    font-size: 12px;
    font-weight: 800;
}

.auth-required {
    color: var(--auth-danger);
}

.auth-control {
    position: relative;
    min-height: 48px;
    display: flex;
    align-items: center;
    border: 1px solid var(--auth-line);
    border-radius: 12px;
    background: var(--auth-surface);
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

.auth-control:focus-within {
    border-color: var(--auth-info);
    box-shadow: 0 0 0 3px rgb(53 106 160 / 0.1);
}

.auth-control--error {
    border-color: #e58080;
}

.auth-control-icon {
    width: 46px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    color: #867579;
}

.auth-control-icon svg {
    width: 19px;
    height: 19px;
}

.auth-control input,
.auth-control select,
.auth-control textarea {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    color: var(--auth-ink);
    background: transparent;
    box-shadow: none;
    font-size: 13px;
}

.auth-control input,
.auth-control select {
    min-height: 46px;
    padding: 0 14px;
}

.auth-control .auth-control-icon + input,
.auth-control .auth-control-icon + select {
    padding-left: 0;
}

.auth-control textarea {
    min-height: 104px;
    resize: vertical;
    padding: 13px 14px;
    line-height: 1.55;
}

.auth-control input::placeholder,
.auth-control textarea::placeholder {
    color: #9b9193;
}

.auth-control input:read-only {
    color: var(--auth-muted);
    background: var(--auth-surface-soft);
    cursor: not-allowed;
}

.auth-password-toggle {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border: 0;
    border-radius: 10px;
    color: #867579;
    background: transparent;
}

.auth-password-toggle:hover {
    color: var(--auth-primary);
    background: var(--auth-primary-soft);
}

.auth-password-toggle svg {
    width: 19px;
    height: 19px;
}

.auth-field-error {
    color: var(--auth-danger);
    font-size: 10px;
    font-weight: 700;
    line-height: 1.45;
}

.auth-field-hint {
    color: var(--auth-muted);
    font-size: 10px;
    line-height: 1.45;
}

.auth-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.auth-check {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    color: var(--auth-muted);
    font-size: 11px;
    line-height: 1.55;
}

.auth-check input {
    width: 17px;
    height: 17px;
    flex: 0 0 auto;
    margin: 1px 0 0;
    accent-color: var(--auth-primary);
}

.auth-button {
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 0 18px;
    border: 1px solid transparent;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 800;
    text-align: center;
    transition: transform 150ms ease, background 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.auth-button:hover {
    transform: translateY(-1px);
}

.auth-button:disabled {
    cursor: wait;
    opacity: 0.65;
    transform: none;
}

.auth-button--primary {
    color: #fff;
    background: var(--auth-primary);
    box-shadow: 0 10px 24px rgb(153 27 47 / 0.18);
}

.auth-button--primary:hover {
    background: var(--auth-primary-hover);
    box-shadow: 0 14px 28px rgb(118 0 28 / 0.22);
}

.auth-button--secondary {
    color: var(--auth-ink);
    border-color: var(--auth-line);
    background: var(--auth-surface);
}

.auth-button--secondary:hover {
    border-color: #cdbfc1;
    background: var(--auth-surface-soft);
}

.auth-button--ghost {
    min-height: 40px;
    color: var(--auth-primary);
    background: transparent;
}

.auth-button--full {
    width: 100%;
}

.auth-google-icon {
    width: 20px;
    height: 20px;
}

.auth-divider {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
    margin: 22px 0;
    color: #8b7e81;
    font-size: 10px;
    font-weight: 700;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    height: 1px;
    background: var(--auth-line);
}

.auth-register-links {
    margin-top: 26px;
    padding: 18px;
    border: 1px solid var(--auth-line);
    border-radius: 16px;
    background: var(--auth-surface);
}

.auth-register-links > p {
    margin: 0 0 12px;
    color: var(--auth-muted);
    font-size: 11px;
    text-align: center;
}

.auth-register-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.auth-privacy-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin: 20px 0 0;
    color: #8b7e81;
    font-size: 9px;
    text-align: center;
}

.auth-privacy-note svg {
    width: 14px;
    height: 14px;
}

.auth-method-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.auth-method-card {
    min-height: 210px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 22px;
    border: 1px solid var(--auth-line);
    border-radius: 16px;
    background: var(--auth-surface);
    text-align: left;
    transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.auth-method-card:hover {
    transform: translateY(-2px);
    border-color: #d5c5c8;
    box-shadow: var(--auth-shadow);
}

.auth-method-icon {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    color: var(--auth-primary);
    background: var(--auth-primary-soft);
}

.auth-method-icon svg {
    width: 22px;
    height: 22px;
}

.auth-method-card h3 {
    margin: 20px 0 7px;
    font-size: 16px;
}

.auth-method-card p {
    margin: 0 0 18px;
    color: var(--auth-muted);
    font-size: 11px;
    line-height: 1.6;
}

.auth-method-card strong {
    margin-top: auto;
    color: var(--auth-primary);
    font-size: 11px;
}

.auth-method-active {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 24px;
    padding: 13px 15px;
    border: 1px solid #b8e2ce;
    border-radius: 13px;
    color: var(--auth-success);
    background: var(--auth-success-soft);
    font-size: 11px;
    font-weight: 700;
}

.auth-method-active button {
    border: 0;
    color: var(--auth-primary);
    background: transparent;
    font-size: 10px;
    font-weight: 800;
}

.auth-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid var(--auth-line);
}

.auth-success-panel {
    padding: 26px;
    border: 1px solid #b8e2ce;
    border-radius: 18px;
    background: var(--auth-success-soft);
    text-align: center;
}

.auth-success-icon {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    margin: 0 auto 16px;
    border-radius: 999px;
    color: var(--auth-success);
    background: #fff;
}

.auth-success-icon svg {
    width: 26px;
    height: 26px;
}

.auth-success-panel h3 {
    margin: 0;
    font-size: 18px;
}

.auth-success-panel p {
    margin: 8px 0 20px;
    color: #476a5b;
    font-size: 12px;
    line-height: 1.65;
}

@media (max-width: 1080px) {
    .auth-shell {
        grid-template-columns: minmax(320px, 40%) minmax(0, 60%);
    }

    .auth-story-inner {
        padding-inline: 32px;
    }

    .auth-story-content h1 {
        font-size: 42px;
    }

    .auth-main {
        padding-inline: 32px;
    }

    .auth-grid--three {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

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

    .auth-story {
        display: none;
    }

    .auth-main,
    .auth-main--top {
        min-height: 100vh;
        align-items: flex-start;
        padding: 32px 20px 48px;
    }

    .auth-card,
    .auth-card--wide {
        max-width: 620px;
        margin: 0 auto;
    }

    .auth-mobile-brand {
        display: inline-flex;
    }
}

@media (max-width: 620px) {
    .auth-heading-row {
        display: block;
    }

    .auth-heading-row .auth-back-link {
        display: inline-block;
        margin-top: 12px;
    }

    .auth-grid,
    .auth-grid--three,
    .auth-method-grid,
    .auth-register-actions {
        grid-template-columns: 1fr;
    }

    .auth-options {
        align-items: flex-start;
        flex-direction: column;
    }

    .auth-form-actions {
        flex-direction: column-reverse;
    }

    .auth-form-actions .auth-button {
        width: 100%;
    }

    .auth-method-card {
        min-height: 180px;
    }
}

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