/**
 * Forms, brand layer: how WPForms looks on this site on top of css/forms.css.
 * Project styles (PPL Logistiikka).
 *
 * Fields          square, hairline border, the section's page background.
 *                 A focused field gets four corners in the color of action
 *                 instead of an outline (same properties as
 *                 css/blocks/focus-corners.css). The corners are background
 *                 layers, because an input has no pseudo-elements.
 * size-choice     CSS class of a Multiple choice field (WPForms field
 *                 options > Advanced > CSS classes): the choices become
 *                 boxes in a row with a slot mark that fills when chosen
 *                 (pallet; the second choice a parcel). A choice label may
 *                 hold a <small> explanation.
 * form-confirmation   the confirmation message: slot mark + h4 + p. The
 *                 markup is the form's Confirmation message in WPForms.
 */

.wpforms-container .wpforms-form :is(input[type="text"], input[type="email"], input[type="tel"], input[type="url"], input[type="number"], textarea, select) {
    --c: var(--link-clr);
    --t: 3px;
    --a: var(--focus-corner-a);
    height: auto;
    padding: 12px 14px;
    border: 1px solid var(--border-clr);
    border-radius: 0;
    background:
        linear-gradient(var(--c) 0 0) left top / var(--a) var(--t), linear-gradient(var(--c) 0 0) left top / var(--t) var(--a),
        linear-gradient(var(--c) 0 0) right top / var(--a) var(--t), linear-gradient(var(--c) 0 0) right top / var(--t) var(--a),
        linear-gradient(var(--c) 0 0) left bottom / var(--a) var(--t), linear-gradient(var(--c) 0 0) left bottom / var(--t) var(--a),
        linear-gradient(var(--c) 0 0) right bottom / var(--a) var(--t), linear-gradient(var(--c) 0 0) right bottom / var(--t) var(--a),
        linear-gradient(var(--bg-clr) 0 0);
    background-repeat: no-repeat;
    background-origin: border-box;
    box-shadow: none;
    color: var(--font-clr);
    font-size: 0.95rem;
    line-height: 1.4;
    transition: --focus-corner-a 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.2s;
}

.wpforms-container .wpforms-form :is(input[type="text"], input[type="email"], input[type="tel"], input[type="url"], input[type="number"], textarea, select):focus {
    --focus-corner-a: 12px;
    outline: 0;
    border-color: transparent;
    box-shadow: none;
}

.wpforms-container .wpforms-form textarea {
    min-height: 120px;
}

.wpforms-container .wpforms-form .wpforms-field-label {
    margin-bottom: 6px;
    font-size: 0.78em;
    font-weight: 700;
    color: var(--font-clr);
}

/* ---- Size choice ---- */
.wpforms-container .size-choice ul {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin: 0;
    padding: 0;
}

.wpforms-container .size-choice ul li {
    position: relative;
    display: block;
    width: auto;
    margin: 0;
    padding: 0;
}

.wpforms-container .size-choice ul li input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.wpforms-container .size-choice ul li label {
    position: relative;
    display: block;
    height: 100%;
    margin: 0;
    padding: 12px 62px 12px 14px;
    border: 1px solid var(--border-clr);
    background: var(--bg-clr);
    color: var(--heading-clr);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.3;
    cursor: pointer;
}

.size-choice label small {
    display: block;
    margin-top: 2px;
    font-size: 0.78em;
    font-weight: 400;
    color: var(--font-clr);
}

/* The slot mark of a choice is drawn by css/blocks/slot-mark.css */
.size-choice ul li label::after {
    content: "";
    position: absolute;
    right: 14px;
    top: 50%;
    margin-top: -12px;
}

.wpforms-container .size-choice ul li input:checked + label {
    border-color: var(--link-clr);
    box-shadow: inset 0 0 0 1px var(--link-clr);
}

.wpforms-container .size-choice ul li input:focus-visible + label {
    outline: 2px solid var(--link-clr);
    outline-offset: 2px;
}

/* ---- Confirmation ---- */
.wpforms-confirmation-container,
.wpforms-confirmation-container-full {
    margin: 0;
    padding: clamp(20px, 3vw, 32px);
    border: 1px solid var(--border-clr);
    background: var(--neutral-clr);
    color: var(--font-clr);
}

.form-confirmation {
    display: flex;
    gap: 20px;
    align-items: center;
}

.form-confirmation h4 {
    margin: 0 0 6px;
    font-size: 1.7em;
}

.form-confirmation p {
    margin: 0;
    font-size: 0.95em;
}

@media (min-width: 768px) {
    .wpforms-container .size-choice ul {
        grid-template-columns: repeat(3, 1fr);
    }
}
