/* ============================================
   DOROGA AI - ЕДИНАЯ СИСТЕМА СТИЛЕЙ
   Версия: 2.0 (Apple Corporate Style)
   ============================================ */

/* ========== ПЕРЕМЕННЫЕ ========== */
:root {
    /* Цветовая палитра Apple */
    --color-primary: #007AFF;
    --color-primary-dark: #0056D1;
    --color-primary-light: rgba(0, 122, 255, 0.1);
    
    --color-secondary: #5856D6;
    --color-success: #34C759;
    --color-warning: #FF9500;
    --color-danger: #FF3B30;
    --color-danger-dark: #D70015;
    
    /* Нейтральные цвета */
    --color-background: #F5F5F7;
    --color-surface: rgba(255, 255, 255, 0.92);
    --color-surface-solid: #FFFFFF;
    --color-border: rgba(0, 0, 0, 0.06);
    --color-border-light: rgba(210, 210, 215, 0.6);
    
    /* Текст */
    --color-text-primary: #1D1D1F;
    --color-text-secondary: #424245;
    --color-text-tertiary: #86868B;
    --color-text-on-primary: #FFFFFF;
    
    /* Градиенты */
    --gradient-primary: linear-gradient(135deg, #007AFF 0%, #0056D1 100%);
    --gradient-success: linear-gradient(135deg, #34C759 0%, #2DA847 100%);
    --gradient-danger: linear-gradient(135deg, #FF3B30 0%, #D70015 100%);
    --gradient-ai: conic-gradient(from 0deg, #007AFF, #5856D6, #AF52DE, #FF2D55, #FF9500, #FFCC00, #34C759, #007AFF);
    
    /* Тени */
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.04),
                   0 0 0 1px rgba(0, 0, 0, 0.02),
                   inset 0 0 0 1px rgba(255, 255, 255, 0.8);
    --shadow-button: 0 4px 14px rgba(0, 122, 255, 0.15),
                     inset 0 0 0 1px rgba(255, 255, 255, 0.1);
    --shadow-elevated: 0 8px 32px rgba(0, 0, 0, 0.08);
    
    /* Закругления */
    --radius-small: 8px;
    --radius-medium: 12px;
    --radius-large: 18px;
    --radius-pill: 980px;
    
    /* Анимации */
    --transition-smooth: all 0.3s cubic-bezier(0.22, 0.61, 0.36, 1);
    --transition-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* ========== БАЗОВЫЕ СТИЛИ ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--color-background);
    color: var(--color-text-primary);
    line-height: 1.47059;
    font-weight: 400;
    letter-spacing: -0.022em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========== ТИПОГРАФИЯ ========== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    letter-spacing: -0.025em;
    line-height: 1.14286;
}

h1 {
    font-size: 56px;
    font-weight: 700;
    letter-spacing: -0.028em;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    position: relative;
}

h2 {
    font-size: 40px;
    letter-spacing: -0.022em;
    color: var(--color-text-primary);
}

h3 {
    font-size: 32px;
    letter-spacing: -0.016em;
}

h4 {
    font-size: 24px;
    letter-spacing: -0.012em;
}

p {
    font-size: 17px;
    line-height: 1.47059;
    letter-spacing: -0.016em;
    color: var(--color-text-secondary);
}

.text-small {
    font-size: 15px;
    line-height: 1.38462;
}

.text-tiny {
    font-size: 13px;
    line-height: 1.23077;
    color: var(--color-text-tertiary);
}

/* Стильный заголовок для Doroga AI */
.logo-title {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', Arial, sans-serif;
    font-size: 56px;
    font-weight: 800;
    letter-spacing: -0.035em;
    background: linear-gradient(135deg, 
        #007AFF 0%, 
        #5856D6 25%, 
        #AF52DE 50%, 
        #FF2D55 75%, 
        #FF9500 100%
    );
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 
        0 2px 4px rgba(0, 122, 255, 0.1),
        0 0 20px rgba(88, 86, 214, 0.1);
    position: relative;
    display: inline-block;
}

.logo-title::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(0, 122, 255, 0.5),
        rgba(88, 86, 214, 0.5),
        rgba(175, 82, 222, 0.5),
        rgba(255, 45, 85, 0.5),
        rgba(255, 149, 0, 0.5),
        transparent
    );
    border-radius: 1px;
    opacity: 0.6;
}

/* ========== КОМПОНЕНТЫ ========== */
/* Карточки */
.card {
    background: var(--color-surface);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-radius: var(--radius-large);
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: var(--shadow-card);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.8) 20%, 
        rgba(255, 255, 255, 0.9) 50%, 
        rgba(255, 255, 255, 0.8) 80%, 
        transparent 100%
    );
    z-index: 2;
}

/* Кнопки */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.17648;
    letter-spacing: -0.022em;
    border: none;
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: var(--transition-smooth);
    text-decoration: none;
    position: relative;
    overflow: hidden;
    min-width: 180px;
}

.btn-primary {
    color: var(--color-text-on-primary);
    background: var(--gradient-primary);
    box-shadow: var(--shadow-button);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 6px 20px rgba(0, 122, 255, 0.25),
        inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.btn-secondary {
    color: var(--color-primary);
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 122, 255, 0.3);
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.04),
        inset 0 0 0 1px rgba(255, 255, 255, 0.8);
}

