/* =============================================================================
   AUTH PAGE — aligned to OneFill design system
   Tokens: #003231 brand-dark, #F1F5F9 muted, #4A90A4 accent, slate palette.
   No shadows, no borders, no hover translates.
   ============================================================================= */

.auth-page {
    min-height: calc(100vh - 200px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(24px, 4vw, 56px) clamp(16px, 2.5vw, 32px);
}

/* === Two-column auth layout: slider + form === */
.auth-card-wrap {
    width: 100%;
    max-width: 940px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 16px;
    align-items: stretch;
}

.auth-form-side {
    background: #FFFFFF;
    padding: clamp(32px, 3.6vw, 44px) clamp(28px, 3vw, 40px);
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* === Слайдер справа — живой mesh-градиент с notch для стрелок === */
.auth-slider {
    --outer-r: 24px;

    position: relative;
    border-radius: var(--outer-r);
    min-height: 480px;
    display: flex;
    flex-direction: column;
    background: transparent;
    isolation: isolate;
}

/* Live mesh: layered radial base + 8 floating colored blobs (screen blend) */
.auth-slider-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
    border-radius: var(--outer-r);
    background:
        radial-gradient(ellipse 90% 60% at 15% 10%,  rgba(74, 144, 164, 0.32) 0%, transparent 55%),
        radial-gradient(ellipse 80% 70% at 85% 25%,  rgba(107, 163, 181, 0.28) 0%, transparent 55%),
        radial-gradient(ellipse 100% 80% at 90% 95%, rgba(45, 90, 102, 0.45)  0%, transparent 60%),
        radial-gradient(ellipse 110% 70% at 5% 100%, rgba(74, 144, 164, 0.28) 0%, transparent 55%),
        linear-gradient(135deg, #00211f 0%, #003231 50%, #002a2c 100%);
    animation: meshHue 22s ease-in-out infinite;
}

@keyframes meshHue {
    0%, 100% { filter: hue-rotate(0deg) saturate(0.95); }
    33%      { filter: hue-rotate(-8deg) saturate(1.05); }
    66%      { filter: hue-rotate(10deg) saturate(1); }
}

.mesh-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(56px);
    will-change: transform;
    mix-blend-mode: screen;
    opacity: 0.55;
}

.mesh-blob--1 {
    width: 70%; height: 70%; left: -15%; top: -18%;
    background: radial-gradient(circle, #4A90A4 0%, rgba(74, 144, 164, 0.25) 40%, transparent 70%);
    animation: meshFloat1 9s ease-in-out infinite alternate;
}
.mesh-blob--2 {
    width: 60%; height: 60%; right: -20%; top: -12%;
    background: radial-gradient(circle, #6BA3B5 0%, rgba(107, 163, 181, 0.22) 45%, transparent 70%);
    animation: meshFloat2 11s ease-in-out infinite alternate;
}
.mesh-blob--3 {
    width: 80%; height: 80%; left: 10%; bottom: -32%;
    background: radial-gradient(circle, #2D5A66 0%, rgba(45, 90, 102, 0.3) 45%, transparent 75%);
    animation: meshFloat3 13s ease-in-out infinite alternate;
    opacity: 0.7;
}
.mesh-blob--4 {
    width: 55%; height: 55%; right: 5%; bottom: -10%;
    background: radial-gradient(circle, #4A90A4 0%, rgba(74, 144, 164, 0.25) 40%, transparent 70%);
    animation: meshFloat4 10s ease-in-out infinite alternate;
}
.mesh-blob--5 {
    width: 42%; height: 42%; left: 35%; top: 18%;
    background: radial-gradient(circle, #6BA3B5 0%, rgba(107, 163, 181, 0.22) 40%, transparent 75%);
    animation: meshFloat5 7s ease-in-out infinite alternate;
    opacity: 0.45;
}
.mesh-blob--6 {
    width: 52%; height: 52%; left: -10%; top: 32%;
    background: radial-gradient(circle, #4A90A4 0%, rgba(74, 144, 164, 0.22) 45%, transparent 70%);
    animation: meshFloat6 12s ease-in-out infinite alternate;
}
.mesh-blob--7 {
    width: 38%; height: 38%; right: 15%; top: 42%;
    background: radial-gradient(circle, #88B8C8 0%, rgba(136, 184, 200, 0.18) 45%, transparent 75%);
    animation: meshFloat7 14s ease-in-out infinite alternate;
    opacity: 0.4;
}
.mesh-blob--8 {
    width: 34%; height: 34%; left: 52%; top: 8%;
    background: radial-gradient(circle, #88B8C8 0%, rgba(136, 184, 200, 0.2) 45%, transparent 80%);
    animation: meshFloat8 6s ease-in-out infinite alternate;
    opacity: 0.45;
}

@keyframes meshFloat1 {
    0%   { transform: translate(0, 0) scale(1); }
    50%  { transform: translate(50%, 40%) scale(1.3); }
    100% { transform: translate(75%, -25%) scale(0.8); }
}
@keyframes meshFloat2 {
    0%   { transform: translate(0, 0) scale(1); }
    50%  { transform: translate(-60%, 60%) scale(1.25); }
    100% { transform: translate(-30%, 80%) scale(0.75); }
}
@keyframes meshFloat3 {
    0%   { transform: translate(0, 0) scale(1); }
    50%  { transform: translate(-50%, -40%) scale(1.35); }
    100% { transform: translate(40%, -65%) scale(0.85); }
}
@keyframes meshFloat4 {
    0%   { transform: translate(0, 0) scale(1); }
    50%  { transform: translate(40%, -65%) scale(0.8); }
    100% { transform: translate(-50%, -25%) scale(1.4); }
}
@keyframes meshFloat5 {
    0%   { transform: translate(0, 0) scale(1); }
    25%  { transform: translate(80%, -35%) scale(1.5); }
    50%  { transform: translate(-65%, 50%) scale(0.65); }
    75%  { transform: translate(35%, -55%) scale(1.2); }
    100% { transform: translate(50%, 70%) scale(1.1); }
}
@keyframes meshFloat6 {
    0%   { transform: translate(0, 0) scale(1); }
    50%  { transform: translate(60%, -50%) scale(1.3); }
    100% { transform: translate(85%, 35%) scale(0.85); }
}
@keyframes meshFloat7 {
    0%   { transform: translate(0, 0) scale(1); }
    33%  { transform: translate(-60%, -35%) scale(1.4); }
    66%  { transform: translate(60%, -60%) scale(0.8); }
    100% { transform: translate(-35%, 60%) scale(1.2); }
}
@keyframes meshFloat8 {
    0%   { transform: translate(0, 0) scale(1); }
    50%  { transform: translate(-45%, 70%) scale(1.6); }
    100% { transform: translate(55%, 90%) scale(0.6); }
}

/* === Slides container — wraps slides, sits above mesh-bg === */
.auth-slides {
    position: relative;
    flex: 1;
    min-height: 0;
    z-index: 1;
}

/* === Slides: контент прижат к bottom-left, фон не меняется === */
.auth-slide {
    position: absolute;
    inset: 0;
    padding: clamp(24px, 2.6vw, 36px);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
    gap: 12px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0s linear 0.5s;
    color: #FFFFFF;
}

.auth-slide.active {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.5s ease, visibility 0s linear 0s;
}

.auth-slide-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.auth-slide-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 11px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 999px;
    font-size: 10px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.95);
    letter-spacing: -0.005em;
}

.auth-slide-quote {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.55;
    letter-spacing: -0.005em;
    color: #FFFFFF;
    margin: 0;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    padding: 14px 16px;
    border-radius: 14px;
    align-self: flex-start;
    max-width: 100%;
}

.auth-slide-author {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-left: 16px;
}

.auth-slide-author-name {
    font-size: 13px;
    font-weight: 700;
    color: #FFFFFF;
    letter-spacing: -0.01em;
}

.auth-slide-author-role {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.72);
    font-weight: 500;
}

/* === Navigation arrows — inside slider, aligned with .auth-slide-author === */
.auth-slider-nav {
    position: absolute;
    bottom: clamp(24px, 2.6vw, 36px);
    right: clamp(24px, 2.6vw, 36px);
    display: flex;
    gap: 6px;
    align-items: center;
    z-index: 10;
}

.auth-slider-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.18s ease, color 0.18s ease, transform 0.15s ease;
    font-family: inherit;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.auth-slider-btn svg {
    width: 20px;
    height: 20px;
}

.auth-slider-btn:hover {
    background: rgba(255, 255, 255, 0.22);
    color: #FFFFFF;
}

.auth-slider-btn svg {
    width: 22px;
    height: 22px;
}

.auth-slider-btn:active {
    transform: scale(0.94);
}

.auth-slider-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* === Tablet: hide slider, single-column form === */
@media (max-width: 860px) {
    .auth-card-wrap {
        grid-template-columns: 1fr;
        max-width: 460px;
    }
    .auth-slider {
        display: none;
    }
}

.auth-header {
    text-align: center;
    margin-bottom: 24px;
}

.auth-header h1 {
    font-size: clamp(22px, 2.4vw, 28px);
    font-weight: 700;
    color: #0F172A;
    margin: 0;
    letter-spacing: -0.025em;
    line-height: 1.15;
}

.auth-subtitle {
    font-size: 14px;
    color: #64748B;
    margin: 8px 0 0;
    line-height: 1.5;
}

.auth-subtitle strong {
    color: #0F172A;
    font-weight: 600;
}

.auth-card {
    background: transparent;
    padding: 0;
}

.auth-step {
    display: none;
}

.auth-step.active {
    display: block;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #94A3B8;
    padding-left: 4px;
}

/* === Form input — DS .ds-input === */
.auth-form-side .form-input,
.form-input {
    width: 100%;
    padding: 14px 16px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 500;
    color: #0F172A;
    background: #F1F5F9;
    transition: background 0.18s ease;
    box-sizing: border-box;
    font-family: inherit;
    line-height: 1.3;
    letter-spacing: -0.005em;
    caret-color: #2D5A66;
    outline: none;
}

.auth-form-side .form-input:hover,
.form-input:hover {
    background: #E8EDF3;
}

.auth-form-side .form-input:focus,
.form-input:focus {
    background: #E2E8F0;
}

.auth-form-side .form-input::placeholder,
.form-input::placeholder {
    color: #94A3B8;
    font-weight: 400;
    letter-spacing: 0;
}

/* === Code input (OTP) === */
.code-input {
    padding: 22px 18px;
    font-size: 28px;
    font-weight: 700;
    text-align: center;
    letter-spacing: 10px;
    border-radius: 14px;
    color: #0F172A;
}

.code-input::placeholder {
    letter-spacing: 10px;
    font-weight: 400;
    color: #CBD5E1;
}

/* === Primary submit button (matches .btn-hero) === */
.submit-btn {
    width: 100%;
    padding: 14px 20px;
    background: #0F172A;
    color: #FFFFFF;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s ease;
    font-family: inherit;
    letter-spacing: -0.005em;
}

.submit-btn:hover:not(:disabled) {
    background: #1E293B;
}

.submit-btn:disabled {
    background: #E2E8F0;
    color: #94A3B8;
    cursor: not-allowed;
}

.form-hint {
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
    margin: 12px 0 0;
    line-height: 1.5;
}

.form-hint a {
    color: #94A3B8;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.form-hint a:hover {
    color: #0F172A;
}

/* === Divider "или" === */
.divider {
    display: flex;
    align-items: center;
    margin: 18px 0;
    color: #94A3B8;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(15, 23, 42, 0.08);
}

.divider span {
    padding: 0 14px;
    font-size: 12px;
    color: #94A3B8;
}

/* === OAuth buttons — flat, no borders, no shadows === */
.oauth-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.oauth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 13px 18px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.15s ease;
    background: #F1F5F9;
    color: #0F172A;
    box-sizing: border-box;
    letter-spacing: -0.005em;
    font-family: inherit;
}

.oauth-btn:hover {
    background: #E2E8F0;
    color: #0F172A;
    text-decoration: none;
}

.oauth-icon-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.oauth-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
    position: relative;
    z-index: 1;
}

.oauth-icon-easter {
    position: absolute;
    top: 50%;
    left: -50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border-radius: 0;
    object-fit: contain;
    pointer-events: none;
    z-index: 0;
}

/* === Back / Resend secondary actions === */
.back-section {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid rgba(15, 23, 42, 0.06);
}

.back-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 100%;
    padding: 8px;
    background: none;
    border: none;
    color: #4A90A4;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.15s ease;
    font-family: inherit;
}

.back-btn:hover {
    color: #2D5A66;
}

.resend-section {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid rgba(15, 23, 42, 0.06);
}

.resend-section span {
    font-size: 12px;
    color: #94A3B8;
}

.resend-btn {
    background: none;
    border: none;
    color: #4A90A4;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    font-family: inherit;
    text-decoration: none;
}

.resend-btn:hover {
    color: #2D5A66;
}

.resend-btn:disabled {
    color: #94A3B8;
    cursor: not-allowed;
}

.resend-timer {
    font-size: 12px;
    color: #94A3B8;
}

/* === Alerts (DS tokens) === */
.alert {
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 14px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.45;
    border: none;
}

.alert-error {
    background: #F6EAEA;
    color: #9C2727;
}

.alert-success {
    background: #EBF5EE;
    color: #1B6E3D;
}

.hidden {
    display: none !important;
}

/* === Mobile === */
@media (max-width: 480px) {
    .auth-page {
        padding: 16px 12px;
    }

    .auth-form-side {
        padding: 24px 22px;
    }

    .auth-header h1 {
        font-size: 20px;
    }

    .auth-form-side .form-input,
.form-input {
        padding: 12px 14px;
        font-size: 14px;
    }

    .code-input {
        padding: 18px;
        font-size: 22px;
        letter-spacing: 8px;
    }

    .code-input::placeholder {
        letter-spacing: 8px;
    }

    .submit-btn {
        padding: 13px 18px;
        font-size: 14px;
    }
}
