/* css/landing.css */
:root {
    --primary: #FF6B35;
    --secondary: #3A3A3A;
    --accent: #FF9F1C;
    --light: #FFF5EB;
    --white: #fff;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--light);
    color: var(--secondary);
    line-height: 1.6;
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
}

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

/* Оптимизация для очень маленьких экранов */
@media (max-width: 360px) {
    .container {
        padding: 0 12px;
    }
}

header {
    background: var(--white);
    padding: 12px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
    animation: headerSlide 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes headerSlide {
    from { transform: translateY(-100%); }
    to { transform: translateY(0); }
}

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

.logo {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    transition: transform 0.3s;
}

.logo:hover {
    transform: rotate(-3deg);
}

.order-btn {
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--white);
    color: var(--primary);
    border: 2px solid var(--primary);
    font-size: 0.9rem;
}

.order-btn:hover {
    background: var(--primary);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255,107,53,0.3);
}

.hero {
    background: linear-gradient(120deg, #FFFAF5, var(--white));
    padding: 20px 0 40px;
    text-align: center;
    position: relative;
}

.hero h1 {
    font-size: 1.8rem;
    margin-bottom: 12px;
    color: var(--secondary);
    line-height: 1.3;
    padding: 0 10px;
}

.hero h1::after {
    content: '';
    display: block;
    width: 50px;
    height: 3px;
    background: var(--primary);
    margin: 15px auto;
    border-radius: 2px;
}

.hero p {
    font-size: 1rem;
    color: #666;
    max-width: 600px;
    margin: 0 auto;
    padding: 0 15px;
}

.hero-phone {
    margin: 20px 0;
    font-size: 1.2rem;
    font-weight: 700;
}

.hero-phone a {
    color: var(--primary);
    text-decoration: none;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
}

.hero-phone a:hover {
    transform: scale(1.05);
    text-shadow: 0 0 10px rgba(255, 107, 53, 0.3);
}

/* Стили для кнопки калькулятора в герое */
.hero-calculator {
    margin-top: 20px;
    text-align: center;
}

.hero-calculator-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 28px;
    background: linear-gradient(135deg, var(--accent), #ff7b35);
    color: var(--white);
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 6px 20px rgba(255, 159, 28, 0.35);
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
    z-index: 1;
    min-height: 54px;
}

.hero-calculator-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #ff7b35, var(--accent));
    opacity: 0;
    transition: opacity 0.3s;
    z-index: -1;
}

.hero-calculator-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(255, 159, 28, 0.5);
}

.hero-calculator-btn:hover::before {
    opacity: 1;
}

.hero-calculator-btn:active {
    transform: translateY(1px);
    box-shadow: 0 4px 15px rgba(255, 159, 28, 0.4);
}

.calculator-description {
    margin-top: 10px;
    color: #666;
    font-size: 0.9rem;
    max-width: 280px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 10px;
}

/* Новые стили для кнопки WhatsApp */
.hero-whatsapp {
    margin-top: 20px;
    text-align: center;
}

.hero-whatsapp .whatsapp-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: #25D366;
    color: white;
    padding: 14px 22px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.3s;
    font-size: 0.95rem;
    min-height: 50px;
}

.hero-whatsapp .whatsapp-btn:hover {
    background-color: #128C7E;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
}

.hero-whatsapp .small-text {
    margin-top: 8px;
    font-size: 0.85rem;
    color: #666;
}

/* Стили для информационного блока города */
.city-info {
    padding: 40px 0;
}

.info-box {
    background: var(--white);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    margin-bottom: 25px;
}

.region-info {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(0,0,0,0.1);
    flex-wrap: wrap;
}

.label {
    font-weight: 600;
    margin-right: 8px;
    color: var(--primary);
    font-size: 0.95rem;
}

.value {
    font-weight: 500;
    color: var(--secondary);
    font-size: 0.95rem;
}

.generated-content {
    line-height: 1.7;
    font-size: 1rem;
    color: var(--secondary);
}

.city-facts {
    background: var(--white);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}

.city-facts h3 {
    color: var(--secondary);
    margin-bottom: 15px;
    font-size: 1.3rem;
    text-align: center;
}

.city-facts ul {
    list-style: none;
    padding: 0;
}

.city-facts li {
    padding: 8px 0;
    padding-left: 20px;
    position: relative;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    font-size: 0.95rem;
}

.city-facts li:last-child {
    border-bottom: none;
}

