html { height: 100%; }
body {
    font-family: Inter, system-ui, -apple-system, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f5f6fa;
    color: #333b52;
    min-height: 100%;
    display: flex;
    flex-direction: column;
}
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 5%;
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: relative;
}
.call-group {
    display: flex;
    align-items: center;
}
#callBtn {
    background: linear-gradient(138deg, #0040ff, #547fff);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    min-width: 195px;
    white-space: nowrap;
    position: relative;
    transition: box-shadow 0.3s ease, transform 0.2s ease;
    box-shadow: 0 0 8px 4px rgba(0, 64, 255, 0.15);
}
#callBtn:hover { box-shadow: 0 0 12px 6px rgba(0, 64, 255, 0.25); transform: scale(1.05); }
#callBtn:active { transform: scale(0.95); }

#callBtn.end-call {
    background: linear-gradient(138deg, #0040ff, #547fff);
    box-shadow: 0 0 8px 4px rgba(0, 64, 255, 0.15);
    animation: btnPulse 1.4s ease-in-out infinite;
}
#callBtn.end-call:hover {
    box-shadow: 0 0 12px 6px rgba(0, 64, 255, 0.25);
}

/* Пульсация кнопки звонка во время разговора/вызова */
@keyframes btnPulse {
    0%, 100% { box-shadow: 0 0 10px 6px rgba(0, 64, 255, 0.35); transform: scale(1); }
    50% { box-shadow: 0 0 20px 12px rgba(0, 64, 255, 0.6); transform: scale(1.06); }
}

/* Иконки в кнопках шапки */
#callBtn::before,
#writeBotBtn::before {
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    -webkit-font-smoothing: antialiased;
    font-size: 1em;
}
#callBtn::before { content: "\f095"; margin-right: 8px; }   /* fa-phone */
#writeBotBtn::before { content: "\f075"; margin-right: 8px; } /* fa-comment */

/*
 * Во время звонка: телефон остаётся в ТОЙ ЖЕ позиции (тот же глиф fa-phone),
 * поверх него рисуется только перечёркивающая линия (::after).
 * Так иконки «готов к звонку» и «разговор» отличаются лишь чертой.
 */
#callBtn.end-call::after {
    content: "";
    position: absolute;
    height: 3px;
    width: 26px;
    background: #fff;
    border-radius: 2px;
    /* десктоп: линия поверх иконки телефона слева */
    left: 28px;
    top: 50%;
    transform: translate(-50%, -50%) rotate(-45deg);
    pointer-events: none;
}

