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

body {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #1a2c3e;
    line-height: 1.5;
    min-height: 100vh;
    padding-top: 80px;
}

/* --- Navbar --- */
.navbar {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 40px);
    max-width: 1400px;
    z-index: 1000;
    transition: all 0.3s ease;
    background: white;
    border-radius: 60px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.navbar.scrolled {
    top: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 24px;
    position: relative;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    cursor: pointer;
    flex-shrink: 0;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
}

.logo-text {
    font-size: 18px;
    font-weight: 600;
    color: #1a2c3e;
}

/* Desktop Navigation - центрирование */
.nav-links {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
}

.nav-links ul {
    display: flex;
    gap: 32px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-link {
    text-decoration: none;
    color: #1a2c3e;
    font-weight: 500;
    font-size: 16px;
    padding-bottom: 4px;
    transition: all 0.2s;
    position: relative;
    cursor: pointer;
}

.nav-link.active {
    font-weight: 700;
    color: #667eea;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 2px;
    background: #667eea;
    border-radius: 2px;
}

.nav-link:hover {
    color: #667eea;
}

/* Auth Buttons */
.auth-buttons {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
}

.btn-login {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 40px;
    font-weight: 500;
    cursor: pointer;
    font-size: 14px;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102,126,234,0.4);
}

.btn-logout {
    background: transparent;
    color: #1a2c3e;
    border: 1px solid #ddd;
    padding: 8px 20px;
    border-radius: 40px;
    font-weight: 500;
    cursor: pointer;
    font-size: 14px;
}

.btn-logout:hover {
    background: #f0f0f0;
}

.user-greeting {
    color: #1a2c3e;
    font-size: 14px;
    font-weight: 500;
}

/* Hamburger - скрыт на десктопе */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: #1a2c3e;
    margin: 3px 0;
    transition: 0.3s;
    border-radius: 2px;
}

/* Main Content */
.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 20px;
    width: calc(100% - 40px);
}

.page-content, section {
    background: rgba(255,255,255,0.95);
    border-radius: 2rem;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

section h2, .page-content h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
}

/* Consulting Hero */
.consulting-hero {
    text-align: center;
    padding: 3rem 2rem;
    background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
    border-radius: 2rem;
    margin-bottom: 2rem;
}

.consulting-hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
}

/* Services Grid */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.service-card {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    border: 1px solid #e0e0e0;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.service-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.1);
}

.service-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.service-card h3 {
    color: #667eea;
    margin-bottom: 0.75rem;
}

/* Price Table */
.price-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

.price-table th,
.price-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.price-table th {
    background: #f5f5f5;
    font-weight: 600;
}

/* Buttons */
.btn-consult {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 40px;
    font-weight: 500;
    cursor: pointer;
    font-size: 1rem;
    margin: 0.5rem;
}

/* Loader */
.loader {
    text-align: center;
    padding: 3rem;
    color: white;
    font-size: 1.2rem;
}

/* Premium Content */
.premium-content {
    display: none;
    background: #f0f0ff;
    border-left: 4px solid #667eea;
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 0.5rem;
}

.premium-content.visible {
    display: block;
}

/* Contact Form */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact-form input, .contact-form textarea {
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 0.5rem;
}

.contact-form button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 0.75rem;
    border-radius: 0.5rem;
    cursor: pointer;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    color: white;
}

/* ============================================ */
/* === МОДАЛЬНОЕ ОКНО === */
/* ============================================ */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(3px);
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 1.5rem;
    width: 90%;
    max-width: 450px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    animation: modalFadeIn 0.2s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-content h3 {
    margin-bottom: 1.5rem;
    color: #1a2c3e;
    font-size: 1.5rem;
    text-align: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
}

.modal-content input, 
.modal-content select, 
.modal-content textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    margin: 0.5rem 0;
    border: 1px solid #ddd;
    border-radius: 0.75rem;
    font-family: inherit;
    font-size: 1rem;
    transition: border 0.2s;
}

.modal-content input:focus, 
.modal-content select:focus, 
.modal-content textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.modal-content button {
    width: 100%;
    padding: 0.75rem;
    margin-top: 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 0.75rem;
    cursor: pointer;
    font-weight: 500;
    font-size: 1rem;
    transition: all 0.2s;
}

.modal-content button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.modal-buttons {
    display: flex;
    gap: 10px;
    margin-top: 1rem;
}

.modal-buttons button {
    flex: 1;
}

.btn-cancel {
    background: #e0e0e0 !important;
    color: #333 !important;
}

.btn-cancel:hover {
    background: #d0d0d0 !important;
    transform: none !important;
    box-shadow: none !important;
}

.modal-switch {
    text-align: center;
    margin-top: 1.5rem;
    color: #667eea;
    cursor: pointer;
    font-size: 0.9rem;
}

.modal-switch:hover {
    text-decoration: underline;
}

.code-field {
    display: flex;
    gap: 10px;
    align-items: center;
}

.code-field input {
    flex: 1;
}

.code-field button {
    width: auto;
    margin-top: 0;
    padding: 0.75rem 1rem;
    white-space: nowrap;
}

.status-message {
    margin-top: 0.5rem;
    padding: 0.75rem;
    border-radius: 0.75rem;
    font-size: 0.85rem;
}

.status-success {
    background: #e8f5e9;
    color: #2e7d32;
    border-left: 4px solid #2e7d32;
}

.status-error {
    background: #ffebee;
    color: #c62828;
    border-left: 4px solid #c62828;
}

/* ============================================ */
/* === МОБИЛЬНАЯ ВЕРСИЯ (до 768px) === */
/* ============================================ */