.city-facts li:before {
    content: "•";
    color: var(--primary);
    font-weight: bold;
    position: absolute;
    left: 0;
    font-size: 1.1rem;
}

/* Тарифы */
.tariffs {
    padding: 40px 0;
}

.tariffs h2 {
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 30px;
    color: var(--secondary);
    padding: 0 15px;
}

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

.tariff-card {
    background: var(--white);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    transition: all 0.3s;
    border: 2px solid transparent;
}

.tariff-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 25px rgba(255,107,53,0.15);
    border-color: var(--primary);
}

.tariff-header {
    text-align: center;
    margin-bottom: 15px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

.tariff-header h3 {
    font-size: 1.2rem;
    margin-bottom: 8px;
    color: var(--secondary);
}

.tariff-price {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 8px;
}

.price-sub {
    font-size: 0.85rem;
    color: #666;
}

.price-sub div {
    margin: 4px 0;
}

.tariff-details {
    list-style: none;
    margin: 12px 0;
    padding: 0;
}

.tariff-details li {
    margin: 6px 0;
    display: flex;
    align-items: center;
    font-size: 0.9rem;
}

.tariff-details li::before {
    content: "•";
    color: var(--primary);
    margin-right: 8px;
}

.tariff-order-btn {
    width: 100%;
    text-align: center;
    margin-top: 12px !important;
    display: inline-block !important;
    padding: 10px 15px;
    font-size: 0.9rem;
}

.tariff-disclaimer {
    text-align: center;
    color: #666;
    font-size: 0.85rem;
    margin-top: 25px;
    padding: 15px;
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}

.tariff-disclaimer p {
    margin: 6px 0;
}

/* Стили для новостей города */
.city-news {
    padding: 40px 0;
    background: var(--light);
}

.city-news h3 {
    text-align: center;
    margin-bottom: 25px;
    font-size: 1.5rem;
    color: var(--secondary);
    padding: 0 15px;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    max-width: 1000px;
    margin: 0 auto;
}

.news-card {
    background: var(--white);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    transition: all 0.3s;
    border: 2px solid transparent;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(255,107,53,0.15);
    border-color: var(--primary);
}

.news-header {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

.news-icon {
    font-size: 1.3rem;
    margin-right: 8px;
}

.news-header h4 {
    font-size: 1.1rem;
    color: var(--secondary);
}

.news-content p {
    line-height: 1.6;
    margin-bottom: 12px;
    color: var(--secondary);
    font-size: 0.95rem;
}

.news-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: #666;
}

.news-card.tip {
    border-left: 4px solid var(--accent);
}

.news-card.promo {
    border-left: 4px solid var(--primary);
}

/* Стили для блока "Мы работаем в" */
.we-work-in {
    padding: 40px 0;
    background: var(--white);
}

.we-work-in h2 {
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 30px;
    color: var(--secondary);
    padding: 0 15px;
}

.cities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
    max-width: 1000px;
    margin: 0 auto;
}

.city-link {
    display: block;
    padding: 10px 16px;
    background: var(--light);
    color: var(--secondary);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    font-size: 0.9rem;
    line-height: 1.4;
}

.city-link:hover {
    background: var(--primary);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255,107,53,0.3);
    border-color: var(--primary);
}

/* Как это работает */
.how-it-works {
    padding: 60px 0;
    background: var(--white);
}

.how-it-works h2 {
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 30px;
    color: var(--secondary);
    padding: 0 15px;
}

.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.step {
    padding: 25px 20px;
    border-radius: 12px;
    background: var(--light);
    position: relative;
    text-align: center;
}

.step-number {
    width: 36px;
    height: 36px;
    background: var(--primary);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    margin: 0 auto 12px;
    font-size: 0.95rem;
}

.step h3 {
    margin-bottom: 12px;
    color: var(--secondary);
    font-size: 1.1rem;
}

.step p {
    font-size: 0.9rem;
    line-height: 1.5;
}

.footer {
    background: var(--secondary);
    color: var(--white);
    padding: 30px 0;
    text-align: center;
}

.footer a {
    color: var(--accent);
    text-decoration: none;
}

/* Модальные окна */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    padding: 15px;
}

.modal-content {
    background: var(--white);
    margin: 5% auto;
    padding: 30px 20px;
    border-radius: 20px;
    width: 95%;
    max-width: 450px;
    position: relative;
    animation: modalEnter 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    max-height: 90vh;
    overflow-y: auto;
}

