:root {
    --main-purple: #9c4dff;
    --landing-orange: #ff9900;
    --bg-page: #121212;
    --bg-card: #232323;
    --border-input: #898989;
}

* {
    font-family: 'Inter', sans-serif;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    overflow-x: hidden;
    background-color: var(--bg-page);
    color: #fff;
    line-height: 1.5;
    min-height: 100vh;
}

body.landing-page {
    min-height: 100vh;
}

.landing {
    position: relative;
    min-height: 100vh;
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 20px 40px;
}

.landing-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.landing-bg-layer {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.22;
}

.landing-bg .blob-a {
    left: -15%;
    top: -20%;
    width: 70%;
    height: 65%;
    background: radial-gradient(circle at 40% 40%, rgba(156, 77, 255, 0.45), transparent 62%);
}

.landing-bg .blob-b {
    right: -10%;
    top: 25%;
    width: 55%;
    height: 55%;
    opacity: 0.18;
    background: radial-gradient(circle at 60% 50%, rgba(255, 153, 0, 0.35), transparent 60%);
}

.landing-inner {
    position: relative;
    z-index: 1;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 10px 0 14px;
    border-bottom: 1px solid #fff;
}

.header .logo img {
    height: 52px;
    width: auto;
    display: block;
}

.link-login-header {
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
}

.link-login-header:hover {
    color: var(--main-purple);
}

.landing-main {
    display: grid;
    grid-template-columns: 1fr minmax(280px, 720px);
    gap: 40px;
    align-items: center;
    padding-top: 40px;
}

.hero-title {
    font-size: 34px;
    font-weight: 800;
    line-height: 1.12;
    margin-bottom: 14px;
    max-width: 520px;
}

.hero-title .accent {
    color: var(--landing-orange);
}

.hero-lead {
    font-size: 16px;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.88);
    max-width: 520px;
    margin-bottom: 24px;
}

.benefits {
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-width: 540px;
}

.benefit-row {
    display: grid;
    grid-template-columns: 32px 1fr;
    gap: 12px;
    align-items: center;
}

.benefit-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.benefit-icon img {
    width: 24px;
    height: 24px;
    max-width: 24px;
    max-height: 24px;
    object-fit: contain;
    display: block;
}

.benefit-text {
    font-size: 14px;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.92);
}

.benefit-text .hl {
    color: var(--main-purple);
    font-weight: 600;
}

/* Коллаж не привязан к высоте карточки: у стейджа свой min-height */
.auth-stage {
    position: relative;
    width: 100%;
    max-width: 720px;
    margin-left: auto;
    /* Не ниже блока регистрации — при «Войти» карточка ниже, аватарки на месте */
    min-height: 580px;
}

.auth-column {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
}

.avatar-layer {
    position: absolute;
    z-index: 1;
    top: -20px;
    left: -100px;
    right: -100px;
    bottom: -28px;
    pointer-events: none;
}

.avatar-cluster {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 46%;
    max-width: 260px;
}

.avatar-cluster--left {
    left: 0;
}

.avatar-cluster--right {
    right: 0;
}

.stream-bubble {
    position: absolute;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.42);
    transform: translate(-50%, -50%);
}

.stream-bubble img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.stream-bubble--xs {
    width: 40px;
    height: 40px;
}

.stream-bubble--sm {
    width: 52px;
    height: 52px;
}

.stream-bubble--md {
    width: 68px;
    height: 68px;
}

.stream-bubble--lg {
    width: 88px;
    height: 88px;
}

.stream-bubble--xl {
    width: 108px;
    height: 108px;
}

.stream-bubble--ll1 {
    left: 72%;
    top: 12%;
}

.stream-bubble--ll2 {
    left: 38%;
    top: 28%;
}

.stream-bubble--ll3 {
    left: 18%;
    top: 44%;
}

.stream-bubble--ll4 {
    left: 88%;
    top: 38%;
}

.stream-bubble--ll5 {
    left: 48%;
    top: 58%;
}

.stream-bubble--ll6 {
    left: 82%;
    top: 72%;
}

.stream-bubble--ll7 {
    left: 22%;
    top: 78%;
}

.stream-bubble--ll8 {
    left: 58%;
    top: 88%;
}

.stream-bubble--lr1 {
    left: 28%;
    top: 10%;
}

.stream-bubble--lr2 {
    left: 62%;
    top: 22%;
}

.stream-bubble--lr3 {
    left: 18%;
    top: 42%;
}

.stream-bubble--lr4 {
    left: 72%;
    top: 48%;
}

.stream-bubble--lr5 {
    left: 45%;
    top: 8%;
}

.stream-bubble--lr6 {
    left: 38%;
    top: 68%;
}

.stream-bubble--lr7 {
    left: 78%;
    top: 76%;
}

