/**
 * Trial form block.
 *
 * Values mirror the Tilda original (bebestschool.es/en/price, record
 * rec610976387): a 407x643 #ff5c00 panel with a 30 px/900 white heading and
 * 20 px rows built from a 90 px icon and text, beside a form column with a
 * 30 px/900 black heading. Form controls follow the record's own settings:
 * 50 px tall, white, 1 px #ff5c00 border, 16 px text, 20 px apart, and a
 * 200x50 #ff5c00 submit button with a 15 px radius.
 *
 * The original squares off the panel's right corners so it can butt against
 * a white panel behind the form; there's no second panel here, so the panel
 * keeps its radius all the way round — as in the design the client sent.
 *
 * The form markup comes from Contact Form 7, so the control styles below are
 * written against CF7's output rather than markup this block controls.
 */

.bbs-trial-form {
    --bbs-trial-form-font: 'ApercuPro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    --bbs-trial-form-container: 813px;
    --bbs-trial-form-gutter: 20px;

    --bbs-trial-form-orange: #ff5c00;
    --bbs-trial-form-ink: #000000;
    --bbs-trial-form-radius: 15px;

    padding: 40px 0;
    background: #ffffff;
    font-family: var(--bbs-trial-form-font);
}

.bbs-trial-form *,
.bbs-trial-form *::before,
.bbs-trial-form *::after {
    box-sizing: border-box;
}

.bbs-trial-form__inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: start;
    max-width: calc(var(--bbs-trial-form-container) + var(--bbs-trial-form-gutter) * 2);
    margin: 0 auto;
    padding: 0 var(--bbs-trial-form-gutter);
}

/* ── Orange panel ── */
.bbs-trial-form__panel {
    min-height: 643px;
    padding: 29px 24px 40px;
    border-radius: var(--bbs-trial-form-radius);
    background: var(--bbs-trial-form-orange);
    color: #ffffff;
}

.bbs-trial-form__panel-title {
    margin: 0;
    color: #ffffff;
    font-size: 30px;
    line-height: 1.2;
    font-weight: 900;
    text-align: center;
}

/* The rows sit further in than the heading does: 65 px from the panel edge
   in the original, against the panel's own 24 px padding. */
.bbs-trial-form__list {
    margin: 51px 0 0;
    padding: 0 0 0 41px;
    list-style: none;
}

.bbs-trial-form__item {
    display: flex;
    align-items: center;
    gap: 18px;
    margin: 0;
}

/* The icon boxes nearly touch in the original — 90 px tall, 91 px apart. The
   air between rows comes from the transparent margin inside each icon. */
.bbs-trial-form__item + .bbs-trial-form__item {
    margin-top: 4px;
}

.bbs-trial-form__icon-wrap {
    display: flex;
    flex: 0 0 90px;
    align-items: center;
    justify-content: center;
    width: 90px;
}

.bbs-trial-form__icon {
    display: block;
    width: 100%;
    height: auto;
}

.bbs-trial-form__item-text {
    font-size: 20px;
    line-height: 1.55;
    font-weight: 400;
}

/* ── Form column ── */
.bbs-trial-form__form {
    padding: 27px 25px 40px 21px;
}

.bbs-trial-form__form-title {
    max-width: 318px;
    margin: 0 auto 24px;
    color: var(--bbs-trial-form-ink);
    font-size: 30px;
    line-height: 1.2;
    font-weight: 900;
    text-align: center;
}

/* ── Contact Form 7 output ── */
.bbs-trial-form__form-body .wpcf7-form p {
    margin: 0;
}

.bbs-trial-form__form-body input[type="text"],
.bbs-trial-form__form-body input[type="email"],
.bbs-trial-form__form-body input[type="tel"],
.bbs-trial-form__form-body input[type="url"],
.bbs-trial-form__form-body input[type="number"],
.bbs-trial-form__form-body input[type="date"],
.bbs-trial-form__form-body select,
.bbs-trial-form__form-body textarea {
    width: 100%;
    height: 50px;
    margin: 0 0 20px;
    padding: 0 16px;
    border: 1px solid var(--bbs-trial-form-orange);
    border-radius: 0;
    background: #ffffff;
    color: var(--bbs-trial-form-ink);
    font-family: inherit;
    font-size: 16px;
    line-height: 1.25;
    font-weight: 400;
}

