:root {
    --auth-surface: rgba(255, 255, 255, 0.94);
    --auth-border: rgba(82, 96, 125, 0.14);
    --auth-shadow: 0 30px 70px rgba(20, 33, 61, 0.14);
}

.auth-body {
    min-height: 100vh;
}

.auth-main {
    width: 100%;
    min-height: calc(100vh - 84px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.guest-body .auth-main {
    width: 100%;
    margin: 0;
    padding: 0;
}

.auth-main .content-stack {
    width: 100%;
    min-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-screen {
    width: 100%;
    min-width: 0;
    display: flex;
    align-items: center;
}

.auth-wrapper {
    width: min(100% - 2rem, 1240px);
    min-height: 100%;
    margin-inline: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-block: 2.25rem;
}

.auth-card {
    width: min(100%, 1120px);
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
    background: var(--auth-surface);
    border: 1px solid var(--auth-border);
    border-radius: 32px;
    box-shadow: var(--auth-shadow);
    overflow: hidden;
}

.auth-card.auth-card-single {
    width: min(100%, 560px);
    grid-template-columns: 1fr;
}

.auth-form-panel,
.auth-info-panel {
    min-width: 0;
}

.auth-form-panel {
    padding: 38px;
    background:
        radial-gradient(circle at top right, rgba(34, 83, 217, 0.08), transparent 28%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(246, 249, 254, 0.98) 100%);
}

.auth-info-panel {
    padding: 38px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    color: #f5f8ff;
    background:
        radial-gradient(circle at top, rgba(255, 255, 255, 0.18), transparent 35%),
        radial-gradient(circle at bottom left, rgba(255, 159, 67, 0.28), transparent 30%),
        linear-gradient(160deg, #10255f 0%, #1842b6 46%, #0f766e 100%);
}

.auth-info-panel h2,
.auth-info-panel p,
.auth-info-panel .eyebrow {
    color: inherit;
}

.auth-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.9rem;
    margin-bottom: 1.6rem;
    color: var(--text);
}

.auth-brand__logo {
    display: block;
    width: auto;
    max-width: 180px;
    height: auto;
    max-height: 48px;
    object-fit: contain;
}

.auth-brand-copy {
    display: grid;
    gap: 0.12rem;
}

.auth-progress {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-soft);
}

.auth-progress span {
    width: 110px;
    height: 6px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary) 34%, rgba(34, 83, 217, 0.14) 34%, rgba(34, 83, 217, 0.06) 100%);
}

.auth-screen h1,
.auth-screen h2,
.auth-screen p {
    max-width: 100%;
    overflow-wrap: anywhere;
}

.auth-screen h1 {
    margin: 0;
    font-size: clamp(2.2rem, 3vw, 3rem);
    line-height: 1.03;
    letter-spacing: -0.04em;
}

.auth-screen .lead {
    margin: 0.9rem 0 1.75rem;
    font-size: 1rem;
}

.auth-alert-slot {
    width: 100%;
    min-width: 0;
}

.auth-alert-slot:empty {
    display: none;
}

.auth-form-panel .alert {
    width: 100%;
}

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

.auth-grid .full-span,
.auth-grid .checkbox-row,
.auth-grid .full-width {
    grid-column: 1 / -1;
}

.auth-stack {
    display: grid;
    gap: 1rem;
}

.auth-screen label {
    display: grid;
    gap: 0.45rem;
    color: var(--text);
    font-weight: 700;
}

.auth-screen label span:last-child {
    font-weight: 500;
}

.auth-card input,
.auth-card select,
.auth-card textarea,
.auth-card button {
    width: 100%;
    max-width: 100%;
}

.auth-screen input,
.auth-screen select,
.auth-screen textarea {
    width: 100%;
    min-width: 0;
    min-height: 52px;
    padding: 13px 15px;
    border-radius: 16px;
}

.auth-screen .btn {
    min-height: 54px;
}

.activation-resend {
    width: 100%;
    margin-top: 1.6rem;
    padding-top: 1.6rem;
    border-top: 1px solid rgba(217, 224, 236, 0.88);
}

