:root {
    --auth-bg-1: #090706;
    --auth-bg-2: #120d0c;
    --auth-bg-3: #1b130f;
    --auth-panel: rgba(17, 13, 12, 0.88);
    --auth-panel-strong: rgba(21, 16, 14, 0.96);
    --auth-line: rgba(211, 171, 104, 0.14);
    --auth-line-strong: rgba(211, 171, 104, 0.28);
    --auth-text: #f6efe7;
    --auth-text-soft: rgba(246, 239, 231, 0.78);
    --auth-text-muted: rgba(246, 239, 231, 0.58);
    --auth-accent: #d3ab68;
    --auth-accent-deep: #8d5d34;
    --auth-danger-bg: rgba(179, 88, 88, 0.13);
    --auth-shadow: 0 28px 72px rgba(0, 0, 0, 0.32);
    --auth-radius-xl: 30px;
    --auth-radius-lg: 22px;
    --auth-radius-md: 16px;
    --auth-radius-sm: 12px;
}

.auth-stage {
    min-height: 100svh;
    min-height: 100dvh;
    margin: 0;
    color: var(--auth-text);
    background:
        radial-gradient(72rem 36rem at 0% 0%, rgba(211, 171, 104, 0.10), transparent 58%),
        radial-gradient(48rem 28rem at 100% 0%, rgba(103, 31, 25, 0.16), transparent 48%),
        radial-gradient(40rem 26rem at 50% 100%, rgba(126, 78, 39, 0.10), transparent 44%),
        linear-gradient(180deg, var(--auth-bg-3) 0%, var(--auth-bg-2) 42%, var(--auth-bg-1) 100%);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.auth-stage *,
.auth-stage *::before,
.auth-stage *::after {
    box-sizing: border-box;
}

.auth-layout {
    width: min(100%, 1380px);
    min-height: 100svh;
    min-height: 100dvh;
    margin: 0 auto;
    padding:
        max(14px, env(safe-area-inset-top))
        max(12px, env(safe-area-inset-right))
        max(14px, env(safe-area-inset-bottom))
        max(12px, env(safe-area-inset-left));
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    align-items: center;
}

.auth-shell,
.auth-brand {
    min-width: 0;
}

.auth-shell {
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-panel,
.auth-brand-surface {
    position: relative;
    border-radius: var(--auth-radius-xl);
    border: 1px solid var(--auth-line);
    box-shadow: var(--auth-shadow);
}

.auth-panel {
    width: min(100%, 560px);
    padding: 20px;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.008)),
        linear-gradient(180deg, var(--auth-panel) 0%, var(--auth-panel-strong) 100%);
}

.auth-panel-head {
    display: grid;
    gap: 14px;
    margin-bottom: 16px;
}

.auth-copy {
    display: grid;
    gap: 8px;
}

.auth-eyebrow,
.auth-brand-kicker {
    margin: 0;
    color: var(--auth-accent);
    font-size: 0.76rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.auth-title,
.auth-brand-title {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-weight: 500;
    line-height: 1.02;
    letter-spacing: -0.03em;
    text-wrap: balance;
}

.auth-title {
    font-size: clamp(1.8rem, 4.6vw, 2.8rem);
}

.auth-subtitle {
    margin: 0;
    max-width: 38ch;
    color: var(--auth-text-muted);
    font-size: 0.96rem;
    line-height: 1.58;
}

.auth-tabs,
.seg {
    display: grid;
    gap: 6px;
    padding: 5px;
    background: rgba(255,255,255,0.025);
    border: 1px solid var(--auth-line);
}

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

.seg {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-radius: 16px;
}

.auth-tab,
.seg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 12px;
    border: 1px solid transparent;
    border-radius: 13px;
    background: transparent;
    color: var(--auth-text-soft);
    font-size: 0.92rem;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.seg-btn {
    cursor: pointer;
}

.auth-tab:hover,
.seg-btn:hover {
    color: var(--auth-text);
    background: rgba(255,255,255,0.04);
}

.auth-tab.is-active,
.seg-btn.is-active {
    color: var(--auth-text);
    border-color: var(--auth-line-strong);
    background:
        linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.012)),
        rgba(211, 171, 104, 0.10);
}

