/* ===== CSS RESET & VARIABLES ===== */
/* test 2 */
:root {
    /* Sizes */
    --header-height: 80px;
    
    /* Colors */
    --primary-50: #f0f9ff;
    --primary-100: #e0f2fe;
    --primary-200: #bae6fd;
    --primary-300: #7dd3fc;
    --primary-400: #38bdf8;
    --primary-500: #0ea5e9;
    --primary-600: #0284c7;
    --primary-700: #0369a1;
    --primary-800: #075985;
    --primary-900: #0c4a6e;

    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;

    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --info: #3b82f6;

    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-heading: 'Manrope', var(--font-primary);

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --spacing-2xl: 4rem;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

    /* Border radius */
    --radius-sm: 0.375rem;
    --radius: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition: 250ms ease;
    --transition-slow: 350ms ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    line-height: 1.6;
    color: var(--gray-800);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

/* ===== CONTAINER ===== */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* ===== HEADER ===== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding: 1rem 0;
    padding-right: 0;
    height: 80px;
    box-sizing: border-box;
    width: 100%;
    transition: padding-right 0.3s ease;
}

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-lg);
    box-sizing: border-box;
    width: 100%;
}

.navbar-brand .logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    text-decoration: none;
    color: var(--gray-900);
    font-size: 1.5rem;
    font-weight: 700;
}

.navbar-brand .logo img {
    height: 32px;
    width: auto;
}

.navbar-menu {
    display: flex;
    gap: var(--spacing-lg);
    flex: 1;
    justify-content: center;
}

.nav-link {
    color: var(--gray-700);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition-fast);
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
}

.nav-link:hover {
    color: var(--primary-600);
    background: var(--primary-50);
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.auth-buttons {
    display: flex;
    gap: var(--spacing-sm);
}

.user-menu {
    position: relative;
}

#user-menu-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--gray-100);
    border: none;
    border-radius: var(--radius);
    color: var(--gray-700);
    cursor: pointer;
    font-weight: 500;
    transition: all var(--transition-fast);
}

#user-menu-toggle:hover {
    background: var(--gray-200);
}

.user-name {
    font-size: 0.875rem;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition);
    z-index: 1000;
}

.user-menu:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: var(--gray-700);
    transition: background var(--transition-fast);
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-size: 0.875rem;
}

.dropdown-item:hover {
    background: var(--gray-100);
}

.dropdown-divider {
    height: 1px;
    background: var(--gray-200);
    margin: 0.5rem 0;
}

.navbar-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--gray-700);
    font-size: 1.5rem;
    cursor: pointer;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius);
    font-weight: 500;
    font-size: 0.875rem;
    line-height: 1.5;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 1px solid transparent;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
    color: white;
    border: none;
    box-shadow: 0 4px 14px 0 rgba(14, 165, 233, 0.39);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(14, 165, 233, 0.5);
}

.btn-outline {
    background: transparent;
    color: var(--primary-600);
    border-color: var(--primary-300);
}

.btn-outline:hover {
    background: var(--primary-50);
    border-color: var(--primary-400);
}

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
    border-color: var(--gray-200);
}

.btn-secondary:hover {
    background: var(--gray-200);
    border-color: var(--gray-300);
}

.btn-lg {
    padding: 0.875rem 2rem;
    font-size: 1rem;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
}

.btn-block {
    width: 100%;
}

.btn-icon {
    gap: 0.375rem;
    padding: 0.5rem 0.875rem;
}

/* ===== HERO SECTION ===== */
.hero {
    padding: 2rem 0 4rem; /* Уменьшаем верхний padding */
    margin-top: -80px; /* Компенсируем body padding */
    padding-top: calc(80px + 2rem); /* Хедер + отступ */
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    color: var(--gray-900);
    min-height: calc(100vh - 80px); /* Вычитаем высоту хедера */
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.dashboard {
    padding: 2rem 0;
    background: var(--gray-50);
    min-height: calc(100vh - 80px);
    margin-top: 80px; /* Компенсируем фиксированный хедер */
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
            radial-gradient(circle at 20% 80%, rgba(14, 165, 233, 0.1) 0%, transparent 50%),
            radial-gradient(circle at 80% 20%, rgba(124, 58, 237, 0.1) 0%, transparent 50%);
    z-index: 0;
}

.hero .container {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-2xl);
    align-items: center;
}

.hero-content {
    max-width: 600px;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: var(--spacing-lg);
    background: linear-gradient(to right, var(--primary-700), var(--primary-500));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--gray-600);
    margin-bottom: var(--spacing-xl);
    line-height: 1.6;
}

.hero-buttons {
    display: flex;
    gap: var(--spacing-md);
    flex-wrap: wrap;
}

.hero-image {
    position: relative;
}

.car-dashboard {
    background: white;
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--gray-200);
    transform: perspective(1000px) rotateY(-10deg);
}

.car-card {
    background: linear-gradient(135deg, var(--primary-50), white);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    color: var(--gray-900);
    box-shadow: var(--shadow-md);
}

.car-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--spacing-md);
}

.car-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-600);
}