@media (max-width: 768px) {
    body {
        padding-top: 65px;
    }
    
    /* Navbar */
    .navbar {
        top: 8px;
        left: 8px;
        right: 8px;
        width: auto;
        transform: none;
        border-radius: 30px;
    }
    
    .navbar.scrolled {
        top: 5px;
    }
    
    .nav-container {
        padding: 6px 16px;
    }
    
    /* Logo */
    .logo-icon {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
    
    .logo-text {
        font-size: 14px;
    }
    
    /* Auth buttons - скрываем на мобильных */
    .auth-buttons {
        display: none !important;
    }
    
    /* Hamburger */
    .hamburger {
        display: flex !important;
    }
    
    .hamburger span {
        width: 22px;
        height: 2px;
    }
    
    /* Мобильное меню - отменяем абсолютное позиционирование */
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        left: auto;
        transform: none;
        width: 280px;
        height: 100vh;
        height: 100dvh;
        background: white;
        box-shadow: -5px 0 30px rgba(0, 0, 0, 0.2);
        transition: right 0.3s ease;
        z-index: 1000;
        display: flex;
        flex-direction: column;
        overflow-y: auto;
        padding: 0;
        white-space: normal;
    }
    
    .nav-links.mobile-active {
        right: 0;
    }
    
    .nav-links ul {
        flex: 1;
        display: flex !important;
        flex-direction: column;
        gap: 4px;
        padding: 20px 16px;
        margin: 0;
        list-style: none;
    }
    
    .nav-links .nav-link {
        display: block;
        padding: 12px 16px;
        font-size: 16px;
        font-weight: 500;
        border-radius: 12px;
        text-align: left;
        color: #1a2c3e;
        white-space: normal;
    }
    
    .nav-links .nav-link.active {
        background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
        color: #667eea;
    }
    
    .nav-links .nav-link.active::after {
        display: none;
    }
    
    /* Мобильные кнопки авторизации */
    .mobile-auth-container {
        margin: 0 16px 20px 16px;
        padding: 16px 0 0 0;
        border-top: 1px solid #e0e0e0;
    }
    
    .mobile-auth-container .auth-buttons {
        display: flex !important;
        flex-direction: column;
        gap: 10px;
    }
    
    .mobile-auth-container .user-greeting {
        text-align: center;
        padding: 8px;
        font-size: 14px;
        background: #f5f5f5;
        border-radius: 10px;
        margin-bottom: 8px;
    }
    
    .mobile-auth-container .btn-login,
    .mobile-auth-container .btn-logout {
        width: 100%;
        padding: 12px 16px;
        font-size: 15px;
        text-align: center;
        border-radius: 40px;
        margin: 0;
    }
    
    .mobile-auth-container .btn-login {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
    }
    
    .mobile-auth-container .btn-logout {
        background: transparent;
        border: 1px solid #ddd;
        color: #1a2c3e;
    }
    
    /* Основной контент */
    .main-content {
        padding: 12px;
        width: 100%;
    }
    
    .page-content, section {
        padding: 1rem;
        border-radius: 1.25rem;
        margin-bottom: 1rem;
    }
    
    section h2, .page-content h2 {
        font-size: 1.5rem;
    }
    
    /* Hero */
    .consulting-hero {
        padding: 1.5rem 1rem;
    }
    
    .consulting-hero h1 {
        font-size: 1.5rem;
    }
    
    /* Services grid */
    .services-grid {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
        margin: 1rem 0;
    }
    
    .service-card {
        padding: 1rem;
    }
    
    .service-icon {
        font-size: 1.75rem;
    }
    
    /* Price table */
    .price-table {
        display: block;
        overflow-x: auto;
        font-size: 0.75rem;
    }
    
    .price-table th,
    .price-table td {
        padding: 0.5rem;
        min-width: 100px;
    }
    
    /* Buttons */
    .btn-consult {
        padding: 8px 16px;
        font-size: 0.85rem;
    }
    
    /* Modal */
    .modal-content {
        padding: 1.25rem;
        width: 95%;
    }
    
    footer {
        padding: 1rem;
        font-size: 0.75rem;
        padding-bottom: env(safe-area-inset-bottom, 20px);
    }
}

/* Очень маленькие экраны */
@media (max-width: 480px) {
    .logo-text {
        font-size: 14px;
        display: inline-block;
    }
    
    .logo-icon {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }
    
    .consulting-hero h1 {
        font-size: 1.25rem;
    }
}

/* Затемнение фона при открытом меню */
body.menu-open {
    overflow: hidden;
}

body.menu-open::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 998;
}

/* Анимация гамбургера */
.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Скрываем мобильный контейнер на десктопе */
@media (min-width: 769px) {
    .mobile-auth-container {
        display: none !important;
    }
}



/* === ФИКС ШИРИНЫ NAVBAR И CONTENT === */

/* Делаем ширину одинаковой для всех экранов */
@media (min-width: 769px) {
    .navbar {
        width: calc(100% - 40px);
        max-width: 1400px;
    }
    
    .main-content {
        width: calc(100% - 40px);
        max-width: 1400px;
        padding-left: 0;
        padding-right: 0;
    }
}

/* Для экранов больше 1400px - фиксированная ширина */
@media (min-width: 1400px) {
    .navbar {
        width: 1400px;
    }
    
    .main-content {
        width: 1400px;
    }
}

/* Для мобильных */
@media (max-width: 768px) {
    .navbar {
        width: calc(100% - 16px);
        left: 8px;
        right: 8px;
        transform: none;
    }
    
    .main-content {
        width: calc(100% - 16px);
        padding-left: 0;
        padding-right: 0;
        margin-left: 8px;
        margin-right: 8px;
    }
}
