/* ==========================================================================
   Вход и регистрация
   ========================================================================== */

.page-auth .site-main {
    padding-bottom: 24px;
}

.auth-shell {
    display: grid;
    grid-template-columns: minmax(0, 0.92fr) minmax(400px, 0.78fr);
    gap: clamp(24px, 4vw, 54px);
    align-items: stretch;
    max-width: 1140px;
    padding: 12px 0 20px;
}

/* ---------- Левая витрина ---------- */

.auth-aside {
    position: relative;
    display: flex;
    overflow: hidden;
    border: 1px solid rgba(255, 176, 32, 0.13);
    border-radius: 24px;
    background:
        radial-gradient(620px 420px at 16% 8%, rgba(255, 176, 32, 0.16), transparent 64%),
        radial-gradient(560px 380px at 92% 102%, rgba(255, 106, 61, 0.14), transparent 62%),
        linear-gradient(160deg, #111a30 0%, #0a1120 55%, #070c17 100%);
    box-shadow: var(--shadow);
}

.auth-aside::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(148, 170, 220, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 170, 220, 0.05) 1px, transparent 1px);
    background-size: 46px 46px;
    mask-image: radial-gradient(circle at 50% 40%, #000 30%, transparent 78%);
    pointer-events: none;
}

.auth-aside::after {
    content: "";
    position: absolute;
    right: -90px;
    bottom: -130px;
    width: 360px;
    height: 360px;
    border-radius: 50%;
    border: 1px solid rgba(255, 176, 32, 0.14);
    box-shadow: 0 0 0 34px rgba(255, 176, 32, 0.03), 0 0 0 70px rgba(255, 176, 32, 0.02);
    pointer-events: none;
}

.auth-aside__glow {
    position: absolute;
    top: -120px;
    left: -100px;
    width: 340px;
    height: 340px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 176, 32, 0.2), transparent 70%);
    filter: blur(8px);
    pointer-events: none;
}

.auth-aside__content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%;
    padding: clamp(34px, 5vw, 62px);
}

.auth-aside__content h2 {
    margin: 20px 0 18px;
    font-size: clamp(2.1rem, 3.6vw, 3.15rem);
    line-height: 1.02;
    letter-spacing: -0.045em;
}

.auth-aside__content p {
    max-width: 430px;
    color: var(--muted);
    font-size: 0.94rem;
    line-height: 1.72;
}

.auth-aside__list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 26px 0 0;
    padding: 0;
    list-style: none;
}

.auth-aside__list li {
    position: relative;
    padding-left: 28px;
    color: #cdd8ee;
    font-size: 0.88rem;
}

.auth-aside__list li::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 2px;
    width: 15px;
    height: 15px;
    transform: translateY(-50%);
    border: 1px solid rgba(88, 230, 162, 0.5);
    border-radius: 50%;
    background:
        linear-gradient(40deg, transparent 46%, rgba(88, 230, 162, 0.9) 47%, rgba(88, 230, 162, 0.9) 54%, transparent 55%) 3px 7px / 8px 6px no-repeat,
        rgba(88, 230, 162, 0.08);
}

/* Дорога с машинкой */

.auth-aside__road {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: clamp(32px, 5vw, 58px);
    padding: 18px 20px;
    border: 1px solid rgba(148, 170, 220, 0.13);
    border-radius: 16px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(0, 0, 0, 0.22)),
        #0a1120;
    overflow: hidden;
}

.auth-aside__road::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(320px 90px at 22% 50%, rgba(255, 176, 32, 0.12), transparent 70%);
    pointer-events: none;
}

.auth-aside__car {
    position: relative;
    z-index: 1;
    flex: none;
    width: 96px;
    animation: auth-car-bob 2.4s ease-in-out infinite;
}

.auth-aside__car svg {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.45));
}

