/* ============================================
   Auth Styles - Платформа "osdan."
   Strict SaaS UI (Linear/Vercel inspired)
   ============================================ */

/* Opt-in to cross-document view transitions so navigating to/from auth pages
   doesn't throw AbortError: Transition was skipped */
@view-transition { navigation: auto; }

/* CSS Variables */
:root {
    /* Palette: Premium SaaS Dark */
    --color-primary: #fff;
    --color-accent: #3b82f6;
    --color-success: #10b981;
    --color-error: #ef4444;
    --color-warning: #f59e0b;
    --color-glow: rgba(59, 130, 246, 0.5);

    /* Backgrounds */
    --bg-page: #000;
    --bg-card: rgba(255, 255, 255, 0.03);
    --bg-input: rgba(255, 255, 255, 0.03);
    --bg-border: rgba(255, 255, 255, 0.08);

    /* Text */
    --text-primary: #fff;
    --text-secondary: rgba(255, 255, 255, 0.6);
    --text-muted: rgba(255, 255, 255, 0.3);

    /* Radii */
    --radius-lg: 24px;
    --radius-md: 12px;

    /* Transitions */
    --transition-premium: cubic-bezier(0.23, 1, 0.32, 1);
    --transition-fast: 150ms ease;

    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 0.75rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
}

/* Reset & Base */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-page);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    font-size: 0.875rem;
    /* 14px base size for that tight SaaS look */
}

/* Auth Container */
.auth-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
    overflow: hidden;
    background: #000;
}

/* Background Blobs (Dashboard Sync) */
.hero-bg-blobs {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: blob-pulse 10s infinite alternate cubic-bezier(0.45, 0, 0.55, 1);
}

@keyframes blob-pulse {
    from {
        transform: translate(0, 0) scale(1);
        opacity: 0.4;
    }

    to {
        transform: translate(20px, 20px) scale(1.1);
        opacity: 0.6;
    }
}

/* Auth Card (Glass Panel) */
.auth-card {
    width: 100%;
    max-width: 1000px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 32px;
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    box-shadow: 0 40px 100px -20px rgba(0, 0, 0, 0.8);
    position: relative;
    z-index: 1;
    animation: modal-pop 0.5s var(--transition-premium);
    display: grid;
    grid-template-columns: 1fr 1fr;
    overflow: hidden;
}

/* Стили левой колонки с иллюстрацией */
.auth-illustration-side {
    position: relative;
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    background: linear-gradient(180deg, rgba(0,0,0,0) 0%, hsla(var(--hero-hue, 271), 80%, 60%, 0.1) 100%);
    transition: background 1s ease;
}

.illustration-content {
    position: relative;
    z-index: 2;
    text-align: center;
    margin-bottom: 2rem;
}

.lumma-icon {
    width: 140px;
    height: 140px;
    margin: 0 auto 1.5rem auto;
    background-color: hsla(var(--hero-hue, 271), 80%, 60%, 1);
    -webkit-mask: url("/img/logo/darkthemeLogo.svg") no-repeat center / contain;
    mask: url("/img/logo/darkthemeLogo.svg") no-repeat center / contain;
    animation: float 6s ease-in-out infinite;
    transition: background-color 1s ease;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.illustration-content h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #fff 0%, rgba(255, 255, 255, 0.7) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.illustration-content p {
    color: var(--text-secondary);
    font-size: 1rem;
}

.illustration-glow {
    position: absolute;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, hsla(var(--hero-hue, 271), 80%, 60%, 0.4) 0%, rgba(0,0,0,0) 70%);
    filter: blur(40px);
    z-index: 1;
    transition: background 1s ease;
}

/* Правая колонка с формой */
.auth-form-side {
    padding: 3rem;
    background: rgba(0, 0, 0, 0.4);
}

@media (max-width: 900px) {
    .auth-card {
        grid-template-columns: 1fr;
        max-width: 500px;
    }
    .auth-illustration-side {
        display: none;
    }
}

@keyframes modal-pop {
    from {
        transform: scale(0.95);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-4px);
    }

    75% {
        transform: translateX(4px);
    }
}