.bbs-trial-form__form-body textarea {
    height: auto;
    min-height: 100px;
    padding: 14px 16px;
}

.bbs-trial-form__form-body input::placeholder,
.bbs-trial-form__form-body textarea::placeholder {
    color: #9a9a9a;
    opacity: 1;
}

.bbs-trial-form__form-body input:focus,
.bbs-trial-form__form-body select:focus,
.bbs-trial-form__form-body textarea:focus {
    outline: 2px solid var(--bbs-trial-form-orange);
    outline-offset: 1px;
}

/* Free-standing text between fields, e.g. "If you have a promotional code". */
.bbs-trial-form__form-body .bbs-form-note {
    margin: 0 0 5px;
    color: var(--bbs-trial-form-ink);
    font-size: 16px;
    line-height: 1.35;
    font-weight: 400;
}

/* ── Checkboxes ── */
.bbs-trial-form__form-body .wpcf7-checkbox .wpcf7-list-item,
.bbs-trial-form__form-body .wpcf7-acceptance .wpcf7-list-item {
    display: block;
    margin: 0 0 12px;
}

/* Only the label is the flex row — the text span has to stay inline, or the
   link inside it becomes a flex item and gets pushed away from its sentence. */
.bbs-trial-form__form-body .wpcf7-list-item label {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--bbs-trial-form-ink);
    font-size: 14px;
    line-height: 1.35;
    font-weight: 400;
}

.bbs-trial-form__form-body .wpcf7-list-item-label {
    display: inline;
}

.bbs-trial-form__form-body input[type="checkbox"] {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    margin: 0;
    accent-color: var(--bbs-trial-form-ink);
}

.bbs-trial-form__form-body a {
    color: var(--bbs-trial-form-orange);
    text-decoration: none;
}

.bbs-trial-form__form-body a:hover,
.bbs-trial-form__form-body a:focus-visible {
    text-decoration: underline;
}

/* ── Submit ── */
.bbs-trial-form__form-body .wpcf7-submit {
    display: block;
    width: 200px;
    height: 50px;
    margin: 20px auto 0;
    padding: 0 16px;
    border: 0;
    border-radius: var(--bbs-trial-form-radius);
    background: var(--bbs-trial-form-orange);
    color: #ffffff;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.2;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s ease-in-out;
}

.bbs-trial-form__form-body .wpcf7-submit:hover,
.bbs-trial-form__form-body .wpcf7-submit:focus-visible {
    opacity: 0.85;
}

/* CF7's own validation and response messages. */
.bbs-trial-form__form-body .wpcf7-not-valid-tip {
    margin: -14px 0 14px;
    color: #d63638;
    font-size: 13px;
    line-height: 1.3;
}

.bbs-trial-form__form-body .wpcf7-response-output {
    margin: 20px 0 0;
    padding: 12px 16px;
    border: 1px solid var(--bbs-trial-form-orange);
    font-size: 14px;
    line-height: 1.35;
}

.bbs-trial-form__form-body .wpcf7-spinner {
    margin: 12px auto 0;
    display: block;
}

/* ── 1199 and below ── */
@media (max-width: 1199px) {
    .bbs-trial-form__panel-title,
    .bbs-trial-form__form-title {
        font-size: 26px;
    }

    .bbs-trial-form__item-text {
        font-size: 18px;
    }

    .bbs-trial-form__form {
        padding-left: 30px;
    }
}

/* ── 959 and below ── */
@media (max-width: 959px) {
    .bbs-trial-form__panel {
        min-height: 0;
        padding: 26px 20px 32px;
    }

    .bbs-trial-form__list {
        margin-top: 40px;
    }

    .bbs-trial-form__icon-wrap {
        flex-basis: 70px;
        width: 70px;
    }

    .bbs-trial-form__item-text {
        font-size: 16px;
    }

    .bbs-trial-form__form {
        padding: 26px 0 32px 24px;
    }

    .bbs-trial-form__form-title {
        margin-bottom: 30px;
    }
}

