/* EAE Forms — scoped front-end styles */

.eae-form-wrapper {
	box-sizing: border-box;
	font-family: var(--eae-font, inherit);
	color: var(--eae-text, #1a1a1a);
	background: var(--eae-bg, #ffffff);
	padding: 2rem 1rem;
	min-height: 400px;
	position: relative;
}

.eae-form-wrapper *,
.eae-form-wrapper *::before,
.eae-form-wrapper *::after {
	box-sizing: border-box;
}

.eae-form-logo {
	margin-bottom: 1.5rem;
}

.eae-form-logo--center {
	text-align: center;
}

.eae-form-logo--top-left {
	text-align: left;
}

.eae-form-logo img {
	max-height: 60px;
	max-width: 200px;
	height: auto;
}

.eae-form-container {
	max-width: 640px;
	margin: 0 auto;
}

.eae-form-progress {
	height: 4px;
	background: rgba(0, 0, 0, 0.08);
	border-radius: 2px;
	margin-bottom: 2rem;
	overflow: hidden;
}

.eae-form-progress-bar {
	height: 100%;
	background: var(--eae-primary, #2563eb);
	border-radius: 2px;
	transition: width 0.4s ease;
	width: 0;
}

.eae-form-step {
	animation: eaeFadeIn 0.35s ease;
}

.eae-form-step.eae-exiting {
	animation: eaeFadeOut 0.25s ease forwards;
}

@keyframes eaeFadeIn {
	from { opacity: 0; transform: translateY(12px); }
	to { opacity: 1; transform: translateY(0); }
}

@keyframes eaeFadeOut {
	from { opacity: 1; transform: translateY(0); }
	to { opacity: 0; transform: translateY(-8px); }
}

.eae-form-step-title {
	font-size: 1.75rem;
	font-weight: 600;
	line-height: 1.3;
	margin: 0 0 1.5rem;
}

.eae-form-field {
	margin-bottom: 1.25rem;
}

.eae-form-label {
	display: block;
	font-size: 0.875rem;
	font-weight: 500;
	margin-bottom: 0.5rem;
}

.eae-form-label .eae-required {
	color: #dc2626;
}

.eae-form-help {
	font-size: 0.8125rem;
	color: rgba(0, 0, 0, 0.55);
	margin-top: 0.35rem;
}

.eae-form-input,
.eae-form-textarea,
.eae-form-select {
	width: 100%;
	padding: 0.75rem 1rem;
	font-size: 1rem;
	font-family: inherit;
	color: inherit;
	background: #fff;
	border: 2px solid rgba(0, 0, 0, 0.12);
	border-radius: 8px;
	transition: border-color 0.2s;
}

.eae-form-input:focus,
.eae-form-textarea:focus,
.eae-form-select:focus {
	outline: none;
	border-color: var(--eae-primary, #2563eb);
}

.eae-form-textarea {
	min-height: 120px;
	resize: vertical;
}

.eae-form-error-msg {
	color: #dc2626;
	font-size: 0.8125rem;
	margin-top: 0.35rem;
}

.eae-form-field.has-error .eae-form-input,
.eae-form-field.has-error .eae-form-textarea,
.eae-form-field.has-error .eae-form-select {
	border-color: #dc2626;
}

/* Choice buttons */
.eae-form-choices {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.eae-form-choice-btn {
	display: block;
	width: 100%;
	padding: 0.875rem 1.25rem;
	font-size: 1rem;
	font-family: inherit;
	text-align: left;
	color: inherit;
	background: #fff;
	border: 2px solid rgba(0, 0, 0, 0.12);
	border-radius: 8px;
	cursor: pointer;
	transition: border-color 0.2s, background 0.2s;
}

.eae-form-choice-btn:hover {
	border-color: var(--eae-primary, #2563eb);
}

.eae-form-choice-btn.selected {
	border-color: var(--eae-primary, #2563eb);
	background: color-mix(in srgb, var(--eae-primary, #2563eb) 8%, transparent);
}

/* Image choice grid */
.eae-form-image-choices {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
	gap: 1rem;
}

.eae-form-image-choice {
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 1rem;
	background: #fff;
	border: 2px solid rgba(0, 0, 0, 0.12);
	border-radius: 12px;
	cursor: pointer;
	transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
	text-align: center;
}

.eae-form-image-choice:hover {
	border-color: var(--eae-primary, #2563eb);
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.eae-form-image-choice.selected {
	border-color: var(--eae-primary, #2563eb);
	background: color-mix(in srgb, var(--eae-primary, #2563eb) 6%, transparent);
}

.eae-form-image-choice img {
	width: 100%;
	max-height: 100px;
	object-fit: contain;
	margin-bottom: 0.75rem;
	border-radius: 6px;
}

.eae-form-image-choice-label {
	font-size: 0.9375rem;
	font-weight: 500;
}

/* Checkbox choices */
.eae-form-checkbox-choice {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 0.75rem 1rem;
	background: #fff;
	border: 2px solid rgba(0, 0, 0, 0.12);
	border-radius: 8px;
	cursor: pointer;
	margin-bottom: 0.5rem;
}

.eae-form-checkbox-choice input {
	width: 18px;
	height: 18px;
	accent-color: var(--eae-primary, #2563eb);
}

.eae-form-checkbox-choice.selected {
	border-color: var(--eae-primary, #2563eb);
}

/* Statement block */
.eae-form-statement-body {
	font-size: 1rem;
	line-height: 1.6;
	margin-bottom: 1rem;
}

.eae-form-statement-image {
	max-width: 100%;
	border-radius: 8px;
	margin-bottom: 1rem;
}

/* File upload */
.eae-form-file-wrap {
	position: relative;
}

.eae-form-file-input {
	position: absolute;
	opacity: 0;
	width: 100%;
	height: 100%;
	cursor: pointer;
}

.eae-form-file-label {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	padding: 1.5rem;
	border: 2px dashed rgba(0, 0, 0, 0.2);
	border-radius: 8px;
	cursor: pointer;
	transition: border-color 0.2s;
}

.eae-form-file-label:hover {
	border-color: var(--eae-primary, #2563eb);
}

.eae-form-file-name {
	font-size: 0.875rem;
	margin-top: 0.5rem;
}

/* Actions */
.eae-form-actions {
	margin-top: 2rem;
	display: flex;
	gap: 0.75rem;
	align-items: center;
}

.eae-form-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.75rem 1.75rem;
	font-size: 1rem;
	font-weight: 600;
	font-family: inherit;
	color: #fff;
	background: var(--eae-primary, #2563eb);
	border: none;
	border-radius: 8px;
	cursor: pointer;
	transition: opacity 0.2s, transform 0.15s;
	min-height: 48px;
}

.eae-form-btn:hover {
	opacity: 0.92;
}

.eae-form-btn:active {
	transform: scale(0.98);
}

.eae-form-btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.eae-form-btn-secondary {
	background: transparent;
	color: inherit;
	border: 2px solid rgba(0, 0, 0, 0.15);
}

.eae-form-btn-secondary:hover {
	border-color: rgba(0, 0, 0, 0.3);
	opacity: 1;
}

/* Thank you screen */
.eae-form-thankyou {
	text-align: center;
	padding: 2rem 0;
	animation: eaeFadeIn 0.5s ease;
}

.eae-form-thankyou h2 {
	font-size: 2rem;
	margin: 0 0 1rem;
}

.eae-form-thankyou p {
	font-size: 1.125rem;
	line-height: 1.6;
	opacity: 0.8;
}

/* Loading spinner */
.eae-form-spinner {
	display: inline-block;
	width: 20px;
	height: 20px;
	border: 2px solid rgba(255, 255, 255, 0.3);
	border-top-color: #fff;
	border-radius: 50%;
	animation: eaeSpin 0.7s linear infinite;
}

@keyframes eaeSpin {
	to { transform: rotate(360deg); }
}

/* Honeypot — hidden from users */
.eae-form-hp {
	position: absolute;
	left: -9999px;
	opacity: 0;
	height: 0;
	overflow: hidden;
}

.eae-form-error,
.eae-form-notice {
	padding: 1rem;
	border-radius: 8px;
}

.eae-form-error {
	background: #fef2f2;
	color: #991b1b;
}

.eae-form-notice {
	background: #fef9c3;
	color: #854d0e;
}

/* Responsive */
@media (max-width: 480px) {
	.eae-form-wrapper {
		padding: 1.5rem 0.75rem;
	}

	.eae-form-step-title {
		font-size: 1.375rem;
	}

	.eae-form-image-choices {
		grid-template-columns: repeat(2, 1fr);
		gap: 0.75rem;
	}
}
