/* ============================================================
   Contact Form 7 — стили под тему Ark-M
   ============================================================ */

/* Обёртка формы */
.wpcf7 {
    max-width: 100%;
}

.wpcf7 form {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

/* Поля */
.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 input[type="tel"],
.wpcf7 input[type="number"],
.wpcf7 input[type="date"],
.wpcf7 select,
.wpcf7 textarea {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 15px;
    font-family: inherit;
    background: #fff;
    color: var(--ink);
    transition: border-color .3s, box-shadow .3s;
}

.wpcf7 input:not([type="submit"]):focus,
.wpcf7 select:focus,
.wpcf7 textarea:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(233, 161, 59, 0.2);
}

.wpcf7 textarea {
    min-height: 100px;
    resize: vertical;
}

/* Чекбоксы и радио */
.wpcf7 input[type="checkbox"],
.wpcf7 input[type="radio"] {
    accent-color: var(--gold);
    /* width: 18px;
    height: 18px; */
}

.wpcf7 .wpcf7-list-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    color: var(--ink-light);
}

/* Кнопка отправки */
.wpcf7 input[type="submit"] {
    padding: 15px;
    background: linear-gradient(#ffd17a, var(--gold));
    color: #172d22;
    font-weight: bold;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    box-shadow: 0 3px 0 #a66b21;
    transition: transform .3s, box-shadow .3s;
}

.wpcf7 input[type="submit"]:focus {
    box-shadow: 0 1px 0 #a66b21;
}

/* Сообщения об успехе / ошибке */
.wpcf7 form.sent .wpcf7-response-output {
    background: #e8f5ec;
    border: 2px solid #46b450;
    color: #1a5c2a;
    padding: 14px 18px;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.5;
}

.wpcf7 form.failed .wpcf7-response-output,
.wpcf7 form.invalid .wpcf7-response-output {
    background: #fdf0f0;
    border: 2px solid #dc3232;
    color: #7a1f1f;
    padding: 14px 18px;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.5;
}

/* Ошибки валидации на полях */
.wpcf7-not-valid-tip {
    color: #dc3232;
    font-size: 12px;
    margin-top: 4px;
    display: block;
}

/* Спиннер отправки */
.wpcf7-spinner {
    margin: 10px auto;
    display: none;
}

.privacy-links {
    color: #a66a19;
    text-decoration: underline;
}

/* ============================================================
   Квиз: финальная форма CF7 (изоляция от общих стилей)
   ============================================================ */
.quiz-final-form .wpcf7 {
    max-width: 100%;
}

.quiz-final-form .wpcf7 form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* CF7 оборачивает поля в <p> — убираем отступы, чтобы вёрстка совпала с квизом */
.quiz-final-form .wpcf7 form > p {
    margin: 0;
    width: 100%;
}

.quiz-final-form .wpcf7 input[type="text"],
.quiz-final-form .wpcf7 input[type="tel"],
.quiz-final-form .wpcf7 input[type="email"] {
    width: 100%;
    padding: 15px 20px;
    border-radius: 4px;
    border: 1px solid var(--border);
    background: var(--white);
    color: var(--ink);
    font-size: 15px;
    font-family: inherit;
    transition: border-color .3s, box-shadow .3s;
}

.quiz-final-form .wpcf7 input:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(233, 161, 59, 0.2);
}

.quiz-final-form .wpcf7 input::placeholder {
    color: #999;
}

/* Кнопка — переиспользует вид .btn-header */
.quiz-final-form .wpcf7 input[type="submit"] {
    width: 100%;
    padding: 14px 30px;
    background: linear-gradient(#ffd17a, var(--gold));
    color: #172d22;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    font-family: inherit;
    transition: transform .25s, box-shadow .25s;
}

.quiz-final-form .wpcf7 input[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-gold);
}

.quiz-final-form .wpcf7-spinner {
    display: none;
}

/* Сообщения CF7 внутри квиза */
.quiz-final-form .wpcf7-response-output {
    margin: 12px 0 0;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.5;
}

