/* 2fa-style.css - унифицированный стиль для 2FA */

:root {
    --primary-50: #eff6ff;
    --primary-100: #dbeafe;
    --primary-200: #bfdbfe;
    --primary-300: #93c5fd;
    --primary-400: #60a5fa;
    --primary-500: #3b82f6;
    --primary-600: #2563eb;
    --primary-700: #1d4ed8;
    --primary-800: #1e40af;
    
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;
    
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
    --shadow-xl: 0 20px 60px rgba(0,0,0,0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: var(--gray-900);
    color: var(--gray-100);
    transition: background 0.3s ease, color 0.3s ease;
    -webkit-font-smoothing: antialiased;
}

/* Светлая тема */
body[data-theme="light"] {
    background: var(--gray-50);
    color: var(--gray-800);
}

body[data-theme="light"] .auth-card {
    background: #ffffff;
    border-color: var(--gray-200);
    box-shadow: var(--shadow-xl);
}

body[data-theme="light"] .auth-forms {
    background: #ffffff;
    color: var(--gray-800);
}

body[data-theme="light"] .step-indicator {
    background: var(--gray-50);
}

body[data-theme="light"] .step-item {
    color: var(--gray-400);
}

body[data-theme="light"] .step-number {
    background: var(--gray-200);
    color: var(--gray-600);
}

body[data-theme="light"] .step-item.active {
    color: var(--primary-600);
}

body[data-theme="light"] .step-item.active .step-number {
    background: var(--primary-600);
}

body[data-theme="light"] .method-card {
    background: var(--gray-50);
    border-color: var(--gray-200);
}

body[data-theme="light"] .method-card:hover {
    border-color: var(--gray-300);
    background: #ffffff;
}

body[data-theme="light"] .method-card.selected {
    border-color: var(--primary-500);
    background: var(--primary-50);
}

body[data-theme="light"] .method-title {
    color: var(--gray-800);
}

body[data-theme="light"] .input-group label {
    color: var(--gray-700);
}

body[data-theme="light"] .input-group input {
    background: var(--gray-50);
    border-color: var(--gray-200);
    color: var(--gray-900);
}

body[data-theme="light"] .input-group input:focus {
    border-color: var(--primary-500);
    box-shadow: 0 0 0 4px var(--primary-100);
}

body[data-theme="light"] .form-title {
    color: var(--gray-900);
}

body[data-theme="light"] .form-subtitle {
    color: var(--gray-500);
}

body[data-theme="light"] .info-message {
    background: var(--primary-50);
    color: var(--primary-700);
}

body[data-theme="light"] .theme-toggle {
    background: rgba(37, 99, 235, 0.10);
    color: var(--primary-600);
}

body[data-theme="light"] .back-link a {
    color: var(--primary-600);
}

body[data-theme="light"] .flow-link-row a {
    color: var(--primary-600);
}

/* Контейнер */
.auth-container {
    width: 100%;
    max-width: 1200px;
}

.auth-card {
    display: flex;
    overflow: hidden;
    border-radius: var(--radius-xl);
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(148, 163, 184, 0.08);
    box-shadow: var(--shadow-xl);
    backdrop-filter: blur(12px);
}

/* Левая панель - бренд */
.auth-brand {
    flex: 1;
    padding: 48px 40px;
    color: #ffffff;
    background: linear-gradient(145deg, var(--primary-800), var(--primary-600), var(--primary-500));
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.auth-brand::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -30%;
    width: 120%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0) 70%);
    transform: rotate(15deg);
    pointer-events: none;
}

.brand-content {
    position: relative;
    z-index: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 48px;
}

.logo-icon {
    font-size: 2rem;
    background: rgba(255, 255, 255, 0.12);
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    backdrop-filter: blur(10px);
}

.logo h2 {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: #ffffff;
}

.brand-tagline {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 40px;
    line-height: 1.3;
    opacity: 0.95;
    color: #ffffff;
}

.brand-features {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: auto;
}

.feature {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.92rem;
    opacity: 0.85;
    color: rgba(255, 255, 255, 0.85);
}

.feature-icon {
    font-size: 1.1rem;
    background: rgba(255, 255, 255, 0.10);
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
}

/* Правая панель */
.auth-forms {
    flex: 1.2;
    padding: 48px 44px;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
}

.step-indicator {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
    background: rgba(255, 255, 255, 0.04);
    padding: 12px 20px;
    border-radius: var(--radius-full);
}

.step-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--gray-500);
    transition: all 0.2s ease;
}

.step-number {
    width: 30px;
    height: 30px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--gray-400);
    font-size: 13px;
}

.step-item.active {
    color: var(--primary-400);
}

