/* ===== ИМПОРТ ШРИФТА ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ===== ОБЩИЕ СТИЛИ ===== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f0f4f8;
    padding: 30px;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* ===== СТИЛЬНАЯ ШАПКА ===== */
.header {
    position: relative;
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 20px;
    padding: 0;
    margin-bottom: 40px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(226, 232, 240, 0.6);
    overflow: hidden;
}

.header-accent {
    height: 4px;
    background: linear-gradient(90deg, #3182ce, #63b3ed, #3182ce);
    background-size: 200% 100%;
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 22px 32px;
    flex-wrap: wrap;
    gap: 16px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.logo-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border-radius: 14px;
    padding: 4px 8px;
    transition: transform 0.3s ease;
}

.logo-wrapper:hover {
    transform: scale(1.03);
}

.logo {
    max-height: 45px;
    width: auto;
    object-fit: contain;
    filter: none;
}

.header-divider {
    width: 2px;
    height: 40px;
    background: linear-gradient(180deg, transparent, #cbd5e0, transparent);
}

.header-text {
    display: flex;
    flex-direction: column;
}

.header-text h1 {
    font-size: 26px;
    font-weight: 800;
    color: #1a2a4a;
    margin: 0;
    line-height: 1.2;
    letter-spacing: -0.5px;
}

.header-text h1 .highlight {
    background: linear-gradient(135deg, #3182ce, #2b6cb0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-text .subtitle {
    font-size: 14px;
    font-weight: 400;
    color: #718096;
    margin: 2px 0 0 0;
    letter-spacing: 0.2px;
}

.header-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #ebf8ff, #bee3f8);
    padding: 8px 18px 8px 14px;
    border-radius: 50px;
    border: 1px solid rgba(49, 130, 206, 0.15);
    flex-shrink: 0;
}

.badge-icon {
    font-size: 16px;
}

.badge-text {
    font-size: 13px;
    font-weight: 600;
    color: #2b6cb0;
    letter-spacing: 0.3px;
}

/* ===== ГРУППЫ РАСЧЕТОВ ===== */
.group-section {
    margin-bottom: 48px;
}

.group-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 24px;
    background: #ffffff;
    border-radius: 16px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    border-left: 4px solid #3182ce;
}

.group-icon {
    font-size: 28px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ebf8ff;
    border-radius: 12px;
    flex-shrink: 0;
}

.group-info {
    flex: 1;
}

.group-info h2 {
    font-size: 20px;
    font-weight: 700;
    color: #1a2a4a;
    margin: 0;
}

.group-info p {
    font-size: 14px;
    color: #718096;
    margin: 2px 0 0 0;
}

.group-count {
    font-size: 13px;
    font-weight: 600;
    color: #2b6cb0;
    background: #ebf8ff;
    padding: 4px 14px;
    border-radius: 20px;
    white-space: nowrap;
}

/* ===== СЕТКА КАРТОЧЕК (НЕ РАСТЯГИВАЕТСЯ) ===== */
.calculators-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

/* ===== КАРТОЧКА КАЛЬКУЛЯТОРА ===== */
.calculator-card {
    display: block;
    background: #ffffff;
    border-radius: 14px;
    padding: 22px 20px;
    text-decoration: none;
    color: #1a2a4a;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    transition: transform 0.2s ease, box-shadow 0.3s ease, border-color 0.2s ease;
    border: 2px solid transparent;
}

.calculator-card:hover:not(.disabled) {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
    border-color: #3182ce;
}

.calculator-card.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.calculator-card.disabled:hover {
    transform: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.card-icon {
    font-size: 32px;
    margin-bottom: 10px;
    display: block;
}

.calculator-card h3 {
    font-size: 17px;
    font-weight: 700;
    color: #1a2a4a;
    margin-bottom: 6px;
}

.calculator-card p {
    font-size: 13px;
    color: #4a5568;
    line-height: 1.5;
    margin-bottom: 12px;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.tag {
    background: #edf2f7;
    color: #2d3748;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.card-status {
    font-size: 12px;
    font-weight: 600;
    padding-top: 10px;
    border-top: 1px solid #edf2f7;
}

.card-status.active {
    color: #38a169;
}

.card-status.in-progress {
    color: #d69e2e;
}

/* =============================================================
   БЛОК: КАК ПОЛЬЗОВАТЬСЯ КАЛЬКУЛЯТОРАМИ (РАСТЯГИВАЕТСЯ)
   ============================================================= */
.howto-section {
    background: #ffffff;
    border-radius: 16px;
    padding: 30px 32px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
}

.howto-section h2 {
    font-size: 20px;
    color: #1a2a4a;
    margin-bottom: 24px;
    text-align: center;
}

.howto-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px 16px;
    background: #f8fafc;
    border-radius: 12px;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
}

.step:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.06);
}

