/*
 * CDS Cart Proforma — cart-page form styles.
 *
 * Mobile-first and additive: the proforma block sits below WooCommerce's own
 * checkout button without altering it. No layout depends on JavaScript.
 */

.cds-proforma {
    margin-top: 1.25rem;
    padding: 1rem;
    border: 1px solid #dfe4ea;
    border-radius: 6px;
    background: #f8fafc;
}

.cds-proforma__heading {
    margin: 0 0 0.25rem;
    font-size: 1.05rem;
    color: #0a3d62;
}

.cds-proforma__intro {
    margin: 0 0 0.75rem;
    font-size: 0.85rem;
    color: #4b5563;
}

.cds-proforma__field {
    display: flex;
    flex-direction: column;
    margin: 0 0 0.75rem;
}

.cds-proforma__field label {
    margin-bottom: 0.25rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #1f2937;
}

.cds-proforma__optional {
    font-weight: 400;
    color: #6b7280;
}

.cds-proforma__field input,
.cds-proforma__field textarea {
    width: 100%;
    padding: 0.55rem 0.6rem;
    font-size: 1rem; /* >=16px avoids iOS zoom-on-focus */
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    box-sizing: border-box;
}

.cds-proforma__field input:focus,
.cds-proforma__field textarea:focus {
    outline: 2px solid #0a3d62;
    outline-offset: 1px;
    border-color: #0a3d62;
}

.cds-proforma__field input[aria-invalid="true"],
.cds-proforma__field textarea[aria-invalid="true"] {
    border-color: #b91c1c;
}

.cds-proforma__error {
    margin-top: 0.25rem;
    font-size: 0.8rem;
    color: #b91c1c;
}

.cds-proforma__actions {
    margin: 0;
}

.cds-proforma__submit {
    width: 100%;
}

/* Comfortable two-up layout once there is room. */
@media (min-width: 600px) {
    .cds-proforma__form {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0 1rem;
    }

    .cds-proforma__form > .cds-proforma__actions,
    .cds-proforma__field:has(textarea) {
        grid-column: 1 / -1;
    }

    .cds-proforma__submit {
        width: auto;
    }
}