.auth-alert {
    margin: 0 0 14px;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid rgba(179, 88, 88, 0.28);
    background: var(--auth-danger-bg);
    color: var(--auth-text);
    line-height: 1.5;
}

.auth-alert--ok {
    border-color: rgba(82, 171, 121, 0.28);
    background: rgba(55, 120, 79, 0.16);
}

.auth-resend {
    display: grid;
    gap: 12px;
    margin: 0 0 16px;
    padding: 14px;
    border-radius: 18px;
    border: 1px solid var(--auth-line);
    background: rgba(255,255,255,0.03);
}

.auth-resend-copy {
    display: grid;
    gap: 6px;
}

.auth-resend-copy strong {
    color: var(--auth-text);
    font-size: 0.95rem;
}

.auth-resend-copy span {
    color: var(--auth-text-muted);
    font-size: 0.88rem;
    line-height: 1.5;
}

.auth-resend-form {
    margin: 0;
}

.auth-resend-btn {
    min-height: 44px;
    width: 100%;
}

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

.field-block,
.field-row,
.field,
.field-meta {
    min-width: 0;
}

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

.field-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 6px 10px;
}

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

.field-label {
    color: var(--auth-text-soft);
    font-size: 0.9rem;
    font-weight: 650;
}

.field-helper {
    color: var(--auth-text-muted);
    font-size: 0.8rem;
    line-height: 1.45;
}

.auth-panel input[type="text"],
.auth-panel input[type="email"],
.auth-panel input[type="password"],
.auth-panel input[type="tel"],
.auth-panel input[type="search"],
.auth-panel input[type="url"],
.auth-panel input[type="number"],
.auth-panel select,
.auth-panel textarea {
    width: 100%;
    min-height: 50px;
    padding: 0 14px;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    background: rgba(255,255,255,0.03);
    color: var(--auth-text);
    outline: 0;
    box-shadow: none;
    transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.auth-panel textarea {
    min-height: 124px;
    padding: 14px;
    resize: vertical;
}

.auth-panel input::placeholder,
.auth-panel textarea::placeholder {
    color: rgba(246, 239, 231, 0.38);
}

.auth-panel input:hover,
.auth-panel select:hover,
.auth-panel textarea:hover {
    border-color: rgba(211, 171, 104, 0.2);
}

.auth-panel input:focus,
.auth-panel select:focus,
.auth-panel textarea:focus,
.auth-tab:focus-visible,
.seg-btn:focus-visible,
.auth-submit:focus-visible {
    border-color: rgba(211, 171, 104, 0.42);
    background: rgba(255,255,255,0.045);
    box-shadow: 0 0 0 4px rgba(211, 171, 104, 0.1);
    outline: none;
}

.auth-submit,
.auth-panel .btn,
.auth-panel button[type="submit"] {
    width: 100%;
    min-height: 50px;
    margin-top: 4px;
    border: 1px solid rgba(211, 171, 104, 0.24);
    border-radius: 15px;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01)),
        linear-gradient(135deg, rgba(167,111,55,0.24), rgba(100,43,38,0.22));
    color: var(--auth-text);
    font-weight: 700;
    box-shadow: 0 14px 36px rgba(0,0,0,0.22);
    transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

.auth-submit:hover,
.auth-panel .btn:hover,
.auth-panel button[type="submit"]:hover {
    transform: translateY(-1px);
    border-color: rgba(211, 171, 104, 0.36);
    box-shadow: 0 18px 42px rgba(0,0,0,0.26);
}

.auth-submit:active,
.auth-panel .btn:active,
.auth-panel button[type="submit"]:active {
    transform: translateY(0);
}