.btn-secondary:hover {
    background: var(--color-primary-light);
    border-color: var(--color-primary);
    transform: translateY(-2px);
    box-shadow: 
        0 4px 12px rgba(0, 122, 255, 0.1),
        inset 0 0 0 1px rgba(255, 255, 255, 0.8);
}

.btn-danger {
    color: var(--color-text-on-primary);
    background: var(--gradient-danger);
    box-shadow: 0 4px 14px rgba(255, 59, 48, 0.15);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 59, 48, 0.25);
}

/* Поля формы */
.form-group {
    position: relative;
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 15px;
    font-weight: 500;
    color: var(--color-text-secondary);
    letter-spacing: -0.014em;
}

.form-label .required {
    color: var(--color-danger);
    margin-left: 2px;
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    font-size: 17px;
    line-height: 1.47059;
    color: var(--color-text-primary);
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-medium);
    transition: var(--transition-smooth);
    outline: none;
    font-family: inherit;
}

.form-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-light);
    background: var(--color-surface-solid);
}

.form-input::placeholder {
    color: var(--color-text-tertiary);
    opacity: 0.8;
}

.form-hint {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: var(--color-text-tertiary);
    line-height: 1.38462;
}

/* Сообщения */
.message {
    padding: 16px 20px;
    border-radius: var(--radius-medium);
    font-size: 15px;
    line-height: 1.47059;
    letter-spacing: -0.016em;
    border-left: 4px solid;
    background: var(--color-surface-solid);
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.04),
        0 0 0 1px var(--color-border);
}

.message-success {
    border-left-color: var(--color-success);
    background: linear-gradient(135deg, rgba(52, 199, 89, 0.05) 0%, var(--color-surface-solid) 100%);
    color: #1D7E2D;
}

.message-error {
    border-left-color: var(--color-danger);
    background: linear-gradient(135deg, rgba(255, 59, 48, 0.05) 0%, var(--color-surface-solid) 100%);
    color: var(--color-danger-dark);
}

.message-warning {
    border-left-color: var(--color-warning);
    background: linear-gradient(135deg, rgba(255, 149, 0, 0.05) 0%, var(--color-surface-solid) 100%);
    color: #BF5800;
}

/* Индикатор сложности пароля */
.password-strength {
    height: 3px;
    background: rgba(210, 210, 215, 0.3);
    border-radius: 1.5px;
    margin: 8px 0 4px 0;
    overflow: hidden;
    position: relative;
}

.password-strength-bar {
    height: 100%;
    width: 0%;
    transition: var(--transition-smooth);
    border-radius: 1.5px;
}

.password-hint {
    font-size: 13px;
    font-weight: 500;
    min-height: 18px;
}

/* Анимация нейросети */
.ai-orb {
    position: relative;
    width: 32px;
    height: 32px;
    display: inline-block;
    vertical-align: middle;
}

.ai-orb::before,
.ai-orb::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    animation: aiOrbPulse 3s ease-in-out infinite;
}

.ai-orb::before {
    width: 24px;
    height: 24px;
    background: var(--gradient-ai);
    filter: blur(4px);
    opacity: 0.8;
    animation-delay: 0.1s;
}

.ai-orb::after {
    width: 16px;
    height: 16px;
    background: radial-gradient(circle at 30% 30%, var(--color-primary), var(--color-secondary));
    box-shadow: 
        0 0 20px rgba(0, 122, 255, 0.4),
        0 0 40px rgba(88, 86, 214, 0.3);
    animation-delay: 0.2s;
}

@keyframes aiOrbPulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.8;
    }
    25% {
        transform: translate(-50%, -50%) scale(1.1) rotate(90deg);
        opacity: 1;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.05) rotate(180deg);
        opacity: 0.9;
    }
    75% {
        transform: translate(-50%, -50%) scale(1.15) rotate(270deg);
        opacity: 1;
    }
}

/* ========== УТИЛИТЫ ========== */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.grid {
    display: grid;
    gap: 20px;
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

.flex {
    display: flex;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.flex-column {
    display: flex;
    flex-direction: column;
}

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mt-5 { margin-top: 40px; }

.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }
.mb-5 { margin-bottom: 40px; }

.p-1 { padding: 8px; }
.p-2 { padding: 16px; }
.p-3 { padding: 24px; }
.p-4 { padding: 32px; }
.p-5 { padding: 40px; }

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.hidden { display: none; }

/* ========== АДАПТИВНОСТЬ ========== */
@media (max-width: 768px) {
    h1 { font-size: 40px; }
    h2 { font-size: 32px; }
    h3 { font-size: 24px; }
    
    .logo-title {
        font-size: 40px;
    }
    
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
    
    .btn {
        min-width: 100%;
    }
    
    .ai-orb {
        width: 28px;
        height: 28px;
    }
    
    .ai-orb::before {
        width: 20px;
        height: 20px;
    }
    
    .ai-orb::after {
        width: 14px;
        height: 14px;
    }
}