.stream-bubble--lr8 {
    left: 22%;
    top: 86%;
}

.stream-bubble--ll3 img,
.stream-bubble--lr4 img {
    transform: scaleX(-1);
}

.auth-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 22px 24px 24px;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
}

.auth-panel[data-panel='login'],
.auth-panel[data-panel='verify'] {
    display: none;
}

.auth-card.mode-login .auth-panel[data-panel='register'],
.auth-card.mode-login .auth-panel[data-panel='verify'] {
    display: none;
}

.auth-card.mode-login .auth-panel[data-panel='login'] {
    display: block;
}

.auth-card.mode-verify .auth-panel[data-panel='register'],
.auth-card.mode-verify .auth-panel[data-panel='login'] {
    display: none;
}

.auth-card.mode-verify .auth-panel[data-panel='verify'] {
    display: block;
}

.auth-tabs {
    display: flex;
    background: #000;
    border-radius: 8px;
    padding: 4px;
    margin-bottom: 16px;
}

.auth-tab {
    flex: 1;
    text-align: center;
    padding: 10px 12px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    background: transparent;
    color: var(--border-input);
    font-family: inherit;
}

.auth-tab.active {
    background: var(--main-purple);
    color: #fff;
}

.auth-heading {
    font-size: 19px;
    font-weight: 700;
    margin-bottom: 6px;
}

.auth-sub {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 18px;
    line-height: 1.45;
}

.auth-form .field,
.auth-form .form-field {
    margin-bottom: 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.auth-form label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.01em;
    color: rgba(255, 255, 255, 0.78);
    margin-bottom: 0;
}

.auth-form input[type='text'],
.auth-form input[type='email'],
.auth-form input[type='password'] {
    width: 100%;
    padding: 12px 14px;
    font-size: 15px;
    line-height: 1.2;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-family: inherit;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.auth-form input[type='text']:hover,
.auth-form input[type='email']:hover,
.auth-form input[type='password']:hover {
    border-color: rgba(255, 255, 255, 0.22);
}

.auth-form input[type='text']:focus,
.auth-form input[type='email']:focus,
.auth-form input[type='password']:focus {
    outline: none;
    border-color: var(--main-purple);
    background: #000;
    box-shadow: 0 0 0 3px rgba(156, 77, 255, 0.22);
}

.auth-form input::placeholder {
    color: #666;
}

.auth-form input:-webkit-autofill,
.auth-form input:-webkit-autofill:focus {
    -webkit-text-fill-color: #fff;
    -webkit-box-shadow: 0 0 0 1000px #0a0a0a inset;
    caret-color: #fff;
}

/* Role selector — сегментированный выбор роли */
.role-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 18px;
}

.role-selector label {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 8px;
    padding: 12px 10px;
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.78);
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    cursor: pointer;
    user-select: none;
    transition: border-color 0.18s ease, background-color 0.18s ease, color 0.18s ease, transform 0.05s ease;
}

.role-selector label:hover {
    border-color: rgba(156, 77, 255, 0.55);
    color: #fff;
}

.role-selector label:active {
    transform: translateY(1px);
}

.role-selector input[type='radio'] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

.role-selector label::before {
    content: '';
    flex: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.35);
    background: transparent;
    transition: border-color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
}

.role-selector label:has(input[type='radio']:checked) {
    color: #fff;
    background: linear-gradient(135deg, rgba(156, 77, 255, 0.22), rgba(156, 77, 255, 0.08));
    border-color: var(--main-purple);
    box-shadow: 0 0 0 3px rgba(156, 77, 255, 0.18), 0 6px 18px rgba(156, 77, 255, 0.18);
}

.role-selector label:has(input[type='radio']:checked)::before {
    border-color: var(--main-purple);
    background: radial-gradient(circle, var(--main-purple) 0 38%, transparent 42%);
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.4) inset;
}

.role-selector label:has(input[type='radio']:focus-visible) {
    box-shadow: 0 0 0 3px rgba(255, 153, 0, 0.45);
}

/* Submit button — общий стиль для обеих форм */
.auth-form button[type='submit'],
.auth-form .btn-submit {
    width: 100%;
    margin-top: 10px;
    padding: 13px 16px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.01em;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--main-purple), #7a31d8);
    color: #fff;
    cursor: pointer;
    font-family: inherit;
    box-shadow: 0 8px 22px rgba(156, 77, 255, 0.28);
    transition: transform 0.08s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.auth-form button[type='submit']:hover,
.auth-form .btn-submit:hover {
    filter: brightness(1.08);
    box-shadow: 0 10px 26px rgba(156, 77, 255, 0.38);
}

.auth-form button[type='submit']:active,
.auth-form .btn-submit:active {
    transform: translateY(1px);
    box-shadow: 0 6px 16px rgba(156, 77, 255, 0.28);
}