.activation-resend__title {
    margin: 0 0 0.9rem;
    font-weight: 800;
}

.activation-resend form,
.auth-info-block {
    width: 100%;
    display: grid;
    gap: 1rem;
}

.auth-info-visual {
    width: 100%;
    display: flex;
    justify-content: center;
}

.auth-info-visual__picture {
    display: block;
    width: min(100%, 430px);
}

.auth-info-visual__image {
    display: block;
    width: 100%;
    max-height: 520px;
    object-fit: cover;
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 24px 60px rgba(7, 19, 60, 0.35);
}

.auth-legal {
    margin-top: 1.4rem;
    display: flex;
    gap: 0.9rem 1rem;
    flex-wrap: wrap;
    color: var(--text-soft);
}

.auth-note {
    margin: 0;
    color: rgba(245, 248, 255, 0.84);
}

.auth-info-panel .card {
    width: 100%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: none;
}

@media (max-width: 1024px) {
    .auth-card {
        grid-template-columns: minmax(0, 1fr) minmax(300px, 0.88fr);
    }

    .auth-info-visual__image {
        max-height: 460px;
    }

    .auth-form-panel,
    .auth-info-panel {
        padding: 30px;
    }
}

@media (max-width: 768px) {
    .auth-wrapper {
        width: min(100% - 1.5rem, 1200px);
        align-items: flex-start;
        padding-block: 1.25rem;
    }

    .auth-card,
    .auth-card.auth-card-single {
        width: 100%;
        grid-template-columns: 1fr;
        border-radius: 24px;
    }

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

    .auth-form-panel,
    .auth-info-panel {
        padding: 24px 20px;
    }

    .auth-info-panel {
        order: -1;
    }

    .auth-info-visual__image {
        max-height: 360px;
    }

    .auth-info-visual__picture {
        width: min(100%, 360px);
    }

    .auth-info-panel h2 {
        font-size: clamp(1.9rem, 8vw, 2.5rem);
        line-height: 1.1;
    }

    .auth-legal {
        flex-direction: column;
        align-items: stretch;
    }
}

/* Phase 1 auth alignment */

:root {
    --auth-surface: #ffffff;
    --auth-border: #e2e8f0;
    --auth-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.06);
}

.auth-main {
    align-items: stretch;
}

.auth-wrapper {
    width: min(100% - 32px, 1280px);
    padding-block: 24px;
}

.auth-card {
    border: 1px solid var(--auth-border);
    border-radius: 24px;
    box-shadow: var(--auth-shadow);
}