.auth-note {
    margin: 2px 0 0;
    color: var(--auth-text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

.auth-note a {
    color: var(--auth-text);
    text-decoration: none;
    border-bottom: 1px solid rgba(211, 171, 104, 0.32);
}

.auth-note a:hover {
    border-bottom-color: rgba(211, 171, 104, 0.62);
}

.auth-brand {
    display: none;
}

.auth-brand-surface {
    height: 100%;
    min-height: 620px;
    padding: 28px;
    background:
        radial-gradient(26rem 20rem at 50% 24%, rgba(211,171,104,0.11), transparent 58%),
        linear-gradient(180deg, rgba(28,19,15,0.70), rgba(12,9,8,0.82));
    overflow: hidden;
}

.auth-brand-surface::before {
    content: "";
    position: absolute;
    inset: 18px;
    border-radius: calc(var(--auth-radius-xl) - 8px);
    border: 1px solid rgba(255,255,255,0.03);
    pointer-events: none;
}

.auth-brand-frame {
    position: relative;
    z-index: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    gap: 22px;
}

.auth-brand-mark {
    width: min(100%, 420px);
    min-height: 260px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    border-radius: 28px;
    border: 1px solid rgba(211,171,104,0.12);
    background:
        radial-gradient(circle at 50% 50%, rgba(211,171,104,0.12), transparent 56%),
        rgba(255,255,255,0.02);
}

.auth-brand-logo {
    display: block;
    width: min(100%, 300px);
    max-height: 240px;
    object-fit: contain;
    filter: drop-shadow(0 24px 40px rgba(0,0,0,0.34));
}

.auth-brand-copy {
    max-width: 520px;
}

.auth-brand-title {
    margin: 12px 0 0;
    font-size: clamp(2rem, 3vw, 3.35rem);
}

.auth-brand-text {
    margin: 14px auto 0;
    max-width: 42ch;
    color: var(--auth-text-soft);
    font-size: 1rem;
    line-height: 1.65;
}

.auth-brand-meta {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 18px;
}

.auth-brand-meta span {
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid rgba(211,171,104,0.14);
    background: rgba(255,255,255,0.02);
    color: var(--auth-text-soft);
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

@media (max-width: 479.98px) {
    .auth-layout {
        gap: 14px;
    }

    .auth-panel {
        padding: 18px;
        border-radius: 24px;
    }

    .auth-tab,
    .seg-btn {
        min-height: 40px;
        font-size: 0.86rem;
        padding-inline: 8px;
    }

    .seg {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 768px) {
    .auth-layout {
        justify-items: center;
        padding-inline: 24px;
        gap: 22px;
    }

    .auth-shell {
        width: 100%;
        max-width: 620px;
    }

    .auth-panel {
        width: min(100%, 620px);
        padding: 24px;
    }
}

@media (min-width: 1024px) {
    .auth-layout {
        grid-template-columns: minmax(420px, 500px) minmax(480px, 1fr);
        justify-items: stretch;
        gap: 36px;
        padding-inline: 28px;
    }

    .auth-shell {
        justify-content: flex-start;
    }

    .auth-panel {
        width: 460px;
        max-width: 460px;
        padding: 26px;
    }

    .auth-brand {
        display: block;
        min-width: 0;
    }
}

@media (min-width: 1280px) {
    .auth-layout {
        grid-template-columns: 480px minmax(560px, 1fr);
        gap: 54px;
        padding-inline: 40px;
    }

    .auth-brand-surface {
        min-height: 680px;
        padding: 34px;
    }

    .auth-brand-logo {
        width: min(100%, 340px);
        max-height: 260px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-tab,
    .seg-btn,
    .auth-panel input,
    .auth-panel select,
    .auth-panel textarea,
    .auth-submit,
    .auth-panel .btn,
    .auth-panel button[type="submit"] {
        transition: none;
    }
}