.auth-card.shake {
    animation: shake 0.3s ease-in-out;
}

/* Logo */
.auth-logo {
    margin-bottom: var(--spacing-xl);
    text-align: center;
}

.auth-logo h1 {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    background: linear-gradient(135deg, #fff 0%, rgba(255, 255, 255, 0.5) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Header */
.auth-header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.auth-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

.auth-header a {
    color: var(--text-primary);
    text-decoration: underline;
    text-decoration-color: var(--border-active);
    text-underline-offset: 4px;
    transition: var(--transition-fast);
}

.auth-header a:hover {
    text-decoration-color: var(--text-primary);
    color: var(--text-primary);
}

/* Forms */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

/* Tabs for Email/Phone (Outline Style) */
.auth-method-tabs.segment-tabs {
    display: flex;
    gap: 0.5rem;
    background: transparent;
    border: none;
    padding: 0;
    margin-bottom: 0.5rem;
}

.auth-method-tabs.segment-tabs .method-tab {
    flex: 1;
    border-radius: 10px;
    border: 1px solid transparent;
    background: transparent;
    padding: 0.75rem 1.5rem;
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s var(--transition-premium);
    font-family: var(--font-sans);
}

.auth-method-tabs.segment-tabs .method-tab:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.auth-method-tabs.segment-tabs .method-tab.active {
    color: var(--text-primary);
    border-color: #ffffff;
    background: transparent;
}

.form-group label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

/* Input Wrapper */
.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper input {
    width: 100%;
    background: #0f0f0f !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #fff !important;
    font-size: 0.9375rem;
    font-family: var(--font-sans);
    padding: 0.875rem 1rem;
    padding-left: 3rem;
    transition: all 0.2s var(--transition-premium);
}

/* Fix browser autofill styling */
.input-wrapper input:-webkit-autofill,
.input-wrapper input:-webkit-autofill:hover,
.input-wrapper input:-webkit-autofill:focus {
    -webkit-text-fill-color: #fff !important;
    -webkit-box-shadow: 0 0 0px 1000px #0a0a0a inset !important;
    transition: background-color 5000s ease-in-out 0s;
    caret-color: white;
}

.input-wrapper input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.06) !important;
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.02);
}

.input-wrapper .icon {
    position: absolute;
    left: 1rem;
    color: rgba(255, 255, 255, 0.3);
    width: 20px;
    height: 20px;
    pointer-events: none;
    transition: color 0.2s;
    z-index: 2;
}

.input-wrapper input:focus+.icon {
    color: #fff;
}

/* Password Toggle */
.password-toggle {
    position: absolute;
    right: 0.5rem;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--transition-fast);
}

.password-toggle:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.forgot-password a {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-decoration: none;
}

.forgot-password a:hover {
    text-decoration: underline;
    color: var(--text-primary);
}

/* Checkbox */
.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.25rem 0;
}

.checkbox-group input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
    flex-shrink: 0;
}

.checkbox-group input[type="checkbox"]:checked {
    background: #fff;
    border-color: #fff;
}

.checkbox-group input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    color: #000;
    font-size: 12px;
    font-weight: 800;
}

.checkbox-group label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
    line-height: 1.4;
}

/* Neutral Links in Checkbox */
.neutral-link {
    color: var(--text-muted);
    text-decoration: underline;
    transition: color 0.2s;
}

.neutral-link:hover {
    color: var(--text-primary);
}

/* Buttons */
.btn-submit {
    width: 100%;
    padding: 1rem 2rem;
    background: #fff;
    color: #000;
    border: none;
    border-radius: 10px;
    font-size: 0.9375rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s var(--transition-premium);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 10px 30px rgba(255, 255, 255, 0.1);
    font-family: var(--font-sans);
}

.btn-submit:hover:not(:disabled) {
    background: #fff;
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(255, 255, 255, 0.2);
}

.btn-submit:active:not(:disabled) {
    transform: translateY(0);
}

.btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* OAuth Buttons */
.oauth-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: var(--spacing-xl);
}

.oauth-btn {
    width: 100%;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.875rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    color: #fff;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s var(--transition-premium);
}