.quiz-final-form .wpcf7 form.sent .wpcf7-response-output {
    background: #e8f5ec;
    border: 2px solid #46b450;
    color: #1a5c2a;
}

.quiz-final-form .wpcf7 form.failed .wpcf7-response-output,
.quiz-final-form .wpcf7 form.invalid .wpcf7-response-output {
    background: #fdf0f0;
    border: 2px solid #dc3232;
    color: #7a1f1f;
}

.quiz-final-form .wpcf7-not-valid-tip {
    color: #dc3232;
    font-size: 12px;
    margin-top: 4px;
    display: block;
}

/* Если форма не выбрана в ACF */
.quiz-cf7-missing {
    font-size: 14px;
    color: var(--ink-light);
    text-align: center;
}

.choice-row .wpcf7-form-control.wpcf7-radio {
    display: flex;
    column-gap: 7px;
}

/* ===== Блок «Форма заявки» ===== */
.application-form-section {
    background: linear-gradient(135deg, #f8f0e4, #fffdf8 55%, #efe0ca);
    padding: 56px 0;
}

.application-intro {
    max-width: 850px;
    margin: 0 auto 28px;
    text-align: center;
}
.application-intro h2 {
    font: 700 clamp(29px, 3vw, 40px)/1.15 Georgia, serif;
    color: var(--green, #07392e);
    margin: 0 0 12px;
}
.application-intro h2 span {
    color: #d78324;
}
.application-intro p {
    line-height: 1.55;
    color: var(--muted, #52645e);
    margin: 8px 0;
}
.application-intro .legal-note {
    font-style: italic;
}

/* Оболочка формы */
.form-shell {
    max-width: 1000px;
    margin: auto;
    background: #fffdf9;
    border: 1px solid #dfc99f;
    border-radius: 10px;
    padding: clamp(18px, 3vw, 36px);
    box-shadow: 0 18px 40px #553b1b12;
}

/* Группы полей */
.form-group {
    border: 1px solid #eadbc5;
    border-radius: 7px;
    padding: 22px;
    margin: 0 0 18px;
    background: linear-gradient(140deg, #fff, #fdf8f0);
}
.form-group h3 {
    font: 700 21px Georgia, serif;
    color: var(--green, #07392e);
    margin: 0 0 18px;
    padding-bottom: 11px;
    border-bottom: 1px solid #e6d3b3;
}

/* Сетка полей */
.form-grid {
    display: grid;
    /* grid-template-columns: repeat(2, minmax(0, 1fr)); */
    gap: 15px 18px;
    margin-top: 15px;
}
.field {
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-width: 0;
}
.field.full {
    grid-column: 1 / -1;
}

[data-name="personal_data_consent"] a {
    color: #a66a19;
    text-decoration: underline;
}

.wpcf7-form-control.wpcf7-radio {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    align-items: center;
    min-height: 42px;
}

.upload-box {
    border: 1px dashed #cba45e;
    background: #fcf6eb;
    border-radius: 6px;
    padding: 18px;
}

/* Лейблы */
.field label,
.field-label {
    font-size: 13px;
    line-height: 1.35;
    font-weight: 700;
    color: #26473e;
}
.required {
    color: #bf7620;
}

/* Инпуты (общие для input/select/textarea) */
.field input[type="text"],
.field input[type="tel"],
.field input[type="email"],
.field input[type="date"],
.field input[type="number"],
.field select,
.field textarea {
    width: 100%;
    min-width: 0;
    border: 1px solid #d8c8b0;
    border-radius: 5px;
    background: #fff;
    padding: 12px 13px;
    font: 14px Arial, sans-serif;
    color: #17392f;
    box-sizing: border-box;
}
.field textarea {
    min-height: 90px;
    resize: vertical;
}

/* Радио/чекбоксы */
.choice-row {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    align-items: center;
    min-height: 42px;
}
.choice-row label {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    font-weight: 400;
}
.choice-row input,
.consent-box input {
    width: auto;
    accent-color: #0a4a39;
}

/* Согласие */
.consent-box {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 12px;
    line-height: 1.55;
    color: #445b52;
    margin: 20px 0;
}
.consent-box input {
    margin-top: 3px;
    flex-shrink: 0;
}
.consent-box a,
.confirm-links a {
    color: #a66a19;
    text-decoration: underline;
}

/* Кнопка + подсказка */
.form-submit-row {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}
.form-hint {
    font-size: 11px;
    color: #69776f;
    line-height: 1.5;
}

/* Блок после отправки */
.after-submit {
    margin-top: 25px;
    background: #f5ead8;
    border-left: 4px solid #d69b39;
    border-radius: 4px;
    padding: 17px 20px;
    font-size: 13px;
    line-height: 1.55;
}
.confirm-links {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 12px;
}
.confirm-links a {
    display: inline-flex;
    padding: 10px 13px;
    border: 1px solid #d8b776;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 700;
    background: #fffaf1;
    color: #a66a19;
}

/* input[type="submit"],
.wpcf7-submit {
    display: inline-block;
    background: linear-gradient(#ffd580, #e8a43f);
    color: #18372b;
    font-weight: bold;
    border-radius: 5px;
    padding: 14px 20px;
    border: 0;
    box-shadow: 0 3px 0 #a66b21;
    cursor: pointer;
    font-size: 14px;
} */

.wpcf7-response-output {
    margin: 18px 0 0;
    padding: 12px 15px;
    border-radius: 5px;
    font-size: 13px;
}

/* ===== Адаптив ===== */
@media (max-width: 650px) {
    .application-form-section { padding: 36px 0; }
    .form-grid { grid-template-columns: 1fr; }
    .field.full { grid-column: auto; }
    .form-group { padding: 16px; }
    .form-submit-row .wpcf7-submit,
    .form-submit-row input[type="submit"] { width: 100%; }
    .confirm-links { flex-direction: column; }
    .confirm-links a { justify-content: center; }
}

.choice-row .wpcf7-list-item {
    margin: 0;
}
.choice-row .wpcf7-list-item label {
    display: flex;
    align-items: center;
    gap: 7px;
    font-weight: 400;
    font-size: 13px;
}
[acceptance] {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 12px;
    line-height: 1.55;
    color: #445b52;
    margin: 20px 0;
}
[acceptance] input { margin-top: 3px; flex-shrink: 0; }
[acceptance] a { color: #a66a19; text-decoration: underline; }

/* ===== Стилизация ТОЛЬКО чекбоксов (плитки в 2 колонки) ===== */

/* Сетка для чекбоксов */
.choice-row.checkbox .wpcf7-form-control.wpcf7-checkbox {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr)); /* 2 колонки */
    gap: 10px;
    margin-top: 8px;
}

/* На мобильных — 1 колонка */
@media (max-width: 640px) {
    .choice-row.checkbox .wpcf7-form-control.wpcf7-checkbox {
        grid-template-columns: 1fr;
    }
}

/* Обёртка CF7 для каждого пункта */
.choice-row.checkbox .wpcf7-list-item {
    margin: 0;
    display: block;
}

/* Плитка (label) */
.choice-row.checkbox .wpcf7-list-item label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: #fffdf9;
    border: 1px solid #e6d6bf;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 400;
    color: #26473e;
    cursor: pointer;
    transition: all 0.2s ease;
    height: 100%;
    box-sizing: border-box;
}

/* Ховер */
.choice-row.checkbox .wpcf7-list-item label:hover {
    border-color: #d8a44c;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

/* Скрываем стандартный чекбокс и рисуем свой */
.choice-row.checkbox .wpcf7-list-item input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 1px solid #cba45e;
    border-radius: 3px;
    background: #fff;
    margin: 0;
    flex-shrink: 0;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
}

/* Выбранный чекбокс */
.choice-row.checkbox .wpcf7-list-item input[type="checkbox"]:checked {
    background: #07392e;
    border-color: #07392e;
}

/* Галочка внутри */
.choice-row.checkbox .wpcf7-list-item input[type="checkbox"]:checked::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 1px;
    width: 5px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Подсветка плитки, если чекбокс выбран */
.choice-row.checkbox .wpcf7-list-item label:has(input:checked) {
    border-color: #07392e;
    background: #f8f4eb;
}