.auth-form button[type='submit']:focus-visible,
.auth-form .btn-submit:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 153, 0, 0.5), 0 8px 22px rgba(156, 77, 255, 0.28);
}

.auth-form button[type='submit']:disabled,
.auth-form .btn-submit:disabled {
    cursor: not-allowed;
    filter: grayscale(0.3) brightness(0.85);
    box-shadow: none;
}

/* Сообщение об ошибке формы */
.form-error {
    margin-top: 12px;
    padding: 10px 12px 10px 36px;
    position: relative;
    font-size: 13px;
    line-height: 1.4;
    color: #ff8a8a;
    background: rgba(255, 64, 64, 0.08);
    border: 1px solid rgba(255, 64, 64, 0.35);
    border-radius: 8px;
    animation: form-error-pop 0.22s ease-out;
}

.form-error::before {
    content: '!';
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 12px;
    color: #fff;
    background: #ff4d4d;
    border-radius: 50%;
}

@keyframes form-error-pop {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

body.landing-page.is-page-exit .landing,
body.landing-page.is-page-exit .landing-bg {
    opacity: 0;
    transition: opacity 0.3s ease;
}

body.landing-page.is-page-exit {
    pointer-events: none;
}

/* ПК: без вертикального скролла, плашка не шире ~половины экрана */
@media (min-width: 961px) {
    body.landing-page {
        overflow-y: hidden;
        height: 100vh;
    }

    .landing-page .landing {
        height: 100vh;
        max-height: 100vh;
        display: flex;
        flex-direction: column;
        padding-bottom: 12px;
        box-sizing: border-box;
    }

    .landing-page .header {
        flex-shrink: 0;
        padding: 6px 0 10px;
    }

    .landing-page .header .logo img {
        height: 50px;
    }

    .landing-page .landing-main {
        flex: 1;
        min-height: 0;
        align-items: center;
        align-content: center;
        padding-top: 12px;
        gap: 24px;
    }

    .landing-page .hero-title {
        font-size: 46px;
        margin-bottom: 10px;
    }

    .landing-page .hero-lead {
        font-size: 15px;
        margin-bottom: 14px;
    }

    .landing-page .benefits {
        gap: 10px;
    }

    .landing-page .auth-column {
        max-width: min(520px, calc(50vw - 40px));
    }

    .landing-page .auth-stage {
        align-self: stretch;
        min-height: 580px;
    }

    .landing-page .stream-bubble--xs {
        width: 36px;
        height: 36px;
    }

    .landing-page .stream-bubble--sm {
        width: 46px;
        height: 46px;
    }

    .landing-page .stream-bubble--md {
        width: 58px;
        height: 58px;
    }

    .landing-page .stream-bubble--lg {
        width: 74px;
        height: 74px;
    }

    .landing-page .stream-bubble--xl {
        width: 90px;
        height: 90px;
    }
}

@media (min-width: 961px) and (max-height: 800px) {
    .landing-page .hero-title {
        font-size: 38px;
    }

    .landing-page .benefits {
        gap: 8px;
    }

    .landing-page .auth-form .field {
        margin-bottom: 10px;
    }

    .landing-page .auth-card {
        padding: 16px 20px 18px;
    }
}

@media (max-width: 1100px) {
    .landing-main {
        grid-template-columns: 1fr minmax(260px, 480px);
        gap: 28px;
    }
}

@media (max-width: 960px) {
    .landing-main {
        grid-template-columns: 1fr;
        padding-top: 28px;
    }

    .hero-title,
    .hero-lead,
    .benefits {
        max-width: none;
    }

    .hero-title {
        font-size: 30px;
    }

    .auth-stage {
        margin-right: auto;
        min-height: 480px;
    }

    .auth-column {
        max-width: 480px;
    }

    body.landing-page {
        overflow-y: auto;
        height: auto;
    }

    .landing-page .landing {
        height: auto;
        max-height: none;
        display: block;
    }

    .avatar-layer {
        left: -70px;
        right: -70px;
        transform: scale(0.9);
        transform-origin: center top;
    }

    .avatar-cluster {
        max-width: 220px;
    }
}

@media (max-width: 720px) {
    .avatar-layer {
        transform: scale(0.82);
        opacity: 0.92;
    }
}

@media (max-width: 540px) {
    .avatar-layer {
        display: none;
    }

    .auth-stage {
        min-height: 0;
        max-width: 100%;
    }

    .auth-column {
        max-width: none;
    }

    .landing {
        padding-left: 16px;
        padding-right: 16px;
    }

    .hero-title {
        font-size: 26px;
    }
}

@media (max-width: 380px) {
    .auth-tabs {
        flex-wrap: wrap;
    }
}


/* Убираем все пузырьки-аватарки */
.avatar-layer {
    display: none;
}