.auth-aside__dash {
    position: relative;
    z-index: 1;
    flex: 1;
    height: 6px;
    border-radius: 999px;
    background:
        repeating-linear-gradient(90deg, rgba(255, 209, 92, 0.85) 0 26px, transparent 26px 52px);
    background-size: 52px 100%;
    opacity: 0.7;
    animation: auth-road-dash 1.1s linear infinite;
}

@keyframes auth-car-bob {
    0%,
    100% {
        transform: translateY(0) rotate(-0.6deg);
    }
    50% {
        transform: translateY(-3px) rotate(0.6deg);
    }
}

@keyframes auth-road-dash {
    to {
        background-position: -52px 0;
    }
}

/* ---------- Карточка формы ---------- */

.auth-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(26px, 3.6vw, 44px);
    border-radius: 24px;
}

.auth-card--wide {
    justify-content: flex-start;
}

.auth-card__head {
    margin-bottom: 24px;
}

.auth-card__icon {
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    margin-bottom: 16px;
    border: 1px solid rgba(255, 176, 32, 0.26);
    border-radius: 13px;
    background: rgba(255, 176, 32, 0.09);
    color: var(--accent);
    font-size: 1.15rem;
    font-weight: 800;
    box-shadow: 0 8px 22px rgba(255, 145, 40, 0.12);
}

.auth-card__head h1 {
    margin-bottom: 10px;
    font-size: clamp(1.65rem, 2.6vw, 2.15rem);
    letter-spacing: -0.04em;
}

.auth-card__head p {
    color: var(--muted);
    font-size: 0.86rem;
    line-height: 1.6;
}

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

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

.auth-card .alert {
    margin-bottom: 18px;
}

.auth-card__switch {
    margin-top: 22px;
    padding-top: 20px;
    border-top: 1px solid var(--line-soft);
    color: var(--muted);
    font-size: 0.84rem;
    text-align: center;
}

.auth-card__switch a {
    font-weight: 700;
}

.auth-card__legal {
    margin-top: 12px;
    color: var(--muted-2);
    font-size: 0.7rem;
    line-height: 1.5;
    text-align: center;
}

/* ---------- Загрузка аватара ---------- */

.avatar-upload {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 16px;
    border: 1px dashed rgba(148, 170, 220, 0.22);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.018);
    transition: border-color 0.2s ease, background 0.2s ease;
}

.avatar-upload:hover {
    border-color: rgba(255, 176, 32, 0.36);
    background: rgba(255, 176, 32, 0.03);
}

.avatar-upload__preview {
    position: relative;
    flex: none;
}

.avatar-upload__preview .avatar--xl {
    width: 88px;
    height: 88px;
    font-size: 1.55rem;
}

.avatar-upload__preview::after {
    content: "";
    position: absolute;
    inset: -5px;
    border: 1px dashed rgba(255, 176, 32, 0.28);
    border-radius: 50%;
    pointer-events: none;
}

.avatar-upload__body {
    min-width: 0;
}

.avatar-upload__button {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 8px 14px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.04);
    color: #dbe5f8;
    font-size: 0.79rem;
    font-weight: 800;
    cursor: pointer;
    transition: color 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.avatar-upload__button:hover {
    color: var(--accent);
    border-color: rgba(255, 176, 32, 0.4);
    background: rgba(255, 176, 32, 0.07);
}

.avatar-upload .hint {
    margin-top: 8px;
}

/* ---------- Адаптивность ---------- */

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

    .auth-aside {
        display: none;
    }

    .auth-card {
        padding: clamp(24px, 5vw, 40px);
    }
}

@media (max-width: 620px) {
    .auth-shell {
        padding-top: 0;
    }

    .form-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .avatar-upload {
        align-items: flex-start;
    }

    .avatar-upload__preview .avatar--xl {
        width: 74px;
        height: 74px;
    }
}

@media (max-width: 400px) {
    .avatar-upload {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-aside__car,
    .auth-aside__dash {
        animation: none;
    }
}