.oauth-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.oauth-btn svg {
    width: 16px;
    height: 16px;
    opacity: 0.8;
}

.oauth-btn:hover svg {
    opacity: 1;
}

/* Divider */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: var(--spacing-lg) 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-subtle);
}

.auth-divider span {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Utilities */
.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.error-message {
    padding: 0.5rem;
    color: var(--color-error);
    font-size: 0.75rem;
    text-align: center;
    background: rgba(239, 68, 68, 0.1);
    border-radius: var(--radius-md);
    border: 1px solid rgba(239, 68, 68, 0.2);
    display: none;
    /* JS toggles this */
}

/* Password Strength & Validation (Legacy support if markup exists) */
.password-strength {
    height: 2px;
    background: var(--border-subtle);
    margin-top: 0.5rem;
    border-radius: 1px;
    overflow: hidden;
}

.password-strength-bar {
    height: 100%;
    transition: width 0.3s;
}

/* Password Tooltip Validation */
.password-validation {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    width: 100%;
    padding: 1rem;
    background: #111;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    z-index: 10;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-5px);
    transition: all 0.2s var(--transition-premium);
}

.input-wrapper:focus-within .password-validation.show-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Arrow for Tooltip */
.password-validation::after {
    content: '';
    position: absolute;
    top: -5px;
    left: 20px;
    width: 10px;
    height: 10px;
    background: #111;
    border-top: 1px solid rgba(255,255,255,0.1);
    border-left: 1px solid rgba(255,255,255,0.1);
    transform: rotate(45deg);
}

.password-validation ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.password-validation li {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 4px;
    transition: color 0.2s;
}

.password-validation li:last-child {
    margin-bottom: 0;
}

.password-validation li.valid {
    color: var(--text-primary);
}

.check-icon {
    width: 14px;
    height: 14px;
    border: 1px solid currentColor;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.password-validation li.valid .check-icon {
    background: var(--color-success);
    border-color: var(--color-success);
    color: black;
}

.password-validation li.valid .check-icon::after {
    content: '✓';
    font-size: 10px;
    font-weight: 800;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    font-size: 0.875rem;
    z-index: 100;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.visible {
    transform: translateY(0);
    opacity: 1;
}

/* Input Validation & Password Strength States */
.input-wrapper.error input {
    border-color: var(--color-error);
}
.input-wrapper.success input {
    border-color: var(--color-success);
}
.input-wrapper.weak input {
    border-color: var(--color-error);
}
.input-wrapper.fair input {
    border-color: var(--color-warning);
}
.input-wrapper.good input {
    border-color: var(--color-accent);
}
.input-wrapper.strong input {
    border-color: var(--color-success);
}

.password-strength-bar.weak { 
    width: 25%; 
    background: var(--color-error); 
}
.password-strength-bar.fair { 
    width: 50%; 
    background: var(--color-warning); 
}
.password-strength-bar.good { 
    width: 75%; 
    background: var(--color-accent); 
}
.password-strength-bar.strong {
    width: 100%;
    background: var(--color-success);
}

/* ============================================
   MOBILE RESPONSIVE
   ============================================ */

/* Tablet — скрыть иллюстрацию, уменьшить карточку */
@media (max-width: 900px) {
    .auth-card {
        grid-template-columns: 1fr;
        max-width: 500px;
    }
    .auth-illustration-side {
        display: none;
    }
}

/* Small tablet / large phone */
@media (max-width: 600px) {
    .auth-container {
        padding: 1.25rem 1rem;
        align-items: flex-start;
        padding-top: 2rem;
    }

    .auth-card {
        border-radius: 24px;
        max-width: 100%;
        box-shadow: 0 20px 60px rgba(0,0,0,0.6);
    }

    .auth-form-side {
        padding: 2rem 1.5rem;
    }

    .auth-logo {
        margin-bottom: 1.25rem;
    }

    .auth-header {
        margin-bottom: 1.25rem;
    }

    .auth-header h2 {
        font-size: 1.25rem;
    }

    .auth-form {
        gap: 1rem;
    }

    .oauth-buttons {
        margin-bottom: 1.25rem;
    }
}

/* Submit footer: same spacing as form gap so checkbox↔button = field↔field */
.auth-submit-footer {
    padding-top: var(--spacing-lg);
}

/* ── Mobile logo (login doesn't have logo in illustration side on mobile) ── */
.mobile-logo { display: none; }

/* ============================================
   MOBILE (≤430px) — полный редизайн
   ============================================ */
@media (max-width: 430px) {

    /* Фон: живые градиентные блобы */
    body {
        background:
            radial-gradient(ellipse 80% 40% at 20% -10%, rgba(99, 102, 241, 0.18) 0%, transparent 60%),
            radial-gradient(ellipse 60% 35% at 90% 110%, rgba(168, 85, 247, 0.14) 0%, transparent 60%),
            #08080a;
    }

    .auth-container {
        padding: 0;
        align-items: stretch;
        min-height: 100dvh;
        background: transparent;
        overflow: hidden;
    }

    /* Регистрация длиннее — нужен скролл */
    .signup-container {
        align-items: flex-start;
        overflow-y: auto;
    }

    /* Карточка на весь экран */
    .auth-card {
        border-radius: 0;
        min-height: 100dvh;
        box-shadow: none;
        border: none;
        background: transparent;
        animation: none;
    }

    /* Иллюстрация скрыта */
    .auth-illustration-side { display: none; }

    /* Форм-сайд: flex-колонка, безопасные отступы для notch/home bar */
    .auth-form-side {
        padding: 0;
        background: transparent;
        min-height: 100dvh;
        display: flex;
        flex-direction: column;
    }

    /* Мобильный логотип */
    .mobile-logo {
        display: block;
        text-align: center;
        padding-top: max(2.5rem, env(safe-area-inset-top, 2.5rem));
        padding-bottom: 0.25rem;
    }

    .mobile-logo h1 {
        font-size: 1.75rem;
        font-weight: 800;
        letter-spacing: -0.04em;
        background: linear-gradient(135deg, #fff 0%, rgba(255,255,255,0.55) 100%);
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
    }

    /* На signup мобильный лого виден (иллюстрация скрыта) */
    .signup-container .mobile-logo { display: block; }
    .signup-container .auth-logo:not(.mobile-logo) { display: none; }

    /* Скроллируемое тело формы */
    .auth-form-body {
        flex: 1;
        overflow-y: auto;
        padding: 1.75rem 1.375rem 1rem;
        display: flex;
        flex-direction: column;
        gap: 0;
    }

    /* Хедер */
    .auth-header {
        margin-bottom: 1.5rem;
    }
    .auth-header h2 {
        font-size: 1.5rem;
        font-weight: 800;
        letter-spacing: -0.02em;
    }
    .auth-header p {
        font-size: 0.875rem;
        margin-top: 0.375rem;
    }

    /* OAuth кнопки — вертикальный стек */
    .oauth-buttons {
        flex-direction: column;
        gap: 0.625rem;
        margin-bottom: 1.25rem;
    }
    .oauth-btn {
        border-radius: 14px;
        padding: 0.875rem 1rem;
        font-size: 0.9375rem;
        font-weight: 600;
        background: rgba(255,255,255,0.05);
        border-color: rgba(255,255,255,0.1);
        justify-content: center;
        gap: 0.625rem;
    }
    .oauth-btn:hover {
        background: rgba(255,255,255,0.09);
        transform: none;
    }

    /* Разделитель */
    .auth-divider {
        margin: 0.75rem 0 1rem;
    }

    /* Форм-группы */
    .auth-form {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        flex: 1;
    }

    /* Инпуты — 16px чтобы iOS не зумил */
    .input-wrapper input {
        font-size: 1rem;
        padding: 0.9375rem 1rem 0.9375rem 3rem;
        border-radius: 14px;
        background: rgba(255,255,255,0.05) !important;
        border-color: rgba(255,255,255,0.09);
    }
    .input-wrapper input:focus {
        background: rgba(255,255,255,0.08) !important;
        border-color: rgba(255,255,255,0.22);
    }

    /* Лейблы */
    .form-group label {
        font-size: 0.6875rem;
        letter-spacing: 0.06em;
    }

    /* Вкладки email/phone */
    .auth-method-tabs.segment-tabs {
        gap: 0.375rem;
    }
    .auth-method-tabs.segment-tabs .method-tab {
        padding: 0.6875rem 0.75rem;
        font-size: 0.8125rem;
        border-radius: 10px;
    }

    /* Чекбокс */
    .checkbox-group label {
        font-size: 0.8125rem;
        line-height: 1.5;
    }

    /* Validation tooltip — поверх инпута */
    .password-validation {
        top: auto;
        bottom: calc(100% + 10px);
    }
    .password-validation::after {
        top: auto;
        bottom: -5px;
        transform: rotate(225deg);
    }

    /* ── Прилипающая кнопка Submit ── */
    .auth-submit-footer { /* mobile only — desktop override below */
        padding: 1rem 1.375rem max(1.25rem, env(safe-area-inset-bottom, 1.25rem));
        background: linear-gradient(to top, #08080a 60%, transparent);
        position: sticky;
        bottom: 0;
        left: 0;
        right: 0;
        flex-shrink: 0;
    }

    .btn-submit {
        padding: 1.0625rem 2rem;
        font-size: 1rem;
        border-radius: 14px;
        box-shadow: 0 8px 32px rgba(255,255,255,0.08);
    }

    /* Убираем margin-top: auto когда кнопка в footer */
    .auth-form .btn-submit-wrapper { display: none; }
}

/* ============================================
   SPLIT LAYOUT (forgot-password, reset-password)
   ============================================ */

/* Контейнер: убираем padding на мобилке — карточка сама управляет отступами */
.auth-container.split-layout {
    padding: 2rem;
}

/* Карточка: двухколоночный грид */
.auth-card.split-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    max-width: 900px;
    width: 100%;
    overflow: hidden;
}

/* Состояние — иконка + текст по центру */
.auth-state-view {
    text-align: center;
    padding: 1rem 0;
}

.auth-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 16px;
    margin-left: auto;
    margin-right: auto;
    color: rgba(255, 255, 255, 0.6);
}

/* Инфо-блок (письмо отправлено, dev url и т.д.) */
.auth-notice-box {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 1rem 1.25rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-align: left;
}

.auth-notice-box p {
    line-height: 1.55;
}

/* ── Адаптив для split-card ── */
@media (max-width: 700px) {
    .auth-card.split-card {
        grid-template-columns: 1fr;
        max-width: 460px;
    }
    .auth-card.split-card .auth-illustration-side {
        display: none;
    }
}

@media (max-width: 760px) {
    /* Full-bleed background with subtle gradient glow */
    .auth-container.split-layout {
        padding: 0;
        align-items: stretch;
        min-height: 100dvh;
        background:
            radial-gradient(ellipse 100% 50% at 50% -5%, rgba(99, 102, 241, 0.22) 0%, transparent 55%),
            radial-gradient(ellipse 70% 40% at 80% 110%, rgba(168, 85, 247, 0.12) 0%, transparent 60%),
            #08080a;
    }

    /* Card: full screen, no border/shadow */
    .auth-card.split-card {
        border-radius: 0;
        min-height: 100dvh;
        box-shadow: none;
        border: none;
        background: transparent;
        animation: none;
        max-width: 100%;
        display: flex;
        flex-direction: column;
    }
    .auth-card.split-card .auth-illustration-side {
        display: none;
    }

    /* Form side: vertical layout with logo at top */
    .auth-card.split-card .auth-form-side {
        flex: 1;
        display: flex;
        flex-direction: column;
        padding: 0 1.5rem;
        padding-top: max(3.5rem, env(safe-area-inset-top, 3.5rem));
        padding-bottom: max(2rem, env(safe-area-inset-bottom, 2rem));
        overflow-y: auto;
    }

    /* Show logo at top */
    .auth-card.split-card .mobile-logo {
        display: block !important;
        margin-bottom: 2.5rem;
        text-align: left;
    }
    .auth-card.split-card .mobile-logo h1 {
        font-size: 1.6rem;
        font-weight: 800;
        letter-spacing: -0.04em;
        color: #fff;
        margin: 0;
    }

    /* Form body: no extra padding */
    .auth-card.split-card .auth-form-body {
        padding: 0;
        overflow-y: visible;
        flex: 1;
    }

    /* Header: tighter */
    .auth-card.split-card .auth-header {
        margin-bottom: 1.75rem;
        text-align: left !important;
    }
    .auth-card.split-card .auth-header h2 {
        font-size: 1.75rem;
        font-weight: 800;
        letter-spacing: -0.03em;
        margin-bottom: 0.3rem;
    }
    .auth-card.split-card .auth-header p {
        font-size: 0.9rem;
        color: rgba(255,255,255,0.45);
    }

    /* OAuth buttons: вертикальный стек */
    .auth-card.split-card .oauth-buttons {
        display: flex;
        flex-direction: column;
        gap: 10px;
        margin-bottom: 1.25rem;
    }

    /* Submit footer: sticky at bottom */
    .auth-card.split-card .auth-submit-footer {
        position: sticky;
        bottom: 0;
        padding: 1rem 0 max(1.25rem, env(safe-area-inset-bottom, 1.25rem));
        background: linear-gradient(to top, #08080a 60%, transparent);
        margin-top: auto;
    }

    .auth-card.split-card .auth-form {
        gap: 0.875rem;
    }
}

@media (max-width: 430px) {
    .auth-container.split-layout {
        padding: 0;
        align-items: stretch;
        min-height: 100dvh;
        background:
            radial-gradient(ellipse 80% 40% at 20% -10%, rgba(99, 102, 241, 0.18) 0%, transparent 60%),
            radial-gradient(ellipse 60% 35% at 90% 110%, rgba(168, 85, 247, 0.14) 0%, transparent 60%),
            #08080a;
    }
    .auth-card.split-card {
        border-radius: 0;
        min-height: 100dvh;
        box-shadow: none;
        border: none;
        background: transparent;
        animation: none;
        max-width: 100%;
        display: flex;
        flex-direction: column;
    }
    .auth-card.split-card .auth-illustration-side {
        display: none;
    }

    /* Split-layout form side: vertically centered, properly padded */
    .auth-card.split-card .auth-form-side {
        padding: max(2.5rem, env(safe-area-inset-top, 2.5rem)) 1.375rem max(1.75rem, env(safe-area-inset-bottom, 1.75rem));
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 0;
    }

    /* auth-form-body inside split-card (login, signup) */
    .auth-card.split-card .auth-form-body {
        padding: 0;
        overflow-y: visible;
    }

    /* auth-header inside split-card */
    .auth-card.split-card .auth-header {
        margin-bottom: 1.5rem;
    }

    /* Sticky submit footer inside split-card */
    .auth-card.split-card .auth-submit-footer {
        padding: 1rem 0 0;
        background: none;
        position: static;
    }

    /* Forgot/reset: form fits screen, centered */
    .auth-card.split-card .auth-form {
        gap: 1rem;
    }
    .auth-card.split-card .auth-form .btn-submit {
        margin-top: 0.5rem;
    }

    /* ── Signup compact: reduce spacing so it fits without scroll ── */
    .signup-container .auth-card.split-card .auth-form-side {
        justify-content: flex-start;
        padding-top: max(1.75rem, env(safe-area-inset-top, 1.75rem));
        overflow-y: auto;
    }
    .signup-container .auth-form-body {
        padding-bottom: 0.5rem;
    }
    .signup-container .auth-header {
        margin-bottom: 1rem !important;
    }
    .signup-container .auth-header h2 {
        font-size: 1.375rem;
    }
    .signup-container .oauth-buttons {
        margin-bottom: 0.75rem;
        gap: 0.5rem;
    }
    .signup-container .oauth-btn {
        padding: 0.75rem 1rem;
    }
    .signup-container .auth-divider {
        margin: 0.5rem 0 0.75rem;
    }
    .signup-container .auth-form {
        gap: 0.75rem;
    }
    .signup-container .input-wrapper input {
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
    }
    .signup-container .auth-submit-footer {
        padding: 0.75rem 0 0;
    }
}