/* =========================================================================
   Help-Desk — стили
   Палитра:
     --scarlet     #A6192E  основной алый
     --garnet      #6E0F1F  тёмный гранатовый (фон шапки, градиент)
     --garnet-deep #430A15  самый тёмный тон градиента
     --ember       #E63946  акцент (фокус, кнопка hover, ошибки)
     --ink         #241A18  текст на светлом фоне
     --stone       #857A75  вторичный текст
     --paper       #FBF8F6  фон карточки
     --paper-dim   #F1EAE7  фон полей ввода
   ========================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
    --scarlet: #A6192E;
    --garnet: #6E0F1F;
    --garnet-deep: #430A15;
    --ember: #E63946;
    --ink: #241A18;
    --stone: #857A75;
    --paper: #FBF8F6;
    --paper-dim: #F1EAE7;

    --radius: 14px;
    --radius-sm: 9px;
    --shadow: 0 24px 60px -24px rgba(67, 10, 21, 0.45);
    --font: 'Manrope', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    overflow-x: hidden;
}

body {
    margin: 0;
    font-family: var(--font);
    color: var(--ink);
    background: var(--paper-dim);
    line-height: 1.5;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.001ms !important;
        transition-duration: 0.001ms !important;
    }
}

/* ---------------------------------------------------------------------
   Верхняя полоса — гранатовый градиент, логотип, заголовок сервиса
   --------------------------------------------------------------------- */
.band {
    background: radial-gradient(120% 160% at 15% -20%, var(--scarlet) 0%, var(--garnet) 45%, var(--garnet-deep) 100%);
    padding: 48px 24px 56px;
    position: relative;
    overflow: hidden;
}

.band::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(60% 80% at 85% 0%, rgba(255, 255, 255, 0.08), transparent 60%);
    pointer-events: none;
}

.band__inner {
    max-width: 680px;
    margin: 0 auto;
    position: relative;
}

.logo {
    display: block;
    height: 40px;
    width: auto;
    margin-bottom: 34px;
    /* Логотип поставляется как непрозрачный цветной PNG — превращаем в белый */
    filter: brightness(0) invert(1);
}

.band h1 {
    color: #fff;
    font-size: clamp(28px, 4.4vw, 38px);
    font-weight: 800;
    letter-spacing: -0.01em;
    margin: 0 0 10px;
}

.band p {
    color: rgba(255, 255, 255, 0.82);
    font-size: 16px;
    max-width: 46ch;
    margin: 0;
}

/* ---------------------------------------------------------------------
   Карточка формы — идёт следующим блоком под полосой, без наложения
   --------------------------------------------------------------------- */
.wrap {
    max-width: 680px;
    margin: 40px auto 64px;
    padding: 0 24px;
}

.card {
    background: var(--paper);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 40px;
}

/* ---------------------------------------------------------------------
   Поля формы
   --------------------------------------------------------------------- */
.field {
    margin-bottom: 24px;
}

.field:last-of-type {
    margin-bottom: 0;
}

label,
legend {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 8px;
    padding: 0;
}

.hint {
    font-size: 13px;
    color: var(--stone);
    margin-top: 6px;
}

input[type="text"],
input[type="tel"],
input[type="email"],
select,
textarea {
    width: 100%;
    font-family: var(--font);
    font-size: 15px;
    color: var(--ink);
    background: var(--paper-dim);
    border: 1.5px solid transparent;
    border-radius: var(--radius-sm);
    padding: 13px 14px;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

textarea {
    min-height: 130px;
    resize: vertical;
}

select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%23857A75'%3E%3Cpath d='M5.5 7.5l4.5 4.5 4.5-4.5' stroke='%23857A75' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 38px;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--ember);
    background: #fff;
}

input.field--invalid,
select.field--invalid,
textarea.field--invalid {
    border-color: var(--ember);
    background: #FDECEC;
}

::placeholder {
    color: var(--stone);
}

/* ---------------------------------------------------------------------
   Способ обратной связи — переключатель + одно активное поле
   --------------------------------------------------------------------- */
fieldset {
    border: none;
    padding: 0;
    margin: 0;
}

.contact-switch {
    display: flex;
    gap: 8px;
    background: var(--paper-dim);
    border-radius: var(--radius-sm);
    padding: 4px;
    margin-bottom: 12px;
}

