/* ========================================
   HEAD.CSS - Тарифный калькулятор
   Стили для главной страницы
   ======================================== */

/* ----------------------------------------
   1. Базовые стили
   ---------------------------------------- */
body {
    font-family: 'Inter', sans-serif;
}

.main-background {
    position: relative;
    width: 100%;
    min-height: 100vh;
    background: #FFFFFF;
}

/* ----------------------------------------
   2. Шапка (header)
   ---------------------------------------- */
header {
    position: relative;
    width: 100%;
    height: 103px;
    z-index: 20;
}

/* Иконка слева */
.header-left {
    position: absolute;
    left: 32px;
    top: 28px;
    width: 52px;
    height: 52px;
}

.active-icon {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 60px;
    background: rgba(0, 112, 133, 0.05);
}

/* Контент шапки */
.header-content {
    position: absolute;
    left: 104px;
    top: 27px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
}

.header-title {
    font-weight: 600;
    font-size: 32px;
    line-height: 30px;
    color: #16151C;
    margin: 0;
}

.header-description {
    font-weight: 300;
    font-size: 14px;
    line-height: 22px;
    color: #A2A1A8;
    margin: 0;
    margin-top: 4px;
}

/* ----------------------------------------
   3. Основной контейнер
   ---------------------------------------- */
.main-container {
    position: relative;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    margin-top: 120px;
    z-index: 10;
    padding-bottom: 40px;
}

/* ----------------------------------------
   4. Текстовый блок (заголовок + описание)
   ---------------------------------------- */
.main-text {
    text-align: center;
    margin-bottom: 60px;
    padding: 0 20px;
    position: relative;
    z-index: 1;
}

.main-title {
    font-weight: 600;
    font-size: 50px;
    line-height: 40px;
    letter-spacing: -0.02em;
    color: #000000;
    margin: 0;
    margin-bottom: 20px;
}

.main-description {
    font-weight: 300;
    font-size: 22px;
    line-height: 22px;
    color: rgba(22, 21, 28, 0.7);
    margin: 0;
    max-width: 516px;
    margin-left: auto;
    margin-right: auto;
}

/* ----------------------------------------
   5. Сетка с карточками (3 колонки)
   ---------------------------------------- */
.service-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-top: 60px;
    margin-bottom: 60px;
    position: relative;
    z-index: 1;
}

/* Карточка */
.service-card {
    position: relative;
    background: #FFFFFF;
    box-shadow: 0px 5px 16px rgba(22, 21, 28, 0.1);
    border-radius: 20px;
    height: 276px;
}

/* Иконка внутри карточки */
.card-icon {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 14%;
    width: auto;
    max-width: 60%;
    height: auto;
    object-fit: contain;
}

/* Текст внутри карточки */
.card-text {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 30px;
    width: 85%;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100px;
}

.card-link {
    font-weight: 200;
    font-size: 20px;
    line-height: 22px;
    text-align: center;
    color: #16151C;
    text-decoration: none;
    display: block;
    transition: color 0.2s;
}

.card-link:hover {
    color: #007085;
}

.card-link strong {
    font-weight: 600;
}

/* ----------------------------------------
   6. Фоновое свечение
   ---------------------------------------- */
.bg-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 180%;
    height: 180%;
    background: radial-gradient(circle, rgba(0, 112, 133, 1) 0%, rgba(0, 112, 133, 0.8) 20%, rgba(0, 112, 133, 0.4) 50%, rgba(0, 112, 133, 0) 80%);
    filter: blur(20px);
    z-index: 0;
    pointer-events: none;
}

/* ----------------------------------------
   7. Медиа-запросы
   ---------------------------------------- */

/* ------ 7.1. Для очень больших экранов (1920px+) ------ */
@media (min-width: 1920px) {
    .main-background {
        max-width: 1920px;
        margin: 0 auto;
    }

    header {
        width: 1920px;
        left: calc(50% - 1920px/2);
        margin: 0 auto;
    }

    .main-text {
        margin-top: 40px;
    }
}

/* ------ 7.2. Для планшетов и маленьких ноутбуков (768-1024px) ------ */
@media (max-width: 1024px) and (min-width: 769px) {
    .card-link {
        font-size: 16px;
        line-height: 20px;
    }

    .card-text {
        bottom: 20px;
        width: 90%;
    }
}

/* ------ 7.3. Для мобильных устройств (максимум 768px) ------ */
@media (max-width: 768px) {
    /* ----- 7.3.1. Шапка ----- */
    .header-left {
        left: 16px;
        top: 20px;
        width: 40px;
        height: 40px;
    }

    .header-content {
        left: 70px;
        top: 20px;
    }

    .header-title {
        font-size: 20px;
        line-height: 24px;
    }

    .header-description {
        font-size: 10px;
        line-height: 14px;
    }

    /* ----- 7.3.2. Основной контейнер ----- */
    .main-container {
        margin-top: 100px;
        padding: 20px 15px 30px;
        position: relative;
        top: auto;
        left: auto;
        transform: none;
    }

    /* ----- 7.3.3. Текстовый блок ----- */
    .main-title {
        font-size: 28px;
        line-height: 32px;
    }

    .main-description {
        font-size: 18px;
        line-height: 20px;
    }

    .main-text {
        margin-top: 20px;
        margin-bottom: 30px;
    }

    /* ----- 7.3.4. Сетка - одна колонка ----- */
    .service-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 0 20px;
        max-width: 400px;
        margin-left: auto;
        margin-right: auto;
        margin-top: 40px;
    }

    /* ----- 7.3.5. Карточки ----- */
    .service-card {
        height: auto;
        min-height: 200px;
        padding: 20px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
    }

    .card-icon {
        max-width: 80px;
        max-height: 80px;
        position: relative;
        left: auto;
        top: auto;
        transform: none;
        margin: 10px auto 10px;
        display: block;
        flex-shrink: 0;
    }

    .card-text {
        position: relative;
        left: auto;
        transform: none;
        bottom: auto;
        width: 100%;
        min-height: auto;
        margin-top: 0;
        padding: 10px 0;
        flex-grow: 1;
    }

    .card-link {
        font-size: 18px;
        line-height: 20px;
        position: relative;
        text-align: center;
    }

    .main-background {
        min-height: auto;
    }
}

/* ------ 7.4. Центрирование по вертикали для высоких экранов ------ */
@media (min-height: 900px) and (min-width: 769px) {
    .main-container {
        margin-top: 0;
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        margin: 0;
    }
}

/* ------ 7.5. Корректировка для очень высоких экранов ------ */
@media (min-height: 1080px) and (min-width: 769px) {
    .main-container {
        transform: translate(-50%, -50%);
    }
}

/* ------ 7.6. Для экранов с маленькой высотой ------ */
@media (max-height: 700px) {
    .main-container {
        margin-top: 80px;
        position: relative;
        top: auto;
        left: auto;
        transform: none;
    }
}

/* ----------------------------------------
   8. Дополнительно: выделение текста
   ---------------------------------------- */
.main-container ::selection {
    background-color: rgba(0, 112, 133, 0.2);
    color: rgba(22, 21, 28, 0.7);
}