/*
 * FIFA World Cup Permit Application — form layout styles
 *
 * Loaded automatically by the plugin via wp_enqueue_style only on pages
 * containing the CF7 shortcode or block.
 *
 * Two-column layout on desktop; stacks to single column on mobile.
 */

/* =============================================================================
   Grid container
   Each adjacent pair of <p> tags forms one implicit row (two cells).
   Items with .ppa-full-width span both columns.
   ============================================================================= */
.ppa-fifa-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 2rem;
}

/* Label styling */
.ppa-fifa-form label {
    font-size: 1.05rem;
    font-weight: 600;
}

/* Required field asterisk — added via <span class="ppa-req"> in the form template */
.ppa-fifa-form .ppa-req {
    color: red;
    margin-left: 0.15em;
}

/* Make inputs fill their column — styles match the production philapark.org form */
.ppa-fifa-form input[type="text"],
.ppa-fifa-form input[type="email"],
.ppa-fifa-form input[type="tel"],
.ppa-fifa-form textarea,
.ppa-fifa-form select {
    width: 100%;
    box-sizing: border-box;
    font-family: "Montserrat", Arial, Helvetica, sans-serif;
    font-size: 1rem;
    margin-top: 0.4rem;
    padding: 1rem 0.625rem;
    color: #333;
    background: #fff;
    border: 2px solid #d6d6d6;
    border-radius: 0;
    box-shadow: none;
    -webkit-box-shadow: none;
    outline: none;
}

/* Selects use reduced vertical padding — the production theme sets a fixed
   height on select elements (40px) and 1rem top+bottom padding overflows it,
   clipping the selected value. 0.5rem keeps the text visible within 40px. */
.ppa-fifa-form select {
    height: auto;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

/* =============================================================================
   Full-width items
   .ppa-full-width on a <p> and .ppa-plates-section both span both columns.
   ============================================================================= */
.ppa-fifa-grid .ppa-full-width,
.ppa-fifa-grid .ppa-plates-section {
    grid-column: 1 / -1;
}

/* =============================================================================
   License plate section
   ============================================================================= */
.ppa-plates-section {
    border-top: 1px solid #ddd;
    padding-top: 1rem;
    margin-top: 0.5rem;
}

/* Plate rows hidden until revealed by plate-fields.js */
.ppa-plate-row.ppa-plate-hidden {
    display: none;
}

/* State abbreviation + plate number side-by-side within each plate row.
   CF7 renders both labels inside a single <p>, so the flex container
   must be that <p>, not the outer .ppa-plate-pair div. */
.ppa-plate-pair > p {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    flex-wrap: nowrap;
    margin: 0 0 0.5rem;
}

/* State label — fixed width wide enough for "— Select —" */
.ppa-plate-pair > p > label:first-of-type {
    flex: 0 0 auto;
}

.ppa-plate-pair > p > label:first-of-type select {
    width: 130px;
}

/* Plate number label — fixed reasonable width for 6-9 char plates */
.ppa-plate-pair > p > label:last-of-type {
    flex: 0 0 auto;
}

.ppa-plate-pair > p > label:last-of-type input[type="text"] {
    width: 200px;
}

/* "Add another plate" button */
.ppa-add-plate {
    display: inline-block;
    margin-top: 0.25rem;
    padding: 0.45rem 1rem;
    background: none;
    border: 1px solid #555;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.95rem;
    color: inherit;
}

.ppa-add-plate:hover:not(:disabled) {
    background-color: #f5f5f5;
}

.ppa-add-plate:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* =============================================================================
   Supporting documents field
   ============================================================================= */
.ppa-fifa-form .ppa-full-width em {
    display: block;
    font-size: 0.875rem;
    margin-top: 0.35rem;
    color: #555;
}

/* =============================================================================
   Mobile — stack to single column
   ============================================================================= */
@media (max-width: 640px) {
    .ppa-fifa-grid {
        grid-template-columns: 1fr;
    }

    .ppa-plate-pair > p {
        flex-wrap: wrap;
    }

    .ppa-plate-pair > p > label:first-of-type,
    .ppa-plate-pair > p > label:last-of-type {
        flex: 1 1 100%;
    }

    .ppa-plate-pair > p > label:first-of-type select {
        width: 100%;
    }
}