.auth-form-panel {
    padding: 32px;
    background:
        radial-gradient(circle at top right, rgba(91, 92, 240, 0.08), transparent 28%),
        linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.auth-info-panel {
    padding: 32px;
    background:
        radial-gradient(circle at top, rgba(255, 255, 255, 0.18), transparent 35%),
        radial-gradient(circle at bottom left, rgba(236, 72, 153, 0.22), transparent 30%),
        linear-gradient(155deg, #1e1b4b 0%, #4338ca 48%, #5b5cf0 100%);
}

.auth-brand {
    margin-bottom: 20px;
}

.auth-progress {
    color: var(--text-soft);
}

.auth-progress span {
    height: 8px;
    border-radius: 999px;
    background: linear-gradient(90deg, #5b5cf0 0%, #7c3aed 40%, rgba(91, 92, 240, 0.14) 40%, rgba(91, 92, 240, 0.06) 100%);
}

.auth-screen h1 {
    font-size: clamp(30px, 4vw, 40px);
    font-weight: 700;
    line-height: 1.04;
}

.auth-screen .lead {
    font-size: 15px;
    color: var(--text-soft);
}

.auth-screen label {
    font-size: 14px;
    font-weight: 600;
}

.auth-screen input,
.auth-screen select,
.auth-screen textarea {
    min-height: 46px;
    border-radius: 12px;
}

.auth-screen .btn {
    min-height: 44px;
    border-radius: 12px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.field-help,
.field-error {
    display: block;
    font-size: 13px;
    line-height: 1.45;
}

.field-help {
    color: var(--text-soft);
}

.field-error {
    color: #b42318;
}

.auth-country-field,
.auth-phone-field {
    gap: 0.55rem;
}

.country-combobox {
    position: relative;
}

.country-combobox__trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
    min-height: 46px;
    padding: 13px 15px;
    border: 1px solid #d6deeb;
    border-radius: 12px;
    background: #ffffff;
    color: #0f172a;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.country-combobox__trigger:focus-visible,
.country-combobox__search input:focus-visible,
.country-combobox__option:focus-visible,
.phone-input input:focus-visible {
    outline: 3px solid rgba(34, 83, 217, 0.18);
    outline-offset: 2px;
    border-color: #2253d9;
}

.country-combobox__value {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
    text-align: left;
}

.country-combobox__placeholder {
    color: #64748b;
    font-weight: 500;
}

.country-combobox__value-text {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    min-width: 0;
}

.country-combobox__meta {
    color: #475569;
    font-weight: 600;
    white-space: nowrap;
}

.country-combobox__chevron {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
    color: #64748b;
}

.country-combobox__chevron svg,
.phone-input__icon svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.7;
}

.country-combobox__panel {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    z-index: 15;
    display: grid;
    gap: 0.75rem;
    padding: 0.85rem;
    border: 1px solid #d6deeb;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.16);
}

.country-combobox__search input {
    width: 100%;
    min-height: 44px;
    padding: 11px 13px;
    border: 1px solid #d6deeb;
    border-radius: 12px;
    background: #f8fafc;
}

.country-combobox__list {
    display: grid;
    gap: 0.35rem;
    max-height: min(320px, 50vh);
    margin: 0;
    padding: 0;
    overflow-y: auto;
    list-style: none;
}

.country-combobox__option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    width: 100%;
    min-height: 50px;
    padding: 0.8rem 0.9rem;
    border: 1px solid transparent;
    border-radius: 12px;
    background: transparent;
    text-align: left;
    color: #0f172a;
}

.country-combobox__option:hover,
.country-combobox__option[aria-selected="true"] {
    background: #f8fbff;
    border-color: rgba(34, 83, 217, 0.18);
}

.country-combobox__option-identity {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-width: 0;
}

.country-combobox__flag {
    font-size: 1.2rem;
    line-height: 1;
}

.country-combobox__name {
    overflow: hidden;
    text-overflow: ellipsis;
}

.country-combobox__dial {
    color: #475569;
    font-weight: 700;
    white-space: nowrap;
}

.country-combobox__empty {
    margin: 0;
    color: #64748b;
    font-size: 13px;
}

.phone-input {
    position: relative;
}

.phone-input__icon {
    position: absolute;
    top: 50%;
    left: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    color: #64748b;
    transform: translateY(-50%);
    pointer-events: none;
}

.phone-input input {
    padding-left: 42px;
}

.phone-input input:disabled,
.country-combobox__trigger[aria-invalid="true"],
.phone-input input[aria-invalid="true"] {
    border-color: rgba(180, 35, 24, 0.32);
}

.phone-input input:disabled {
    background: #f8fafc;
    color: #64748b;
    cursor: not-allowed;
}

.auth-info-visual__image {
    border-radius: 22px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.22);
}

.auth-info-panel .card {
    border-color: rgba(255, 255, 255, 0.14);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.08);
}

.auth-note {
    color: rgba(255, 255, 255, 0.86);
}

.activation-resend {
    border-top-color: #e2e8f0;
}

@media (max-width: 768px) {
    .auth-wrapper {
        width: min(100% - 16px, 1200px);
        padding-block: 16px;
    }

    .auth-form-panel,
    .auth-info-panel {
        padding: 24px 20px;
    }

    .auth-card,
    .auth-card.auth-card-single {
        border-radius: 20px;
    }

    .country-combobox__panel {
        max-width: 100%;
    }
}