.car-model {
    font-size: 1rem;
    color: var(--gray-600);
}

.car-plate {
    display: inline-block;
    background: var(--primary-600);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    font-weight: 600;
    margin-bottom: var(--spacing-md);
}

.car-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
    margin-top: var(--spacing-lg);
}

.stat {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--gray-600);
}

.stat i {
    color: var(--primary-500);
}

/* ===== FEATURES SECTION ===== */
.features {
    padding: var(--spacing-2xl) 0;
    background: white;
}

.section-title {
    text-align: center;
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: var(--spacing-xl);
    color: var(--gray-900);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-lg);
    margin-top: var(--spacing-xl);
}

.feature-card {
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    transition: all var(--transition);
    border: 1px solid var(--gray-200);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-300);
}

.feature-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--spacing-md);
    color: white;
    font-size: 1.5rem;
}

.feature-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--gray-900);
}

.feature-card p {
    color: var(--gray-600);
    font-size: 0.875rem;
    line-height: 1.6;
}

/* ===== FOOTER ===== */
.footer {
    background: var(--gray-900);
    color: white;
    padding: var(--spacing-2xl) 0 var(--spacing-lg);
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
}

.footer-brand .logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: var(--spacing-sm);
    color: white;
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: 700;
}

.footer-tagline {
    color: var(--gray-400);
    font-size: 0.875rem;
}

.footer-links {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-xl);
}

.footer-column h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: var(--spacing-md);
    color: white;
}

.footer-column a {
    display: block;
    color: var(--gray-400);
    text-decoration: none;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    transition: color var(--transition-fast);
}

.footer-column a:hover {
    color: white;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--gray-800);
    color: var(--gray-400);
    font-size: 0.875rem;
}

.social-links {
    display: flex;
    gap: var(--spacing-sm);
}

.social-links a {
    color: var(--gray-400);
    font-size: 1.25rem;
    transition: color var(--transition-fast);
}

.social-links a:hover {
    color: white;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .hero .container {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-content {
        max-width: 100%;
    }

    .hero-buttons {
        justify-content: center;
    }

    .car-dashboard {
        max-width: 500px;
        margin: 0 auto;
    }
}

@media (max-width: 768px) {
    .navbar-menu {
        display: none !important;
    }

    .navbar-toggle {
        display: block;
    }

    .footer-content {
        grid-template-columns: 1fr;
    }

    .footer-links {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.125rem;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .footer-bottom {
        flex-direction: column;
        gap: var(--spacing-md);
        text-align: center;
    }
}

@media (max-width: 480px) {
    .auth-buttons {
        display: none !important;
    }

    .hero-buttons {
        flex-direction: column;
    }

    .btn-lg {
        width: 100%;
    }
}

/* 1. Фикс для хэдера перекрывающего контент */
@media (max-width: 767px) {
    body {
        padding-top: 60px !important; /* Высота хэдера */
    }

    .header {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        height: 60px !important;
        z-index: 1000 !important;
        background: white !important;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1) !important;
    }

    .main-content,
    .hero-section,
    .page {
        margin-top: 60px !important;
        min-height: calc(100vh - 60px) !important;
    }
}

/* 2. Фикс для логотипа VINpad */
.logo {
    display: flex !important;
    align-items: center !important;
    height: 40px !important;
    gap: 10px !important;
}

.logo img {
    height: 32px !important;
    width: auto !important;
    display: block !important;
}

.logo span {
    font-size: 20px !important;
    font-weight: 700 !important;
    color: var(--primary-color) !important;
    line-height: 1 !important;
    margin: 0 !important;
    display: block !important;
}

/* 3. Фикс для кнопок Войти/Регистрация на главной */
@media (max-width: 767px) {
    .auth-buttons-container {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        background: white !important;
        padding: 16px !important;
        padding-bottom: calc(16px + env(safe-area-inset-bottom)) !important;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.1) !important;
        z-index: 999 !important;
    }

    .auth-buttons-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 12px !important;
    }

    .auth-main-btn {
        height: 52px !important;
        border-radius: 12px !important;
        font-size: 16px !important;
        font-weight: 600 !important;
    }
}

/* 4. Фикс для формы авторизации */
@media (max-width: 767px) {
    #auth-modal .modal-content {
        margin: 16px !important;
        max-height: calc(100vh - 32px) !important;
        padding: 20px !important;
        border-radius: 16px !important;
    }

    .auth-form {
        max-height: none !important;
        overflow: visible !important;
    }

    /* Гарантируем видимость тестовой плашки */
    .test-data-panel {
        margin-top: 25px !important;
        margin-bottom: 20px !important;
        position: relative !important;
        z-index: 1 !important;
    }
}

/* 5. Фикс для скролла в модалке */
.modal-content {
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior: contain !important;
}

/* 6. Фикс для очень маленьких экранов (iPhone SE) */
@media (max-width: 375px) {
    .modal-content {
        margin: 8px !important;
        max-height: calc(100vh - 16px) !important;
        padding: 16px !important;
    }

    .hero-title {
        font-size: 1.5rem !important;
    }

    .hero-subtitle {
        font-size: 0.9rem !important;
    }
}