/* Основные стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --brand-primary: #61525a;
    --brand-accent: #5f9dff;
    --warm-gray: #6b7280;
    --section-background: #f7f5f2;
    --border: 220, 14%, 90%;
    --success-green: #10b981;
    --warning-orange: #f59e0b;
    --danger-red: #ef4444;
    --info-blue: #3b82f6;
    --purple: #8b5cf6;
    --pink: #ec4899;
}

.page {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #f7f5f2 0%, #f0f9ff 100%);
    min-height: 100vh;
}

/* Контейнеры */
.header__container,
.main__container,
.footer__container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Кнопки */
.header__btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--brand-accent);
    border-radius: 0.5rem;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    background: transparent;
    color: var(--brand-accent);
}

.header__btn--primary {
    background-color: var(--brand-accent);
    color: white;
    border-color: var(--brand-accent);
}

.header__btn:hover {
    background-color: var(--brand-accent);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(95, 157, 255, 0.2);
}

.header__btn--primary:hover {
    background-color: #4a89e8;
    border-color: #4a89e8;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(95, 157, 255, 0.3);
}

.topic-card__btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--brand-accent);
    border-radius: 8rem;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.topic-card__btn--primary {
    background: linear-gradient(135deg, var(--brand-accent), #4a89e8);
    color: white;
    width: 100%;
    margin-top: 1rem;
    border: none;
    border-radius: 1.5rem;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(95, 157, 255, 0.3);
    position: relative;
    overflow: hidden;
}

.topic-card__btn--primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.topic-card__btn--primary:hover::before {
    left: 100%;
}

.topic-card__btn--primary:hover {
    background: linear-gradient(135deg, #4a89e8, #3b82f6);
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(95, 157, 255, 0.4);
}

/* Стили для кнопок покупки */
.topic-card__btn[style*="background-color: #ffc107"] {
    background: linear-gradient(135deg, #fbbf24, #f59e0b) !important;
    color: #1f2937 !important;
    font-weight: 600;
    border: 2px solid #f59e0b;
    box-shadow: 0 4px 15px rgba(251, 191, 36, 0.3);
    transition: all 0.3s ease;
}

.topic-card__btn[style*="background-color: #ffc107"]:hover {
    background: linear-gradient(135deg, #f59e0b, #d97706) !important;
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(251, 191, 36, 0.4);
    border-color: #d97706;
}

/* Хедер - стили переопределены в header.css */
.header__auth-buttons {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* Основной контент */
.main {
    padding: 1rem 0;
}

.hero {
    text-align: center;
    margin-bottom: 4rem;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    padding: 4rem 2rem;
    border-radius: 2rem;
    margin: 2rem 1rem 4rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--brand-accent), var(--brand-primary), var(--purple));
}

.hero__title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
}

.hero__title::after {
    content: '✨';
    position: absolute;
    right: -40px;
    top: -10px;
    font-size: 2rem;
    animation: sparkle 2s infinite;
}

@keyframes sparkle {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.2) rotate(180deg); }
}

.hero__subtitle {
    font-size: 1.4rem;
    font-weight: 500;
    color: var(--warm-gray);
    max-width: 700px;
    margin: 0 auto 2rem;
    line-height: 1.6;
}

/* Сетка курсов */
.topics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
    margin-bottom: 2rem;
    padding: 0 1rem;
}

.topic-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 2rem;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.08);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.topic-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--brand-accent), var(--brand-primary));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.topic-card:hover::before {
    transform: scaleX(1);
}

.topic-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 25px 60px rgba(95, 157, 255, 0.2);
    border-color: var(--brand-accent);
}

.topic-card__icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--brand-accent), #4a89e8);
    border-radius: 20px;
    color: white;
    filter: drop-shadow(0 8px 16px rgba(95, 157, 255, 0.3));
    transition: all 0.3s ease;
}

.topic-card:hover .topic-card__icon {
    transform: scale(1.15) rotate(10deg);
    box-shadow: 0 12px 24px rgba(95, 157, 255, 0.4);
}

.topic-card__title {
    color: var(--brand-primary);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.3;
}

.topic-card__description {
    color: var(--warm-gray);
    margin-bottom: 2rem;
    line-height: 1.6;
    font-size: 1rem;
    font-weight: 500;
}

/* Специальные стили для бесплатного курса */
.topic-card--free {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 2px solid var(--success-green);
    position: relative;
}

.topic-card--free .topic-card__icon {
    background: linear-gradient(135deg, var(--success-green), #059669);
}

.topic-card--free::after {
    content: 'БЕСПЛАТНО';
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: linear-gradient(135deg, var(--success-green), #059669);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.topic-card--free:hover {
    border-color: #059669;
    box-shadow: 0 25px 60px rgba(16, 185, 129, 0.2);
}

/* Футер - стили переопределены в footer.css */

/* Модальное окно */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.5) 100%);
    backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease;
}

