/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #3390ec;
    --primary-hover: #2a7fd4;
    --text-color: #1a1a1a;
    --text-secondary: #666666;
    --bg-color: #ffffff;
    --bg-light: #f8f9fa;
    --border-color: #e5e5e5;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.15);
    --transition: all 0.3s ease;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-color);
    background-color: var(--bg-color);
    line-height: 1.6;
    font-size: 16px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: #FFE135; /* Банановый желтый цвет */
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
}

.logo a {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 24px;
    font-weight: 700;
    color: #000000;
    text-decoration: none;
    transition: var(--transition);
}

.logo-img {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.logo-text {
    display: inline-block;
}

.logo a:hover {
    color: #333333;
}

.logo a:hover .logo-img {
    opacity: 0.8;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 32px;
    align-items: center;
}

.nav-menu a {
    color: #000000;
    text-decoration: none;
    font-size: 16px;
    transition: var(--transition);
    position: relative;
    font-weight: 500;
}

.nav-menu a:hover {
    color: #333333;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: #000000;
    transition: var(--transition);
}

.nav-menu a:hover::after {
    width: 100%;
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.mobile-menu-toggle span {
    width: 24px;
    height: 2px;
    background: #000000;
    transition: var(--transition);
}

/* User Balance in Header (кликабельная ссылка на Профиль) */
.user-balance {
    display: inline-block;
    padding: 8px 16px;
    margin-right: 12px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
    color: #000000;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
a.user-balance {
    text-decoration: none;
    cursor: pointer;
}
a.user-balance:hover {
    color: #000000;
    background: rgba(255, 255, 255, 1);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    font-size: 16px;
    text-align: center;
}

.btn-primary {
    background: #FFE135; /* Банановый желтый цвет */
    color: #000000;
}

.btn-primary:hover {
    background: #FFD700;
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.btn-small {
    padding: 8px 16px;
    font-size: 14px;
}

.btn-small.btn-primary {
    background: #000000 !important;
    color: white !important;
}

.btn-small.btn-primary:hover {
    background: #333333 !important;
}

.btn-large {
    padding: 16px 32px;
    font-size: 18px;
}

.btn-secondary {
    background: #ffffff;
    color: #000000;
    border: 2px solid #000000;
}

.btn-secondary:hover {
    background: #f5f5f5;
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

/* Кнопка MAX — в стиле логотипа: градиент синий → фиолетовый, белый текст */
.btn-max {
    background: linear-gradient(135deg, #5B7FFF 0%, #8B5CF6 50%, #A855F7 100%);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 14px rgba(91, 127, 255, 0.35);
}

.btn-max:hover {
    background: linear-gradient(135deg, #6B8FFF 0%, #9B6CF6 50%, #B865F7 100%);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(91, 127, 255, 0.45);
}

.link {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

.link:hover {
    text-decoration: underline;
}

/* Hero Section — помещается в экран без скролла */
.hero {
    min-height: calc(100vh - 80px);
    padding: 16px 0 24px;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.hero .container {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(20px, 4vw, 60px);
    align-items: center;
    flex: 1;
    min-height: 0;
}

.hero-text {
    text-align: left;
    min-height: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hero-image {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 0;
}

.hero-img {
    width: 100%;
    height: auto;
    max-width: 100%;
    max-height: min(48vh, 420px);
    object-fit: contain;
    object-position: center;
}

.hero-title {
    font-size: clamp(24px, 4.2vw, 48px);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: clamp(10px, 1.8vh, 24px);
    color: #000000;
}

.hero-title .highlight {
    color: #000000;
}

.hero-description {
    font-size: clamp(14px, 1.6vw, 18px);
    color: #333333;
    margin-bottom: clamp(12px, 2vh, 40px);
    line-height: 1.5;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: clamp(8px, 1.2vw, 16px);
    margin-bottom: clamp(12px, 2vh, 40px);
    max-width: 600px;
}

.feature-badge {
    display: flex;
    align-items: center;
    gap: clamp(6px, 1vw, 12px);
    padding: clamp(6px, 1vh, 12px) clamp(10px, 1.2vw, 16px);
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    transition: none;
}

.feature-badge:hover {
    transform: none;
    box-shadow: none;
}

.feature-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    font-weight: bold;
    flex-shrink: 0;
}

.feature-icon-img {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    object-fit: contain;
}

.feature-badge span:last-child {
    font-size: clamp(13px, 1.4vw, 16px);
    color: #000000;
    font-weight: 400;
}

/* Улучшаем читаемость на желтом фоне */
.hero-text {
    position: relative;
    z-index: 1;
}

/* Features Section */
.features {
    padding: 60px 0;
    background: var(--bg-color);
    scroll-margin-top: 80px;
}

.features-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.feature-card {
    padding: 20px 24px;
    background: #2a2a2a; /* Темно-серый фон */
    border-radius: 12px;
    transition: var(--transition);
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.feature-icon-large {
    font-size: 32px;
    flex-shrink: 0;
    line-height: 1;
    margin-top: 2px;
}

.feature-content {
    flex: 1;
}

.feature-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #ffffff; /* Белый цвет текста */
    line-height: 1.3;
    display: flex;
    align-items: center;
    white-space: nowrap;
}

.feature-text {
    font-size: 14px;
    color: #e0e0e0; /* Светло-серый для описания */
    line-height: 1.6;
    margin-top: 8px;
}

/* Tariffs anchor section (главная) */
.tariffs-anchor {
    padding: 60px 0;
    background: var(--bg-color);
    text-align: center;
}
.tariffs-anchor .section-title { margin-bottom: 16px; }
.tariffs-intro {
    max-width: 560px;
    margin: 0 auto 24px;
    color: var(--text-muted, #888);
    line-height: 1.5;
}

/* How To Section */
.howto {
    padding: 60px 0 20px 0;
    background: var(--bg-light);
}

.section-title {
    font-size: 40px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 40px;
    color: var(--text-color);
}

.howto-content {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    grid-template-rows: auto auto;
    gap: 40px;
    align-items: center;
    margin-bottom: 20px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.phone-demo {
    grid-column: 2;
    grid-row: 1 / 3;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1;
}

.phone-demo img {
    max-width: 300px;
    width: 100%;
    height: auto;
    object-fit: contain;
}

.step {
    padding: 24px;
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.step:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.step-left {
    grid-column: 1;
    text-align: left;
}

.step-right {
    grid-column: 3;
    text-align: left;
}

.step-top {
    grid-row: 1;
    align-self: end;
}

.step-bottom {
    grid-row: 2;
    align-self: start;
}

.step-center {
    grid-row: 1 / 3;
    align-self: center;
}

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

.step-icon {
    font-size: 32px;
    flex-shrink: 0;
    line-height: 1;
}

.step-icon-phone,
.step-icon-pen {
    order: 2;
}

.step-icon-result {
    order: 0;
}

.step-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    color: var(--text-color);
    flex: 1;
}

.step-text {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

.hero-buttons {
    display: flex;
    gap: clamp(8px, 1.2vw, 12px);
    flex-wrap: nowrap;
    margin-top: auto;
}

/* Текст в кнопках чуть меньше, чтобы все три помещались в одну строку без переноса */
.hero-buttons .btn {
    font-size: 14px;
    padding: 12px 18px;
    white-space: nowrap;
}

/* Низкий экран (ландшафт, маленькое окно) — герой компактнее */
@media (max-height: 700px) {
    .hero-title {
        font-size: clamp(22px, 3.5vw, 40px);
        margin-bottom: 8px;
    }
    .hero-description {
        font-size: clamp(13px, 1.4vw, 16px);
        margin-bottom: 12px;
    }
    .features-grid {
        margin-bottom: 10px;
    }
    .hero-img {
        max-height: min(38vh, 320px);
    }
}

.howto-button {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: nowrap;
    text-align: center;
    margin-top: 20px;
}

/* FAQ Section */
.faq {
    padding: 20px 0 80px 0;
    background: var(--bg-color);
    scroll-margin-top: 80px;
}

.faq-list {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.faq-item {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    background: white;
    display: flex;
    flex-direction: column;
}

.faq-question {
    width: 100%;
    padding: 20px 24px;
    background: none;
    border: none;
    text-align: left;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

.faq-question:hover {
    background: var(--bg-light);
}

.faq-icon {
    font-size: 24px;
    color: var(--primary-color);
    transition: var(--transition);
    flex-shrink: 0;
    margin-left: 16px;
}

.faq-item.active .faq-icon {
    transform: rotate(45deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.faq-item.active .faq-answer {
    max-height: 500px;
}

.faq-answer p {
    padding: 20px 24px;
    color: var(--text-secondary);
    line-height: 1.7;
    text-align: left;
    margin: 0;
    width: 100%;
}

.faq-answer strong {
    color: var(--text-color);
}

/* Footer */
.footer {
    padding: 40px 0;
    background: var(--bg-light);
    border-top: 1px solid var(--border-color);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-left,
.footer-center,
.footer-right {
    flex: 1;
    min-width: 200px;
}

.footer-center {
    text-align: center;
}

.footer-left {
    text-align: left;
}

.footer-right {
    text-align: right;
}

.footer-right p {
    margin-bottom: 4px;
}

.footer-right p:last-child {
    margin-bottom: 0;
}

.footer p {
    color: var(--text-secondary);
    font-size: 14px;
    margin: 0;
}

.footer-center p {
    margin-bottom: 5px;
}

.footer-center p:last-child {
    margin-bottom: 0;
}

.footer a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s;
}

.footer a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* Footer Responsive */
@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-left,
    .footer-center,
    .footer-right {
        text-align: center;
        width: 100%;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .header {
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    }

    .nav {
        padding: 10px 0;
    }

    .logo-img {
        height: 28px;
    }
    
    .logo-text {
        font-size: 18px;
    }
    
    .nav-menu {
        position: fixed;
        top: 58px;
        left: -100%;
        flex-direction: column;
        background: #FFE135; /* Банановый фон для мобильного меню */
        width: 100%;
        padding: 20px;
        box-shadow: var(--shadow);
        transition: var(--transition);
        gap: 20px;
        align-items: flex-start;
    }

    .nav-menu.active {
        left: 0;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .mobile-menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }

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

    .hero {
        padding: 12px 0 24px;
        min-height: calc(100vh - 72px);
    }
    
    .hero-content {
        grid-template-columns: 1fr;
        gap: clamp(16px, 3vh, 28px);
        text-align: center;
    }
    
    .hero-text {
        text-align: center;
    }
    
    .hero-image {
        order: -1;
    }
    
    .hero-img {
        max-height: min(38vh, 280px);
    }
    
    .hero-title {
        font-size: clamp(22px, 5vw, 32px);
    }

    .hero-description {
        font-size: clamp(13px, 3.5vw, 16px);
    }
    
    .features-grid {
        grid-template-columns: 1fr;
        max-width: 100%;
        margin-bottom: clamp(8px, 1.5vh, 24px);
    }
    
    .step-image {
        margin: 16px 0;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .features-list {
        grid-template-columns: 1fr;
    }
    
    .feature-card {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .feature-title {
        white-space: normal;
    }
    
    .howto-content {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        gap: 30px;
    }
    
    .phone-demo {
        grid-column: 1;
        grid-row: 2;
        order: 2;
    }
    
    .step-left,
    .step-right {
        grid-column: 1;
    }
    
    .step-top {
        grid-row: 1;
        order: 1;
    }
    
    .step-bottom {
        grid-row: 3;
        order: 3;
    }
    
    .step-center {
        grid-row: 4;
        order: 4;
    }
    
    .step {
        text-align: center;
    }
    
    .step-header {
        justify-content: center;
    }
    
    .phone-demo img {
        max-width: 250px;
    }

    .steps {
        grid-template-columns: 1fr;
    }

    .section-title {
        font-size: 32px;
    }
    
    .user-balance {
        font-size: 12px;
        padding: 6px 12px;
        margin-right: 8px;
    }
    
    .hero-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .hero-buttons .btn {
        width: 100%;
    }
    
    .howto-button {
        flex-direction: column;
        align-items: center;
    }
    
    .howto-button .btn {
        width: 100%;
        max-width: 300px;
    }

    .btn-large {
        padding: 14px 28px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 10px 0 20px;
        min-height: calc(100vh - 70px);
    }

    .hero-img {
        max-height: min(32vh, 220px);
    }

    .hero-title {
        font-size: clamp(20px, 5.5vw, 28px);
    }

    .hero-description {
        font-size: 13px;
    }

    .features,
    .howto,
    .faq {
        padding: 60px 0;
    }

    .feature-card {
        padding: 30px 20px;
    }

    .step {
        padding: 24px 20px;
    }
}