.close {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 22px;
    cursor: pointer;
    color: var(--secondary);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-contacts {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

.contact-chip {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-radius: 12px;
    background: var(--light);
    color: var(--secondary);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
    font-size: 0.95rem;
}

.contact-chip:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(255,107,53,0.15);
    border-color: var(--primary);
}

.contact-chip::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(120deg,
        transparent,
        rgba(255,107,53,0.1),
        transparent);
    transition: 0.6s;
}

.contact-chip:hover::before {
    left: 100%;
}

.contact-chip svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.whatsapp { background: #25D36615; color: #25D366; }
.telegram { background: #0088CC15; color: #0088CC; }
.call { background: var(--primary)15; color: var(--primary); }

.calculator-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px;
    background: var(--accent);
    color: var(--white);
    border-radius: 10px;
    text-decoration: none;
    transition: transform 0.3s;
    font-size: 0.95rem;
}

.calculator-btn:hover {
    transform: scale(1.05);
}

@keyframes modalEnter {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Стили для модального окна проверки */
#check-modal .modal-content {
    text-align: center;
}

.warning-text {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 12px;
    border-radius: 8px;
    margin: 15px 0;
    text-align: center;
    font-weight: 600;
    font-size: 0.95rem;
}

.tariffs-info {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 8px;
    margin: 15px 0;
    text-align: left;
}

.tariffs-info h3 {
    margin-bottom: 8px;
    color: var(--primary);
    text-align: center;
    font-size: 1.1rem;
}

.tariffs-info p {
    margin: 6px 0;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
}

.terms-checkbox {
    margin: 15px 0;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    text-align: left;
}

.terms-checkbox input[type="checkbox"] {
    margin-right: 8px;
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.terms-checkbox label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.95rem;
    line-height: 1.4;
}

.modal-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.modal-buttons button {
    padding: 14px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.95rem;
    min-height: 48px;
}

#confirm-order {
    background: var(--primary);
    color: white;
}

#confirm-order:disabled {
    background: #ccc;
    cursor: not-allowed;
}

#confirm-order:not(:disabled):hover {
    background: #e55a2b;
}

#cancel-order {
    background: #f8f9fa;
    color: #666;
    border: 1px solid #ddd;
}

#cancel-order:hover {
    background: #e9ecef;
}

body.modal-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

/* Стили для таймера */
#countdown {
    color: #666;
    font-size: 0.85em;
    margin-left: 4px;
    transition: all 0.3s ease;
}

/* Адаптивность для очень маленьких экранов */
@media (max-width: 360px) {
    .hero h1 {
        font-size: 1.6rem;
    }
    
    .hero p {
        font-size: 0.95rem;
    }
    
    .hero-phone {
        font-size: 1.1rem;
    }
    
    .hero-calculator-btn {
        padding: 14px 24px;
        font-size: 1rem;
        min-height: 50px;
    }
    
    .tariff-grid {
        grid-template-columns: 1fr;
    }
    
    .news-grid {
        grid-template-columns: 1fr;
    }
    
    .steps {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        padding: 25px 15px;
    }
    
    .contact-chip {
        padding: 14px 16px;
        font-size: 0.9rem;
    }
}

/* Адаптивность для средних экранов */
@media (min-width: 768px) and (max-width: 1024px) {
    .container {
        padding: 0 20px;
    }
    
    .hero h1 {
        font-size: 2.2rem;
    }
    
    .tariff-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Адаптивность для больших экранов */
@media (min-width: 1025px) {
    .hero {
        padding: 40px 0 80px;
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .city-info,
    .tariffs,
    .city-news,
    .we-work-in,
    .how-it-works {
        padding: 60px 0;
    }
}

/* Оптимизация для iOS Safari */
@supports (-webkit-touch-callout: none) {
    .hero-calculator-btn,
    .order-btn,
    .contact-chip {
        -webkit-tap-highlight-color: transparent;
    }
    
    body {
        -webkit-overflow-scrolling: touch;
    }
}

/* Оптимизация для мобильных браузеров */
@media (hover: none) {
    .tariff-card:hover,
    .news-card:hover,
    .contact-chip:hover,
    .city-link:hover {
        transform: none;
    }
    
    .order-btn:hover,
    .hero-calculator-btn:hover,
    .whatsapp-btn:hover {
        transform: none;
    }
}