/**
 * Contact Form 7 — HRA / resit course pages.
 *
 * The form is embedded inside the "Why OSCE" footer note, which is a
 * `.base-note`: uppercase text, an icon and tight side padding. Those styles
 * are meant for a one-line tip, not a multi-field form, so this file first
 * neutralises them for a note that holds a form, then styles the fields:
 * white pill inputs on the grey card, custom checkboxes, full-width CTA.
 *
 * Scoped to .hra-course so no other template is affected.
 */

/* --- card that holds the form ------------------------------------------- */

.hra-course .why-osce-footer-note:has(.wpcf7) {
    padding: 40px;
    text-transform: none;
    text-align: left;
}

.hra-course .why-osce-footer-note:has(.wpcf7):before {
    content: none;
}

.hra-course .why-osce-footer-note h2 {
    margin: 0 0 24px;
    font-size: 24px;
    line-height: 32px;
    text-transform: none;
}

/* Fallback for browsers without :has() — at least kills the inherited uppercase. */
.hra-course .wpcf7 {
    text-transform: none;
}

/* --- layout -------------------------------------------------------------- */

.hra-course .wpcf7-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 640px;
    margin: 0 auto;
    font-size: 16px;
    line-height: 23px;
    color: var(--body-caption);
    text-align: left;
}

.hra-course .wpcf7-form > .wpcf7-form-control-wrap,
.hra-course .wpcf7-form > p {
    margin: 0;
}

.hra-course .wpcf7-form-control-wrap {
    display: block;
}

/* --- text inputs --------------------------------------------------------- */

.hra-course .wpcf7-form input[type="text"],
.hra-course .wpcf7-form input[type="email"],
.hra-course .wpcf7-form input[type="url"],
.hra-course .wpcf7-form input[type="tel"],
.hra-course .wpcf7-form input[type="number"],
.hra-course .wpcf7-form input[type="date"],
.hra-course .wpcf7-form select,
.hra-course .wpcf7-form textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 17px 22px;
    border: 1px solid transparent;
    border-radius: 14px;
    background-color: #fff;
    font-family: inherit;
    font-size: 16px;
    line-height: 23px;
    color: var(--body-text);
    transition: border-color .2s ease, box-shadow .2s ease;
}

.hra-course .wpcf7-form textarea {
    min-height: 150px;
    resize: vertical;
}

.hra-course .wpcf7-form input::placeholder,
.hra-course .wpcf7-form textarea::placeholder {
    color: var(--body-subtext);
    opacity: 1;
}

.hra-course .wpcf7-form input:focus,
.hra-course .wpcf7-form select:focus,
.hra-course .wpcf7-form textarea:focus {
    outline: none;
    border-color: var(--main-lavanda);
    box-shadow: 0 0 0 3px rgba(101, 88, 153, .12);
}

/* --- checkbox / radio groups -------------------------------------------- */

.hra-course .wpcf7-form .wpcf7-checkbox,
.hra-course .wpcf7-form .wpcf7-radio,
.hra-course .wpcf7-form .wpcf7-acceptance {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
}

.hra-course .wpcf7-form .wpcf7-list-item {
    margin: 0;
}

.hra-course .wpcf7-form .wpcf7-list-item label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0;
    font-weight: 400;
    cursor: pointer;
}

/* The real input stays in the DOM (CF7 exclusive-checkbox JS listens to it) —
   it is only visually replaced, so validation and scripts keep working. */
.hra-course .wpcf7-form .wpcf7-list-item input[type="checkbox"],
.hra-course .wpcf7-form .wpcf7-list-item input[type="radio"] {
    flex-shrink: 0;
    appearance: none;
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    margin: 1px 0 0;
    border: 1px solid var(--body-caption-off);
    border-radius: 6px;
    background-color: #fff;
    cursor: pointer;
    transition: border-color .2s ease, background-color .2s ease;
}

.hra-course .wpcf7-form .wpcf7-list-item input[type="radio"] {
    border-radius: 50%;
}

.hra-course .wpcf7-form .wpcf7-list-item input:checked {
    border-color: var(--main-lime);
    background-color: var(--main-lime);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23232323' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round' d='M3 8.5l3.2 3.2L13 5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 14px;
}

.hra-course .wpcf7-form .wpcf7-list-item input:focus-visible {
    outline: 2px solid var(--main-lavanda);
    outline-offset: 2px;
}

.hra-course .wpcf7-form .wpcf7-list-item-label {
    line-height: 22px;
}

/* --- acceptance (privacy) ------------------------------------------------ */

.hra-course .wpcf7-form .wpcf7-acceptance {
    margin-top: 4px;
}

.hra-course .wpcf7-form .wpcf7-acceptance .wpcf7-list-item-label {
    font-size: 14px;
    line-height: 20px;
    color: var(--body-subtext);
}

.hra-course .wpcf7-form .wpcf7-acceptance a {
    color: var(--body-text);
    text-decoration: underline;
}

/* --- submit -------------------------------------------------------------- */

.hra-course .wpcf7-form .wpcf7-submit {
    width: 100%;
    margin-top: 8px;
    padding: 18px 40px;
    border: none;
    border-radius: 999px;
    background-color: var(--body-text);
    color: var(--body-text-off);
    font-family: inherit;
    font-weight: 500;
    font-size: 17px;
    line-height: 24px;
    cursor: pointer;
    transition: background-color .2s ease, color .2s ease;
}

.hra-course .wpcf7-form .wpcf7-submit:hover,
.hra-course .wpcf7-form .wpcf7-submit:focus {
    background-color: var(--main-lavanda);
    color: #fff;
}

.hra-course .wpcf7-form .wpcf7-submit:disabled {
    opacity: .6;
    cursor: default;
}

.hra-course .wpcf7-spinner {
    margin: 0 auto;
}

/* --- file upload (the drag-n-drop plugin builds its own UI) -------------- */

.hra-course .wpcf7-form .codedropz-upload-wrapper {
    margin: 0;
}

.hra-course .wpcf7-form .codedropz-upload-container {
    padding: 22px;
    border: 1px dashed var(--body-subtext);
    border-radius: 14px;
    background-color: #fff;
}

.hra-course .wpcf7-form .codedropz-upload-inner {
    font-size: 15px;
    color: var(--body-subtext);
}

/* --- validation ---------------------------------------------------------- */

.hra-course .wpcf7-not-valid-tip {
    margin-top: 6px;
    font-size: 13px;
    line-height: 18px;
    color: #b02a20;
}

.hra-course .wpcf7-form input.wpcf7-not-valid,
.hra-course .wpcf7-form textarea.wpcf7-not-valid {
    border-color: #b02a20;
}

.hra-course .wpcf7-response-output {
    margin: 8px 0 0;
    padding: 14px 18px;
    border: 1px solid var(--body-caption-off);
    border-radius: 12px;
    font-size: 15px;
    line-height: 21px;
    background-color: #fff;
}

.hra-course .form-hidden {
    display: none;
}

/* --- mobile -------------------------------------------------------------- */

@media screen and (max-width: 768px) {
    .hra-course .why-osce-footer-note:has(.wpcf7) {
        padding: 24px 20px;
    }

    .hra-course .why-osce-footer-note h2 {
        font-size: 20px;
        line-height: 28px;
    }

    .hra-course .wpcf7-form input[type="text"],
    .hra-course .wpcf7-form input[type="email"],
    .hra-course .wpcf7-form input[type="url"],
    .hra-course .wpcf7-form textarea {
        padding: 15px 18px;
    }
}