.status-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-left: 20px;
    transition: background 0.3s ease;
    flex-shrink: 0;
}
@keyframes pulse {
    0%, 100% { box-shadow: 0 0 4px 2px rgba(56, 255, 184, 0.3); transform: scale(1); }
    50% { box-shadow: 0 0 10px 5px rgba(56, 255, 184, 0.6); transform: scale(1.2); }
}
.status-dot.offline { background: #888c99; }
.status-dot.connecting { background: #ffc107; }
.status-dot.ready { background: linear-gradient(138deg, #0040ff, #547fff); }
.status-dot.calling { background: #ffc107; }
.status-dot.talk { background: #38ffb8; animation: pulse 1.5s ease-in-out infinite; }
.status-dot.error { background: #888c99; }

.status-text {
    margin-left: 6px;
    font-size: 0.8em;
    color: #333b52;
    transition: color 0.3s ease;
    white-space: nowrap;
}

.logo { font-size: 1.5em; font-weight: 700; }
nav {
    display: flex;
    align-items: center;
}
nav a {
    margin: 0 15px;
    text-decoration: none;
    color: #333b52;
    font-weight: 500;
    transition: color 0.3s ease;
}
nav a:hover { color: #1f4eda; }

.burger {
    display: none;
    font-size: 1.5em;
    background: none;
    border: none;
    cursor: pointer;
    color: #1f4eda;
}
.nav-mobile {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 60px;
    left: 0;
    width: 100%;
    background: white;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}
.nav-mobile a {
    padding: 15px;
    margin: 0;
    border-bottom: 1px solid #eee;
}
.nav-mobile a:last-child { border-bottom: none; }
.nav-mobile.active { display: flex; }

.hero { text-align: center; padding: 100px 10%; }
.hero h1 { font-size: 2.5em; margin-bottom: 10px; font-weight: 700; color: #0d0f2c; }
.hero p { font-size: 1.2em; margin-bottom: 20px; line-height: 1.6; }
.cta {
    display: inline-block;
    padding: 12px 28px;
    background: linear-gradient(138deg, #0040ff, #547fff);
    color: white;
    text-decoration: none;
    border-radius: 99px;
    font-weight: 600;
    font-size: 1em;
    cursor: pointer;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    box-shadow: 0 0 8px 4px rgba(0, 64, 255, 0.15);
}
.cta:hover { box-shadow: 0 0 12px 6px rgba(0, 64, 255, 0.25); transform: scale(1.05); }

.services {
    display: grid;
    grid-template-columns: repeat(4, 340px);
    gap: 20px;
    padding: 50px 10%;
    justify-content: center;
    max-width: 1440px;
    margin: 0 auto;
}
.service-card {
    position: relative;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    padding: 30px;
    width: 100%;
    min-height: 220px;
    height: auto;
    display: flex;
    flex-direction: column;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box;
}
.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}
.service-card i {
    font-size: 2em;
    color: #1f4eda;
    margin-bottom: 0;
}
.service-card h3 {
    margin: 8px 0 6px;
    color: #0d0f2c;
    font-size: 19px;
    font-weight: 600;
}
.service-card p {
    margin: 0 0 12px;
    color: #888c99;
    font-size: 17px;
    font-weight: 500;
    line-height: 1.3;
    flex-shrink: 0;
}
.service-card audio {
    width: 100%;
    height: 40px;
    margin-top: auto;
}

main { flex: 1 0 auto; }

footer {
    text-align: center;
    padding: 20px;
    background: white;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}
footer a { color: #333b52; text-decoration: none; margin: 0 5px; font-weight: 500; }
footer a:hover { text-decoration: underline; }

.popup {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 20px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    text-align: center;
    width: 300px;
    z-index: 1000;
}
.popup input {
    width: 90%;
    padding: 10px;
    margin: 10px 0;
    border: 1px solid #ccc;
    border-radius: 5px;
}
.popup button {
    background: linear-gradient(138deg, #0040ff, #547fff);
    color: white;
    border: none;
    padding: 10px;
    width: 100%;
    border-radius: 99px;
    font-weight: 500;
    cursor: pointer;
    transition: box-shadow 0.3s ease;
}
.popup button:hover { box-shadow: 0 0 8px 4px rgba(0, 64, 255, 0.25); }
.popup textarea {
    width: 90%;
    padding: 10px;
    margin: 10px 0;
    border: 1px solid #ccc;
    border-radius: 5px;
    resize: vertical;
}

.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

#messageContainer {
    padding: 20px;
    text-align: center;
}
#messageContainer.success {
    color: #38ffb8;
    font-weight: 600;
}
#messageContainer.error {
    color: #888c99;
}
#messageContainer button {
    background: linear-gradient(138deg, #0040ff, #547fff);
    color: white;
    border: none;
    padding: 10px;
    width: 100%;
    border-radius: 99px;
    font-weight: 500;
    cursor: pointer;
    margin-top: 15px;
    transition: box-shadow 0.3s ease;
}
#messageContainer button:hover {
    box-shadow: 0 0 8px 4px rgba(0, 64, 255, 0.25);
}

/* ───────── Написать боту ───────── */

#writeBotBtn {
    background: linear-gradient(138deg, #0040ff, #547fff);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: box-shadow 0.3s ease, transform 0.2s ease;
    box-shadow: 0 0 8px 4px rgba(0, 64, 255, 0.15);
}
#writeBotBtn:hover { box-shadow: 0 0 12px 6px rgba(0, 64, 255, 0.25); transform: scale(1.05); }
#writeBotBtn:active { transform: scale(0.95); }

/* ───────── Адаптивность ───────── */

@media (max-width: 1200px) {
    .services {
        grid-template-columns: repeat(2, 340px);
    }
}

@media (max-width: 768px) {
    nav { display: none; }
    .burger { display: block; }
    header {
        padding: 15px 5%;
        flex-wrap: wrap;
        gap: 10px;
    }
    .call-group { min-width: 0; flex: 1 1 auto; }

    /* Кнопки шапки — одинаковые круглые иконки для смартфона */
    #callBtn,
    #writeBotBtn {
        width: 44px;
        height: 44px;
        min-width: 0;
        padding: 0;
        border-radius: 50%;
        font-size: 0;          /* текст скрыт — остаётся только иконка */
        display: inline-flex;
        align-items: center;
        justify-content: center;
        white-space: nowrap;
        flex-shrink: 0;
    }
    #callBtn.end-call {
        font-size: 0;
    }
    #callBtn::before,
    #writeBotBtn::before {
        margin-right: 0;
        font-size: 18px;
        line-height: 1;
    }
    /* мобильная: линия строго по центру круглой кнопки — поверх трубки */
    #callBtn.end-call::after {
        left: 50%;
        top: 50%;
        width: 24px;
    }
    .status-text {
        font-size: 0.75em;
        color: #333b52;
        white-space: normal;
    }
    .status-dot { margin-left: 8px; }
    .logo { font-size: 1.2em; }
    .hero h1 { font-size: 1.8em; }
    .hero { padding: 50px 5%; }
    .services {
        grid-template-columns: 1fr;
        padding: 40px 5%;
    }
    .service-card {
        height: auto;
        padding: 20px;
        max-width: 400px;
        margin: 0 auto;
    }
    .service-card p {
        margin-bottom: 12px;
    }
    .popup { width: 90%; max-width: 300px; }
    .cta { padding: 12px 24px; font-size: 0.95em; }
}

@media (max-width: 400px) {
    /* чуть меньше на очень узких экранах, но по-прежнему одинаковые */
    #callBtn,
    #writeBotBtn {
        width: 40px;
        height: 40px;
    }
    #callBtn::before,
    #writeBotBtn::before {
        font-size: 16px;
    }
}