.contact-switch input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.contact-switch label {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-align: center;
    margin: 0;
    padding: 12px 8px 10px;
    border-radius: 7px;
    font-size: 14px;
    font-weight: 600;
    color: var(--stone);
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.contact-switch label .icon svg {
    width: 20px;
    height: 20px;
    display: block;
}

.contact-switch input:checked + label {
    background: #fff;
    color: var(--scarlet);
    box-shadow: 0 4px 14px -6px rgba(67, 10, 21, 0.3);
}

.contact-switch input:focus-visible + label {
    outline: 2px solid var(--ember);
    outline-offset: 2px;
}

/* ---------------------------------------------------------------------
   Приоритет — три равнозначных варианта
   --------------------------------------------------------------------- */
.priority-group {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.priority-group input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.priority-group label {
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-align: center;
    padding: 12px 6px 10px;
    border-radius: var(--radius-sm);
    background: var(--paper-dim);
    color: var(--ink);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    border: 1.5px solid transparent;
    transition: border-color 0.15s ease, color 0.15s ease;
}

.priority-group label .icon svg {
    width: 18px;
    height: 18px;
    display: block;
}

.priority-group input:checked + label {
    border-color: var(--scarlet);
    color: var(--scarlet);
}

.priority-group input:focus-visible + label {
    outline: 2px solid var(--ember);
    outline-offset: 2px;
}

/* ---------------------------------------------------------------------
   Капча и кнопка
   --------------------------------------------------------------------- */
.captcha-frame {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    width: 100%;
    background: var(--paper-dim);
    border: 1.5px solid transparent;
    border-radius: var(--radius-sm);
    padding: 16px;
}

.captcha-holder {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

/* Виджет Yandex SmartCaptcha рендерится сторонним скриптом с
   собственной фиксированной шириной. JS (см. index.php) измеряет его
   и масштабирует под ширину .captcha-holder, чтобы на любом экране
   виджет помещался целиком и не вылезал за карточку. */
.captcha-scale {
    transform-origin: left top;
}

.smart-captcha {
    display: inline-block;
}

.actions {
    margin-top: 28px;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

button[type="submit"] {
    font-family: var(--font);
    font-weight: 700;
    font-size: 15px;
    color: #fff;
    background: var(--scarlet);
    border: none;
    border-radius: var(--radius-sm);
    padding: 14px 30px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: background-color 0.15s ease, transform 0.1s ease;
}

button[type="submit"] .icon svg {
    width: 18px;
    height: 18px;
    display: block;
}

button[type="submit"]:hover:not(:disabled) {
    background: var(--ember);
}

button[type="submit"]:active:not(:disabled) {
    transform: translateY(1px);
}

button[type="submit"]:disabled {
    background: var(--stone);
    cursor: not-allowed;
}

button[type="submit"]:focus-visible {
    outline: 2px solid var(--ink);
    outline-offset: 2px;
}

.status-message {
    font-size: 14px;
    font-weight: 600;
}

.status-message--ok {
    color: #2E7D4F;
}

.status-message--error {
    color: var(--ember);
}

/* Скрытое поле-ловушка для ботов */
.hp-field {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

footer.legal {
    text-align: center;
    font-size: 12.5px;
    color: var(--stone);
    padding: 0 24px 40px;
}

/* ---------------------------------------------------------------------
   Адаптивность
   --------------------------------------------------------------------- */
@media (max-width: 560px) {
    .band {
        padding: 36px 18px 40px;
    }

    .wrap {
        padding: 0 16px;
        margin-top: 28px;
    }

    .card {
        padding: 26px 20px;
    }

    .captcha-frame {
        padding: 12px;
    }

    .priority-group {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }

    .priority-group label {
        flex-direction: column;
        gap: 5px;
        min-height: 62px;
        padding: 10px 4px;
        font-size: 12px;
        white-space: nowrap;
    }

    .priority-group label .icon svg {
        width: 16px;
        height: 16px;
    }

    .contact-switch {
        flex-direction: row;
        gap: 6px;
        padding: 4px;
    }

    .contact-switch label {
        flex-direction: column;
        gap: 5px;
        min-height: 62px;
        padding: 10px 4px;
        font-size: 12px;
        white-space: nowrap;
    }

    .contact-switch label .icon svg {
        width: 18px;
        height: 18px;
    }

    .actions {
        flex-direction: column;
        align-items: stretch;
    }

    button[type="submit"] {
        width: 100%;
        min-height: 52px;
        font-size: 15.5px;
    }
}

@media (max-width: 380px) {
    .card {
        padding: 22px 16px;
    }

    .priority-group,
    .contact-switch {
        gap: 4px;
    }

    .priority-group label,
    .contact-switch label {
        padding: 9px 2px;
        font-size: 11px;
    }
}