.modal__content {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    margin: 5% auto;
    padding: 0;
    border-radius: 2rem;
    width: 90%;
    max-width: 500px;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: slideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal__close {
    color: var(--warm-gray);
    float: right;
    font-size: 1.75rem;
    font-weight: bold;
    position: absolute;
    right: 1.5rem;
    top: 1.5rem;
    cursor: pointer;
    z-index: 1001;
    transition: all 0.3s ease;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(107, 114, 128, 0.1);
}

.modal__close:hover {
    color: var(--brand-primary);
    background: rgba(95, 157, 255, 0.1);
    transform: scale(1.1);
}

.modal__body {
    padding: 3rem 2.5rem;
}

/* Анимации для модального окна */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Стили для содержимого авторизации в модальном окне */
.modal__body .auth {
    background: none;
    box-shadow: none;
    padding: 0;
    border: none;
    border-radius: 0;
    backdrop-filter: none;
}

.modal__body .auth__tabs {
    display: flex;
    margin-bottom: 2.5rem;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    border-radius: 1rem;
    padding: 0.5rem;
    position: relative;
}

.modal__body .auth__tab-btn {
    flex: 1;
    padding: 1rem 1.5rem;
    background: none;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    color: var(--warm-gray);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    border-radius: 0.75rem;
    z-index: 2;
}

.modal__body .auth__tab-btn--active {
    color: white;
    background: linear-gradient(135deg, var(--brand-accent) 0%, #4a89e8 100%);
    box-shadow: 0 4px 12px rgba(95, 157, 255, 0.3);
}

.modal__body .auth__tab-btn:hover:not(.auth__tab-btn--active) {
    color: var(--brand-accent);
    background: rgba(95, 157, 255, 0.1);
}

.modal__body .auth__form {
    display: none;
}

.modal__body .auth__form--active {
    display: block;
}

.modal__body .auth__form-title {
    text-align: center;
    color: var(--brand-primary);
    margin-bottom: 2.5rem;
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.modal__body .auth__form-group {
    margin-bottom: 1.5rem;
}

.modal__body .auth__form-label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--brand-primary);
    font-weight: 600;
    font-size: 0.875rem;
}

.modal__body .auth__form-input {
    width: 100%;
    padding: 1rem 1.25rem;
    border: 2px solid hsl(var(--border));
    border-radius: 1rem;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.modal__body .auth__form-input:focus {
    outline: none;
    border-color: var(--brand-accent);
    box-shadow: 0 0 0 4px rgba(95, 157, 255, 0.15);
    transform: translateY(-1px);
}

.modal__body .auth__form-btn {
    width: 100%;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, var(--brand-accent) 0%, #4a89e8 100%);
    color: white;
    border: 2px solid var(--brand-accent);
    border-radius: 1rem;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1.5rem;
    box-shadow: 0 4px 12px rgba(95, 157, 255, 0.3);
    position: relative;
    overflow: hidden;
}

.modal__body .auth__form-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.modal__body .auth__form-btn:hover::before {
    left: 100%;
}

.modal__body .auth__form-btn--primary {
    background: linear-gradient(135deg, var(--brand-accent) 0%, #4a89e8 100%);
}

.modal__body .auth__form-btn--primary:hover {
    background: linear-gradient(135deg, #4a89e8 0%, #3b82f6 100%);
    border-color: #4a89e8;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(95, 157, 255, 0.4);
}

.modal__body .auth__form-footer {
    text-align: center;
    margin-top: 1.5rem;
}

.modal__body .auth__form-link--forgot {
    color: var(--brand-accent);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

.modal__body .auth__form-link--forgot:hover {
    color: #4a89e8;
    text-decoration: underline;
}

.modal__body .auth__test-account {
    margin-top: 2.5rem;
    padding: 2rem;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: 1.5rem;
    border: 2px solid #0ea5e9;
    position: relative;
    overflow: hidden;
}

.modal__body .auth__test-account::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #0ea5e9, #0284c7);
}

.modal__body .auth__test-account-title {
    color: #0ea5e9;
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal__body .auth__test-account-title::before {
    content: '🎯';
    font-size: 1.5rem;
}

.modal__body .auth__test-account-info {
    margin-bottom: 0.5rem;
    color: var(--warm-gray);
    font-size: 0.875rem;
    font-weight: 500;
}

.modal__body .auth__test-account-btn {
    margin-top: 1.5rem;
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    width: 100%;
    padding: 1rem 1.5rem;
    border: 2px solid #0ea5e9;
    border-radius: 1rem;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
    position: relative;
    overflow: hidden;
}

.modal__body .auth__test-account-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.modal__body .auth__test-account-btn:hover::before {
    left: 100%;
}

.modal__body .auth__test-account-btn--secondary {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
}

.modal__body .auth__test-account-btn--secondary:hover {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    border-color: #0284c7;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(14, 165, 233, 0.4);
}

/* Выпадающее меню пользователя */
.user-container {
    position: relative;
    display: inline-block;
}

.header__btn--user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, var(--brand-accent) 0%, #4a89e8 100%);
    color: white;
    border: 2px solid var(--brand-accent);
    border-radius: 1rem;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(95, 157, 255, 0.3);
    position: relative;
    overflow: hidden;
}

.header__btn--user::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.header__btn--user:hover::before {
    left: 100%;
}

.header__btn--user:hover {
    background: linear-gradient(135deg, #4a89e8 0%, #3b82f6 100%);
    border-color: #4a89e8;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(95, 157, 255, 0.4);
}

.header__user-icon,
.header__dropdown-icon {
    width: 1rem;
    height: 1rem;
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: 1rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 0, 0, 0.1);
    min-width: 280px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    margin-top: 0.5rem;
}

.user-dropdown--active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown__header {
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 1rem 1rem 0 0;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-dropdown__avatar {
    width: 3rem;
    height: 3rem;
    background: linear-gradient(135deg, var(--brand-accent) 0%, #4a89e8 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.user-dropdown__info {
    flex: 1;
}

.user-dropdown__name {
    font-weight: 700;
    color: var(--brand-primary);
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.user-dropdown__email {
    color: var(--warm-gray);
    font-size: 0.9rem;
}

.user-dropdown__divider {
    height: 1px;
    background: rgba(0, 0, 0, 0.1);
    margin: 0.5rem 0;
}

.user-dropdown__menu {
    padding: 0.5rem 0;
}

.user-dropdown__item {
    width: 100%;
    padding: 0.75rem 1.5rem;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--warm-gray);
    font-size: 0.95rem;
    font-weight: 500;
}

.user-dropdown__item:hover {
    background: rgba(95, 157, 255, 0.1);
    color: var(--brand-accent);
}

.user-dropdown__item--danger {
    color: #ef4444;
}

.user-dropdown__item--danger:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.user-dropdown__item i {
    width: 1rem;
    height: 1rem;
}

/* Бургер меню */
.header__burger {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
}

.header__burger-line {
    width: 25px;
    height: 3px;
    background-color: var(--brand-primary);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.header__burger.active .header__burger-line:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.header__burger.active .header__burger-line:nth-child(2) {
    opacity: 0;
}

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

/* Адаптивность */
@media (max-width: 768px) {
    .hero {
        margin: 1rem;
        padding: 3rem 1.5rem;
    }
    
    .hero__title {
        font-size: 2.5rem;
    }
    
    .hero__title::after {
        right: -30px;
        top: -5px;
        font-size: 1.5rem;
    }
    
    .hero__subtitle {
        font-size: 1.2rem;
    }
    
    .topics-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 0 1rem;
    }
    
    .topic-card {
        padding: 1.5rem;
    }
    
    .topic-card__icon {
        width: 50px;
        height: 50px;
    }
    
    .topic-card__title {
        font-size: 1.3rem;
    }
    
    .topic-card__description {
        font-size: 0.95rem;
        margin-bottom: 1.5rem;
    }
    
    .topic-card__btn {
        padding: 0.8rem 1.2rem;
        font-size: 0.95rem;
    }
    
    .modal__content {
        width: 95%;
        margin: 10% auto;
    }
}

@media (max-width: 480px) {
    .hero {
        margin: 0.5rem;
        padding: 2rem 1rem;
    }
    
    .hero__title {
        font-size: 2rem;
        line-height: 1.2;
    }
    
    .hero__title::after {
        right: -20px;
        top: -3px;
        font-size: 1.2rem;
    }
    
    .hero__subtitle {
        font-size: 1rem;
    }
    
    .topics-grid {
        padding: 0 0.5rem;
        gap: 1rem;
    }
    
    .topic-card {
        padding: 1.5rem 1rem;
    }
    
    .topic-card__icon {
        width: 45px;
        height: 45px;
        margin-bottom: 1rem;
    }
    
    .topic-card__title {
        font-size: 1.2rem;
        margin-bottom: 0.75rem;
    }
    
    .topic-card__description {
        font-size: 0.9rem;
        margin-bottom: 1.5rem;
        line-height: 1.5;
    }
    
    .topic-card__btn {
        padding: 0.8rem 1rem;
        font-size: 0.9rem;
    }
    
    .modal__content {
        width: 98%;
        margin: 5% auto;
    }
    
    .modal__body {
        padding: 2rem 1.5rem;
    }
}
