/* Страницы входа, регистрации, восстановления и смены пароля.
   Слева — яркая плитка (переливающийся градиент, всплывающие реакции,
   «тепловая карта» серии), справа — форма на цветных свечениях.
   Палитра на странице — через --c1/--c2/--c3 (классы .t-*). */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; overflow-x: hidden; }
body {
    background: #07030a;
    color: #fff;
    font-family: var(--font-base);
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; }

.auth {
    --ease: cubic-bezier(0.19, 1, 0.22, 1);
    --line: rgba(255, 255, 255, 0.1);
    --c1: #d82d7e;
    --c2: #7a2cff;
    --c3: #ff7a3d;
    position: relative;
    isolation: isolate;
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 16px;
    padding: 16px;
    overflow: hidden;
}
.t-login    { --c1: #d82d7e; --c2: #7a2cff; --c3: #ff7a3d; }
.t-register { --c1: #7a2cff; --c2: #ff3d8b; --c3: #ffb03d; }
.t-recover  { --c1: #2b7bff; --c2: #d82d7e; --c3: #22d3c5; }

/* цветные свечения за формой */
.auth::before, .auth::after {
    content: '';
    position: absolute;
    z-index: -1;
    width: 60vmax;
    height: 60vmax;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.35;
    pointer-events: none;
}
.auth::before { right: -20vmax; top: -25vmax; background: var(--c2); animation: auth-drift 18s ease-in-out infinite alternate; }
.auth::after { right: 5vmax; bottom: -35vmax; background: var(--c1); animation: auth-drift 22s ease-in-out infinite alternate-reverse; }

/* ===== Яркая плитка ===== */
.auth-art {
    position: relative;
    isolation: isolate;
    border-radius: 28px;
    overflow: hidden;
    min-height: 560px;
    background: linear-gradient(140deg, var(--c1) 0%, var(--c2) 55%, var(--c3) 100%);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 28px;
    animation: auth-in 0.9s var(--ease) both;
}
.auth-blobs { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.auth-blobs i {
    position: absolute;
    width: 70%;
    aspect-ratio: 1;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.85;
}
.auth-blobs i:nth-child(1) { left: -20%; top: -15%; background: var(--c3); animation: auth-drift 14s ease-in-out infinite alternate; }
.auth-blobs i:nth-child(2) { right: -25%; top: 20%; background: var(--c1); animation: auth-drift 17s ease-in-out infinite alternate-reverse; }
.auth-blobs i:nth-child(3) { left: 10%; bottom: -30%; background: var(--c2); animation: auth-drift 20s ease-in-out infinite alternate; }
/* лёгкая «плёночная» сетка поверх, чтобы градиент не был пластиковым */
.auth-art::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image: radial-gradient(rgba(255, 255, 255, 0.18) 1px, transparent 1px);
    background-size: 22px 22px;
    -webkit-mask: linear-gradient(180deg, #000, transparent 70%);
    mask: linear-gradient(180deg, #000, transparent 70%);
    pointer-events: none;
}

/* всплывающие реакции */
.auth-float { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.auth-float span {
    position: absolute;
    bottom: -60px;
    left: var(--x);
    font-size: var(--s, 34px);
    filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.25));
    opacity: 0;
    animation: auth-rise var(--d, 9s) linear var(--w, 0s) infinite;
}

/* «тепловая карта» серии с плейхедом */
.auth-heat {
    position: relative;
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 70px;
    margin-top: 22px;
    padding: 0 2px;
}
.auth-heat i {
    flex: 1;
    height: var(--h);
    border-radius: 4px 4px 2px 2px;
    background: rgba(255, 255, 255, 0.85);
    transform-origin: bottom;
    animation: auth-bar 2.4s ease-in-out var(--w, 0s) infinite alternate;
}
.auth-head { position: absolute; inset: -8px 0; animation: auth-play 9s linear infinite; pointer-events: none; }
.auth-head::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: #fff; box-shadow: 0 0 12px #fff; }
.auth-track { height: 4px; margin-top: 8px; border-radius: 2px; background: rgba(255, 255, 255, 0.3); overflow: hidden; }
.auth-track::before { content: ''; display: block; height: 100%; background: #fff; transform-origin: left; animation: auth-fill 9s linear infinite; }
.auth-time { display: flex; justify-content: space-between; margin-top: 8px; font-family: var(--font-mono); font-size: 12px; color: rgba(255, 255, 255, 0.8); }

.auth-logo {
    align-self: flex-start;
    display: flex;
    align-items: center;
    height: 50px;
    padding: 0 20px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.22);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    backdrop-filter: blur(16px) saturate(140%);
    border: 1px solid rgba(255, 255, 255, 0.25);
    transition: background 0.2s ease;
}
.auth-logo:hover { background: rgba(0, 0, 0, 0.35); }
.auth-logo img { width: 120px; height: auto; display: block; }

.auth-pitch h2 {
    margin: 0 0 12px;
    font-family: var(--font-secondary);
    font-weight: 800;
    font-size: clamp(32px, 3.4vw, 52px);
    line-height: 0.98;
    letter-spacing: -0.02em;
}
.auth-pitch h2 em { font-style: normal; color: transparent; -webkit-text-stroke: 1.5px #fff; }
.auth-pitch p { margin: 0; max-width: 380px; color: rgba(255, 255, 255, 0.9); font-size: 16px; line-height: 1.5; }

/* плавающие реакции на таймкоде — фирменный мотив */
.auth-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.auth-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 34px;
    padding: 0 14px 0 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    font-size: 13px;
    color: #fff;
    animation: auth-float 6s ease-in-out infinite;
}
.auth-chip:nth-child(2) { animation-delay: -2s; }
.auth-chip:nth-child(3) { animation-delay: -4s; }
.auth-chip b { font-family: var(--font-mono); font-weight: 500; color: #fff; }

/* ===== Форма ===== */
.auth-side {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 24px 16px;
}
.auth-back {
    align-self: flex-end;
    margin-bottom: auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 38px;
    padding: 0 16px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    font-family: var(--font-secondary);
    font-weight: 600;
    font-size: 13px;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.75);
    transition: background 0.2s ease, color 0.2s ease;
}
.auth-back:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }

.auth-card {
    width: 100%;
    max-width: 420px;
    margin-bottom: auto;
    padding-top: 24px;
    animation: auth-in 0.8s var(--ease) 0.08s both;
}
.auth-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    font-size: 12px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
}
.auth-kicker::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: conic-gradient(var(--c1), var(--c3), var(--c2), var(--c1));
    box-shadow: 0 0 10px var(--c1);
}
.auth-title {
    margin: 0 0 8px;
    background: linear-gradient(100deg, #fff 40%, color-mix(in srgb, var(--c1) 55%, #fff));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-family: var(--font-secondary);
    font-weight: 800;
    font-size: clamp(30px, 3vw, 40px);
    letter-spacing: -0.02em;
    line-height: 1.05;
}
.auth-sub { margin: 0 0 28px; color: rgba(255, 255, 255, 0.6); font-size: 15px; line-height: 1.5; }

.alert {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 12px 14px;
    margin-bottom: 18px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.45;
    animation: auth-in 0.5s var(--ease) both;
}
.alert::before { flex-shrink: 0; font-size: 15px; line-height: 1.3; }
.alert-error { background: rgba(255, 68, 68, 0.1); border: 1px solid rgba(255, 68, 68, 0.35); color: #ffb3b3; }
.alert-error::before { content: '⚠'; }
.alert-success { background: rgba(70, 200, 120, 0.1); border: 1px solid rgba(70, 200, 120, 0.35); color: #b6f0cb; }
.alert-success::before { content: '✓'; }

.form { display: flex; flex-direction: column; gap: 14px; margin: 0; }

/* поле с плавающей подписью: placeholder=" " нужен для :placeholder-shown */
.field { position: relative; }
.field input {
    width: 100%;
    height: 58px;
    padding: 22px 16px 6px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.06);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    color: #fff;
    font-family: var(--font-base);
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.field input:hover { background: rgba(255, 255, 255, 0.06); }
.field input:focus {
    border-color: rgba(216, 45, 126, 0.7);
    background: rgba(216, 45, 126, 0.06);
    box-shadow: 0 0 0 4px rgba(216, 45, 126, 0.15);
}
.field label {
    position: absolute;
    left: 17px;
    top: 19px;
    font-size: 16px;
    color: rgba(255, 255, 255, 0.5);
    pointer-events: none;
    transform-origin: left top;
    transition: transform 0.25s var(--ease), color 0.2s ease;
}
.field input:focus + label,
.field input:not(:placeholder-shown) + label { transform: translateY(-11px) scale(0.75); }
.field input:focus + label { color: #ff8ac4; }
.field input:-webkit-autofill {
    -webkit-text-fill-color: #fff;
    -webkit-box-shadow: 0 0 0 100px #1a0c13 inset;
    caret-color: #fff;
}
.field-hint { margin: 6px 4px 0; font-size: 12px; color: rgba(255, 255, 255, 0.45); line-height: 1.4; }
.field-row { display: flex; justify-content: flex-end; margin-top: -4px; }
.link-muted { font-size: 13px; color: rgba(255, 255, 255, 0.6); text-decoration: none; transition: color 0.2s ease; }
.link-muted:hover { color: #fff; }

/* показать/скрыть пароль */
.field-eye {
    position: absolute;
    right: 8px;
    top: 9px;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease, background 0.2s ease;
}
.field-eye:hover { color: #fff; background: rgba(255, 255, 255, 0.06); }
.field-eye svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.field-eye .eye-off, .field-eye.on .eye-on { display: none; }
.field-eye.on .eye-off { display: block; }
.field-pass input { padding-right: 56px; }

/* согласия */
.check { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; font-size: 13px; line-height: 1.45; color: rgba(255, 255, 255, 0.7); }
.check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check-box {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin-top: 1px;
    border-radius: 6px;
    border: 1.5px solid rgba(255, 255, 255, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.check-box svg { width: 12px; height: 12px; fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; opacity: 0; transform: scale(0.5); transition: opacity 0.15s ease, transform 0.3s var(--ease); }
.check input:checked + .check-box { background: var(--color-accent); border-color: var(--color-accent); }
.check input:checked + .check-box svg { opacity: 1; transform: none; }
.check input:focus-visible + .check-box { box-shadow: 0 0 0 4px rgba(216, 45, 126, 0.25); }
.check a { color: #ff8ac4; text-decoration: none; }
.check a:hover { text-decoration: underline; }

.btn-auth {
    position: relative;
    height: 56px;
    margin-top: 6px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(110deg, var(--c1), var(--c2) 60%, var(--c3));
    background-size: 160% 100%;
    color: #fff;
    font-family: var(--font-secondary);
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(216, 45, 126, 0.35);
    transition: transform 0.2s ease, box-shadow 0.3s ease, background-position 0.6s ease;
}
.btn-auth::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.25) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform 0.8s var(--ease);
}
.btn-auth:hover { background-position: 100% 0; transform: translateY(-1px); box-shadow: 0 14px 36px rgba(216, 45, 126, 0.5); }
.btn-auth:hover::after { transform: translateX(100%); }
.btn-auth:active { transform: scale(0.98); }

.auth-alt { margin-top: 22px; text-align: center; font-size: 14px; color: rgba(255, 255, 255, 0.55); }
.auth-alt a { color: #fff; font-weight: 500; text-decoration: none; border-bottom: 1px solid rgba(216, 45, 126, 0.7); padding-bottom: 1px; transition: color 0.2s ease; }
.auth-alt a:hover { color: #ff8ac4; }

@keyframes auth-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes auth-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes auth-drift { from { transform: translate(0, 0) scale(1); } to { transform: translate(8%, 10%) scale(1.15); } }
@keyframes auth-rise {
    0% { transform: translateY(0) rotate(-8deg) scale(0.8); opacity: 0; }
    10% { opacity: 1; }
    80% { opacity: 1; }
    100% { transform: translateY(-120vh) rotate(10deg) scale(1.1); opacity: 0; }
}
@keyframes auth-bar { from { transform: scaleY(0.55); } to { transform: scaleY(1); } }
@keyframes auth-play { from { transform: translateX(0); } to { transform: translateX(100%); } }
@keyframes auth-fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ===== Планшет и телефон: арт — короткий баннер сверху ===== */
@media (max-width: 900px) {
    .auth { grid-template-columns: 1fr; gap: 0; padding: 10px; }
    .auth-art { min-height: 260px; border-radius: 22px; padding: 16px; }
    .auth-heat, .auth-track, .auth-time { display: none; }
    .auth-float span { --s: 24px !important; } .auth-float { opacity: 0.55; }
    .auth::before, .auth::after { opacity: 0.25; }
    .auth-pitch p, .auth-chips { display: none; }
    .auth-pitch h2 { font-size: 30px; }
    .auth-side { padding: 28px 8px 32px; }
    .auth-back { display: none; }
    .auth-card { padding-top: 0; }
}
@media (prefers-reduced-motion: reduce) {
    .auth-art, .auth-card, .auth-chip, .alert, .auth-blobs i, .auth-heat i, .auth-head, .auth-track::before, .auth::before, .auth::after { animation: none; }
    .auth-float { display: none; }
    .btn-auth::after { display: none; }
}
