
/*
 * 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: .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: .4rem;
	padding: 1rem .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: .5rem;
	padding-bottom: .5rem;
}

/* Resident-pass-dependent sections — hidden by default, revealed by JS when
   the "Request Resident Pass" checkbox is checked. */
.ppa-resident-only {
	display: none;
}

.ppa-any-pass-only {
	display: none;
}

/* =============================================================================
   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: .5rem;
}

/* Match the plates heading to other field labels */
.ppa-plates-section > p > strong {
	font-size: 1.05rem;
	font-weight: 600;
}

/* 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 .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: .25rem;
	padding: .45rem 1rem;
	background: none;
	border: 1px solid #555;
	border-radius: 3px;
	cursor: pointer;
	font-size: .95rem;
	color: inherit;
}

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

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

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

/* =============================================================================
   Pass type card selectors
   ============================================================================= */
.ppa-pass-type-heading {
	display: block;
	font-size: 1.05rem;
	font-weight: 600;
	color: inherit;
	margin-bottom: 0;
}

/* Suppress the <br> wpautop injects between the heading and note */
.ppa-pass-type-heading + br {
	display: none;
}

.ppa-pass-type-note {
	display: block;
	font-size: .875rem;
	font-weight: 400;
	color: #999;
	margin-top: .1rem;
	margin-bottom: 1.25rem;
}

.ppa-pass-cards {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1rem;
	width: 100%;
}

.ppa-pass-card {
	position: relative;
	flex: 1 1 calc(50% - .5rem);
	min-width: 200px;
	background: #fff;
	border: 2px solid #e2e8f0;
	border-top: 4px solid #1a5fa8;
	border-radius: 6px;
	padding: 1.5rem;
	cursor: pointer;
	transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
	box-shadow: 0 1px 4px rgba(0, 0, 0, .06);
}

.ppa-pass-card:hover {
	border-color: #1a5fa8;
	box-shadow: 0 4px 16px rgba(26, 95, 168, .14);
}

.ppa-pass-card:has(input:checked) {
	background: #f0f6ff;
	border-color: #1a5fa8;
	box-shadow: 0 6px 20px rgba(26, 95, 168, .18);
}

.ppa-pass-card:has(input:focus-visible) {
	outline: 3px solid #1a5fa8;
	outline-offset: 3px;
}

.ppa-pass-card .wpcf7-form-control-wrap, .ppa-pass-card .wpcf7-checkbox, .ppa-pass-card .wpcf7-list-item {
	display: block;
	margin: 0;
	position: static !important;
}

/* Stretch the native checkbox to cover the full card.
   opacity: 0 keeps it invisible; z-index: 1 puts it on top so every click
   on the card hits the checkbox — pure CSS, no JS needed. */
.ppa-pass-card input[type="checkbox"] {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	opacity: 0;
	cursor: pointer;
	margin: 0;
	z-index: 1;
}

/* Card label text */
.ppa-pass-card .wpcf7-list-item-label {
	display: flex;
	align-items: center;
	gap: .75rem;
	font-size: 1.1rem;
	font-weight: 700;
	color: #1a202c;
	user-select: none;
}

/* Custom checkbox indicator — prepended to the label text span */
.ppa-pass-card .wpcf7-list-item-label::before {
	content: "";
	flex-shrink: 0;
	width: 22px;
	height: 22px;
	border: 2px solid #cbd5e0;
	border-radius: 4px;
	background: #fff;
	transition: background .15s ease, border-color .15s ease;
}

.ppa-pass-card:has(input:checked) .wpcf7-list-item-label::before {
	background: #1a5fa8;
	border-color: #1a5fa8;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M13.707 4.293a1 1 0 0 1 0 1.414l-6 6a1 1 0 0 1-1.414 0l-3-3a1 1 0 1 1 1.414-1.414L7 9.586l5.293-5.293a1 1 0 0 1 1.414 0z' fill='%23fff'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-size: 14px 14px;
	background-position: center;
}

/* Card detail list */
.ppa-pass-card-detail {
	list-style: disc;
	margin: .5rem 0 0;
	padding-left: calc(22px + 1.25rem);
}

.ppa-pass-card-detail li {
	font-size: .875rem;
	font-weight: 400;
	color: #718096;
	line-height: 1.3;
	padding: 0;
	margin: 0;
}

.ppa-pass-card:has(input:checked) .ppa-pass-card-detail li {
	color: #2b6cb0;
}

@media (max-width: 640px) {
	.ppa-pass-cards {
		grid-template-columns: 1fr;
	}
}

/* =============================================================================
   Validation error summary
   ============================================================================= */

/* Hide CF7's generic "One or more fields have an error" banner — our custom
   error summary above the submit button replaces it entirely. */
.wpcf7-response-output {
	display: none !important;
}

.ppa-error-summary {
	grid-column: 1/-1;
	margin-bottom: 1.5rem;
	padding: 1rem 1.25rem;
	background: #fff5f5;
	border: 1px solid #fc8181;
	border-left: 4px solid #e53e3e;
	border-radius: 4px;
}

.ppa-error-summary:focus {
	outline: 3px solid #e53e3e;
	outline-offset: 2px;
}

.ppa-error-summary__heading {
	margin: 0 0 .5rem;
	font-size: 1rem;
	font-weight: 700;
	color: #c53030;
}

.ppa-error-summary__list {
	margin: 0;
	padding-left: 1.25rem;
}

.ppa-error-summary__list li {
	font-size: .9rem;
	color: #c53030;
	margin-bottom: .25rem;
	line-height: 1.4;
}

.ppa-error-summary__list li:last-child {
	margin-bottom: 0;
}

/* =============================================================================
   Staged document upload UI
   ============================================================================= */
.ppa-upload-ui {
	margin-top: .5rem;
}

.ppa-add-file {
	display: inline-block;
	padding: .45rem 1rem;
	background: none;
	border: 1px solid #555;
	border-radius: 3px;
	cursor: pointer;
	font-size: .95rem;
	color: inherit;
}

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

.ppa-add-file:disabled {
	opacity: .4;
	cursor: not-allowed;
}

.ppa-upload-error {
	margin: .5rem 0 0;
	font-size: .875rem;
	color: #c53030;
}

.ppa-file-list {
	list-style: none;
	margin: .75rem 0 0;
	padding: 0;
}

.ppa-file-item {
	display: flex;
	align-items: center;
	gap: .5rem;
	padding: .35rem .5rem;
	background: #f7fafc;
	border: 1px solid #e2e8f0;
	border-radius: 3px;
	margin-bottom: .35rem;
}

.ppa-file-item:last-child {
	margin-bottom: 0;
}

.ppa-file-name {
	flex: 1 1 auto;
	font-size: .9rem;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	min-width: 0;
}

.ppa-file-remove {
	flex-shrink: 0;
	background: none;
	border: none;
	cursor: pointer;
	font-size: 1.1rem;
	line-height: 1;
	color: #718096;
	padding: 0 .25rem;
}

.ppa-file-remove:hover {
	color: #c53030;
}

.ppa-file-count {
	margin: .5rem 0 0;
	font-size: .875rem;
	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%;
	}
}