.step-item.active .step-number {
    background: var(--primary-500);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.step-item.completed .step-number {
    background: var(--success);
    color: #ffffff;
}

.step-item.completed {
    color: var(--success);
}

/* Шаги */
.step {
    display: none;
    animation: fadeIn 0.3s ease;
}

.step.active-step {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-title {
    font-size: 1.6rem;
    color: #ffffff;
    margin-bottom: 6px;
    font-weight: 700;
}

.form-subtitle {
    color: var(--gray-400);
    margin-bottom: 28px;
    font-size: 0.9rem;
}

/* Методы 2FA */
.method-selector {
    display: flex;
    gap: 16px;
    margin: 24px 0 28px;
    flex-wrap: wrap;
}

.method-card {
    flex: 1;
    min-width: 140px;
    background: rgba(255, 255, 255, 0.04);
    border: 1.5px solid rgba(148, 163, 184, 0.10);
    border-radius: var(--radius-lg);
    padding: 22px 18px;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}

.method-card:hover {
    transform: translateY(-2px);
    border-color: rgba(148, 163, 184, 0.20);
    background: rgba(255, 255, 255, 0.06);
}

.method-card.selected {
    border-color: var(--primary-500);
    background: rgba(59, 130, 246, 0.08);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.10);
}

.method-icon {
    font-size: 2.4rem;
    margin-bottom: 10px;
}

.method-title {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 4px;
    color: #ffffff;
}

.method-desc {
    font-size: 0.75rem;
    color: var(--gray-400);
}

/* Формы ввода */
.input-group {
    margin-bottom: 24px;
}

.input-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-300);
    margin-bottom: 8px;
}

.input-group input {
    width: 100%;
    padding: 14px 18px;
    border: 1.5px solid rgba(148, 163, 184, 0.12);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-family: 'Inter', monospace;
    transition: all 0.2s ease;
    outline: none;
    background: rgba(255, 255, 255, 0.04);
    color: #ffffff;
    letter-spacing: 0.5px;
}

.input-group input::placeholder {
    color: var(--gray-500);
}

.input-group input:focus {
    border-color: var(--primary-500);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.10);
    background: rgba(255, 255, 255, 0.06);
}

.input-group input.error-shake {
    animation: shake 0.4s ease-in-out 0s 2;
    border-color: var(--danger) !important;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}

.submit-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, var(--primary-500), var(--primary-700));
    border: none;
    border-radius: var(--radius-md);
    color: #ffffff;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
    margin-top: 8px;
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.20);
}

.submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(59, 130, 246, 0.30);
}

.submit-btn:disabled {
    background: var(--gray-600);
    cursor: not-allowed;
    opacity: 0.6;
    transform: none;
    box-shadow: none;
}

.info-message {
    background: rgba(59, 130, 246, 0.08);
    border-left: 4px solid var(--primary-500);
    padding: 14px 18px;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    color: var(--primary-300);
    margin-bottom: 24px;
}

.flow-link-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.flow-link-row a {
    color: var(--primary-400);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.flow-link-row a:hover {
    color: var(--primary-300);
}

.back-link {
    text-align: center;
    margin-top: 24px;
}

.back-link a {
    color: var(--primary-400);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s ease;
}

.back-link a:hover {
    color: var(--primary-300);
}

/* Theme toggle */
.theme-toggle {
    border: none;
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
    border-radius: var(--radius-full);
    padding: 8px 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    font-size: 14px;
    transition: all 0.2s ease;
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.12);
}

/* Toast уведомления */
.toast-message {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 14px 28px;
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    font-weight: 500;
    z-index: 1000;
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0;
    pointer-events: none;
    white-space: nowrap;
    box-shadow: var(--shadow-lg);
}

.toast-message.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast-message.success {
    background: var(--success);
    color: #ffffff;
}

.toast-message.error {
    background: var(--danger);
    color: #ffffff;
}

.toast-message.warning {
    background: var(--warning);
    color: #ffffff;
}

/* Адаптивность */
@media (max-width: 900px) {
    .auth-card {
        flex-direction: column;
        border-radius: var(--radius-xl);
    }
    
    .auth-brand {
        padding: 32px 30px;
    }
    
    .brand-tagline {
        font-size: 1.1rem;
    }
    
    .auth-forms {
        padding: 36px 28px;
    }
    
    .method-selector {
        flex-direction: column;
    }
    
    .method-card {
        min-width: unset;
    }
    
    .theme-toggle {
        top: 12px;
        right: 12px;
        padding: 6px 12px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 14px;
    }
    
    .auth-forms {
        padding: 24px 16px;
    }
    
    .step-indicator {
        padding: 8px 12px;
        border-radius: var(--radius-md);
    }
    
    .step-item span:not(.step-number) {
        display: none;
    }
    
    .step-item {
        justify-content: center;
    }
    
    .form-title {
        font-size: 1.3rem;
    }
    
    .logo h2 {
        font-size: 1.3rem;
    }
    
    .brand-tagline {
        font-size: 1rem;
    }
    
    .toast-message {
        white-space: normal;
        max-width: 90%;
        text-align: center;
        padding: 12px 20px;
    }
}