/* AEC Forms — mobile-first, uses theme colours when available. */
.aec-form-wrap {
	--aec-f-red: var(--wp--preset--color--accent-2, #D41E2F);
	--aec-f-navy: var(--wp--preset--color--accent-3, #020031);
	--aec-f-gold: var(--wp--preset--color--accent-1, #F7B759);
	--aec-f-muted: var(--wp--preset--color--accent-4, #55546A);
	--aec-f-border: #cfccc4;
	--aec-f-bg: #fff;
	font-size: 1rem;
}
.aec-form { display: grid; gap: 1.25rem; }
.aec-form fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }

.aec-section {
	background: var(--aec-f-bg);
	border: 1px solid var(--wp--preset--color--accent-6, #E7E4DC);
	border-radius: 14px;
	padding: 1.1rem 1rem 1.25rem !important;
}
@media (min-width: 600px) { .aec-section { padding: 1.5rem 1.6rem 1.6rem !important; } }
.aec-section__title {
	display: flex; align-items: center; gap: 0.6rem;
	font-weight: 800; font-size: 1.15rem; color: var(--aec-f-navy);
	padding: 0; margin-bottom: 0.9rem; float: left; width: 100%;
}
.aec-section__title + * { clear: both; }
.aec-section__title span {
	display: grid; place-items: center;
	width: 1.8rem; height: 1.8rem; border-radius: 50%;
	background: var(--aec-f-gold); color: var(--aec-f-navy); font-size: 0.9rem;
}
.aec-section__help { margin: 0 0 0.9rem; color: var(--aec-f-muted); font-size: 0.9rem; clear: both; }

.aec-grid { display: grid; gap: 0.9rem 1rem; grid-template-columns: 1fr; clear: both; }
@media (min-width: 600px) {
	.aec-grid { grid-template-columns: 1fr 1fr; }
	.aec-grid--3 { grid-template-columns: 1fr 1fr 1fr; }
	.aec-span-2 { grid-column: 1 / -1; }
}
.aec-grid[hidden] { display: none; }

.aec-field { display: flex; flex-direction: column; gap: 0.35rem; min-width: 0; }
.aec-field__label { font-weight: 700; font-size: 0.95rem; color: var(--aec-f-navy); }
.aec-req { color: var(--aec-f-red); }
.aec-opt { font-weight: 400; color: var(--aec-f-muted); font-size: 0.85em; }
.aec-field__help { margin: 0; font-size: 0.82rem; color: var(--aec-f-muted); }

.aec-input {
	width: 100%;
	box-sizing: border-box;
	min-height: 48px; /* comfortable tap target */
	padding: 0.7rem 0.85rem;
	font: inherit;
	font-size: 16px; /* prevents iOS zoom on focus */
	color: #14132B;
	background: #fff;
	border: 1.5px solid var(--aec-f-border);
	border-radius: 10px;
	transition: border-color .15s ease, box-shadow .15s ease;
	appearance: none;
}
select.aec-input {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23020031' d='M1.4 0 6 4.6 10.6 0 12 1.4l-6 6-6-6z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 0.9rem center;
	padding-right: 2.4rem;
}
textarea.aec-input { min-height: 110px; resize: vertical; }
.aec-input:focus { outline: none; border-color: var(--aec-f-navy); box-shadow: 0 0 0 3px rgba(247, 183, 89, 0.55); }
.has-error .aec-input { border-color: var(--aec-f-red); background: #fff8f8; }
.aec-field__error { margin: 0; color: var(--aec-f-red); font-size: 0.85rem; font-weight: 600; }

/* Pills (radio) */
.aec-choice legend { margin-bottom: 0.45rem; padding: 0; }
.aec-pills { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.aec-pill { position: relative; cursor: pointer; }
.aec-pill input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.aec-pill span {
	display: inline-flex; align-items: center;
	min-height: 44px; padding: 0.5rem 1.1rem;
	border: 1.5px solid var(--aec-f-border); border-radius: 999px;
	background: #fff; font-weight: 600; color: var(--aec-f-navy);
	transition: all .15s ease;
}
.aec-pill input:checked + span { background: var(--aec-f-navy); border-color: var(--aec-f-navy); color: #fff; }
.aec-pill input:focus-visible + span { box-shadow: 0 0 0 3px rgba(247, 183, 89, 0.7); }

/* Checkbox */
.aec-check { display: flex; gap: 0.7rem; align-items: flex-start; font-size: 0.92rem; line-height: 1.5; cursor: pointer; }
.aec-check input { width: 22px; height: 22px; margin-top: 2px; flex: none; accent-color: var(--aec-f-navy); }
.aec-consent { background: var(--wp--preset--color--accent-5, #FFF6E8); border-radius: 12px; padding: 0.9rem 1rem; }

/* Education accordions */
.aec-edu {
	border: 1.5px solid var(--wp--preset--color--accent-6, #E7E4DC);
	border-radius: 12px;
	background: #fff;
	margin: 0 0 0.6rem !important;
	padding: 0 !important;
}
.aec-edu > summary {
	cursor: pointer; list-style: none;
	padding: 0.85rem 1rem; padding-right: 2.6rem;
	font-weight: 700; color: var(--aec-f-navy);
	position: relative; min-height: 48px; box-sizing: border-box;
}
.aec-edu > summary::-webkit-details-marker { display: none; }
.aec-edu > summary::after {
	content: "+ Add"; position: absolute; right: 1rem; top: 50%; transform: translateY(-50%);
	color: var(--aec-f-red); font-size: 0.85rem; font-weight: 700;
}
.aec-edu[open] > summary::after { content: "–"; font-size: 1.3rem; }
.aec-edu[open] > summary { border-bottom: 1px solid var(--wp--preset--color--accent-6, #E7E4DC); margin-bottom: 0.9rem !important; }
.aec-edu > div { padding: 0 1rem 1rem; }
.aec-edu > .aec-grid + .aec-subjects { padding-top: 0; }
.aec-subjects { display: grid; gap: 0.7rem; }
.aec-subject-row { display: grid; grid-template-columns: 1fr 5.5rem; gap: 0.6rem; }
.aec-grade .aec-input { text-align: center; }

/* Actions */
.aec-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.8rem 1.2rem; }
.aec-submit {
	min-height: 52px;
	padding: 0.9rem 2rem !important;
	border: 0; border-radius: 999px !important;
	background: var(--aec-f-red) !important; color: #fff !important;
	font: inherit; font-weight: 800 !important; font-size: 1.05rem !important;
	cursor: pointer;
}
@media (max-width: 599px) { .aec-submit { width: 100%; } }
.aec-submit:hover { background: var(--aec-f-navy) !important; }
.aec-submit[disabled] { opacity: 0.7; cursor: wait; }
.aec-note { margin: 0; font-size: 0.85rem; color: var(--aec-f-muted); }

/* Alerts */
.aec-alert { border-radius: 12px; padding: 1rem 1.1rem; margin-bottom: 1rem; font-size: 0.98rem; line-height: 1.55; }
.aec-alert--success { background: #e9f7ee; border: 1.5px solid #3c9a5f; color: #14532d; }
.aec-alert--error { background: #fdecee; border: 1.5px solid var(--aec-f-red); color: #7f1020; }
.aec-alert:focus { outline: none; }

/* Honeypot */
.aec-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

.aec-form--contact .aec-meeting { background: var(--wp--preset--color--accent-5, #FFF6E8); border-radius: 12px; padding: 0.9rem; }
.cf-turnstile { min-height: 65px; }

/* Phones: grades side by side, less label noise inside the optional education sections. */
@media (max-width: 599px) {
	.aec-grid--3 { grid-template-columns: 1fr 1fr; }
	.aec-grid--3 > :first-child { grid-column: 1 / -1; }
}
.aec-edu .aec-opt { display: none; }