/* ── 639 and below: the form drops under the panel ── */
@media (max-width: 639px) {
    .bbs-trial-form {
        --bbs-trial-form-gutter: 16px;

        padding: 28px 0;
    }

    .bbs-trial-form__inner {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .bbs-trial-form__panel-title,
    .bbs-trial-form__form-title {
        font-size: 24px;
    }

    .bbs-trial-form__form {
        padding: 0;
    }

    .bbs-trial-form__form-body .wpcf7-submit {
        width: 100%;
        max-width: 260px;
    }
}

/* ── In a popup (popups/popups.php) ──
 * The free introductory lesson popup on bebestschool.es/en (rec601161420) is
 * this block with the white panel behind the form that the page version
 * leaves out: one 813×643 card, rounded all round, the orange panel square
 * on the side it shares with the white one. Two columns down to 640; below
 * that the white part runs straight on under the orange one, whose points go
 * two to a row until 480. */
.bbs-trial-form--popup {
    padding: 0;
    background: transparent;
}

.bbs-trial-form--popup .bbs-trial-form__inner {
    align-items: stretch;
    width: calc(100% - var(--bbs-trial-form-gutter) * 2);
    max-width: var(--bbs-trial-form-container);
    padding: 0;
    overflow: hidden;
    border-radius: var(--bbs-trial-form-radius);
    background: #ffffff;
}

.bbs-trial-form--popup .bbs-trial-form__panel {
    border-radius: 0;
}

/* The original keeps its 30 px headings and 20 px points down to 960,
 * where the page version already steps down. */
.bbs-trial-form--popup .bbs-trial-form__panel-title,
.bbs-trial-form--popup .bbs-trial-form__form-title {
    font-size: 30px;
}

.bbs-trial-form--popup .bbs-trial-form__item-text {
    font-size: 20px;
}

@media (max-width: 959px) {
    .bbs-trial-form--popup .bbs-trial-form__inner {
        max-width: 640px;
    }

    .bbs-trial-form--popup .bbs-trial-form__panel-title,
    .bbs-trial-form--popup .bbs-trial-form__form-title {
        font-size: 26px;
    }

    .bbs-trial-form--popup .bbs-trial-form__item-text {
        font-size: 18px;
        line-height: 1.2;
    }

    .bbs-trial-form--popup .bbs-trial-form__form {
        padding-right: 20px;
    }
}

@media (max-width: 639px) {
    .bbs-trial-form--popup .bbs-trial-form__inner {
        max-width: 460px;
        gap: 0;
    }

    .bbs-trial-form--popup .bbs-trial-form__panel {
        padding: 26px 16px 24px;
    }

    .bbs-trial-form--popup .bbs-trial-form__list {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px 10px;
        margin-top: 24px;
        padding-left: 0;
    }

    .bbs-trial-form--popup .bbs-trial-form__item {
        gap: 10px;
    }

    .bbs-trial-form--popup .bbs-trial-form__item + .bbs-trial-form__item {
        margin-top: 0;
    }

    .bbs-trial-form--popup .bbs-trial-form__item-text {
        font-size: 16px;
    }

    .bbs-trial-form--popup .bbs-trial-form__form {
        padding: 26px 20px 30px;
    }

    .bbs-trial-form--popup .bbs-trial-form__form-body .wpcf7-form input[type="text"],
    .bbs-trial-form--popup .bbs-trial-form__form-body .wpcf7-form input[type="email"],
    .bbs-trial-form--popup .bbs-trial-form__form-body .wpcf7-form input[type="tel"] {
        height: 40px;
        margin-bottom: 10px;
    }
}

/* The original runs the card edge to edge at 320 and lists the points in one column. */
@media (max-width: 479px) {
    .bbs-trial-form--popup .bbs-trial-form__inner {
        width: 100%;
        border-radius: 0;
    }

    .bbs-trial-form--popup .bbs-trial-form__list {
        grid-template-columns: 1fr;
        padding-left: 7px;
    }

    .bbs-trial-form--popup .bbs-trial-form__item-text {
        font-size: 18px;
    }
}