.step-number {
    width: 48px;
    height: 48px;
    background: #3182ce;
    color: #ffffff;
    font-size: 20px;
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    flex-shrink: 0;
}

.step-content h3 {
    font-size: 16px;
    font-weight: 700;
    color: #1a2a4a;
    margin-bottom: 6px;
}

.step-content p {
    font-size: 14px;
    color: #4a5568;
    line-height: 1.5;
    margin: 0;
}

/* ===== КОНТАКТЫ ===== */
.contact-section {
    background: #1a2a4a;
    border-radius: 16px;
    padding: 32px 36px;
    color: #ffffff;
    text-align: center;
}

.contact-section h2 {
    font-size: 20px;
    margin-bottom: 8px;
}

.contact-section p {
    font-size: 14px;
    opacity: 0.8;
    margin-bottom: 18px;
}

.contact-links {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
}

.contact-link {
    color: #ffffff;
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    padding: 8px 18px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    transition: background 0.2s;
}

.contact-link:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* ===== МОБИЛЬНАЯ АДАПТАЦИЯ ===== */

/* Планшеты и маленькие экраны (до 768px) */
@media (max-width: 768px) {
    .header-inner {
        flex-direction: column;
        align-items: flex-start;
        padding: 18px 20px;
    }

    .header-left {
        flex-wrap: wrap;
        gap: 14px;
    }

    .header-divider {
        display: none;
    }

    .header-text h1 {
        font-size: 20px;
    }

    .header-text .subtitle {
        font-size: 13px;
    }

    .header-badge {
        align-self: flex-start;
        padding: 6px 14px 6px 12px;
    }

    .badge-text {
        font-size: 12px;
    }

    .logo {
        max-height: 35px;
    }

    .group-header {
        flex-wrap: wrap;
        padding: 14px 18px;
    }

    .group-count {
        font-size: 12px;
        padding: 2px 12px;
    }

    .group-icon {
        width: 40px;
        height: 40px;
        font-size: 22px;
    }

    .group-info h2 {
        font-size: 17px;
    }

    .howto-steps {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .step {
        padding: 14px 10px;
    }

    .step-number {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    .step-content h3 {
        font-size: 14px;
    }

    .step-content p {
        font-size: 12px;
    }
}

/* Телефоны (до 600px) */
@media (max-width: 600px) {
    body {
        padding: 16px;
    }

    .howto-section {
        padding: 20px 16px;
    }

    .howto-section h2 {
        font-size: 17px;
    }

    .howto-steps {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .step {
        padding: 12px 8px;
        border-radius: 8px;
    }

    .step-number {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }

    .step-content h3 {
        font-size: 13px;
    }

    .step-content p {
        font-size: 11px;
    }

    .calculators-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .contact-section {
        padding: 20px;
    }

    .contact-links {
        flex-direction: column;
        align-items: center;
    }

    .contact-link {
        width: 100%;
        text-align: center;
    }
}

/* Маленькие телефоны (до 400px) — одна колонка */
@media (max-width: 400px) {
    .howto-steps {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .step {
        flex-direction: row;
        align-items: center;
        text-align: left;
        gap: 14px;
        padding: 12px 14px;
    }

    .step-number {
        width: 32px;
        height: 32px;
        font-size: 13px;
        flex-shrink: 0;
        margin-bottom: 0;
    }

    .step-content h3 {
        font-size: 13px;
        margin-bottom: 2px;
    }

    .step-content p {
        font-size: 11px;
    }
}