/* ============================================================
   Aveline Access Granter — Public styles
   ============================================================ */

/* ── Shared form ──────────────────────────────────────────── */

.aag-form-wrap {
	width: 100%;
}

.aag-hp-field {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
	opacity: 0;
	pointer-events: none;
}

.aag-field {
	margin-bottom: 1.125rem;
}

.aag-field label {
	display: block;
	font-size: 0.8125rem;
	font-weight: 500;
	margin-bottom: 0.375rem;
}

.aag-optional {
	font-weight: 400;
	opacity: 0.6;
}

.aag-field input,
.aag-field textarea {
	width: 100%;
	box-sizing: border-box;
	padding: 0.625rem 0.875rem;
	border: 1px solid;
	border-radius: 2px;
	font-size: 0.9375rem;
	font-family: inherit;
	transition: border-color 0.15s, box-shadow 0.15s;
}

.aag-field-hint {
	font-size: 0.75rem;
	opacity: 0.6;
	margin: 0.25rem 0 0;
}

.aag-form-footer {
	margin-top: 1.5rem;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.75rem;
	text-align: center;
}

.aag-submit-btn {
	width: 100%;
	padding: 0.8125rem 2rem;
	border: none;
	font-size: 0.9375rem;
	font-family: inherit;
	font-weight: 500;
	cursor: pointer;
	transition: background 0.15s, opacity 0.15s;
	letter-spacing: 0.01em;
}

.aag-submit-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.aag-submit-loading { display: none; }
.aag-submit-btn.is-loading .aag-submit-label  { display: none; }
.aag-submit-btn.is-loading .aag-submit-loading { display: inline; }

.aag-form-note {
	font-size: 0.75rem;
	opacity: 0.55;
	margin: 0;
}

/* ── Feedback banners — match the look of the letter contact form ── */
.aag-success,
.aag-error {
	margin: 1rem 0 1.5rem;
	padding: 16px 20px;
	font-family: 'DM Sans', system-ui, sans-serif;
	font-size: 15px;
	line-height: 1.6;
	border-left: 3px solid currentColor;
	text-align: left;
}
.aag-success[hidden],
.aag-error[hidden] { display: none !important; }

.aag-success {
	background: #e8f4ec;
	color: #1e6b3a;
}
.aag-error {
	background: #fdecea;
	color: #b3261e;
}

/* Hide the legacy text-checkmark since we render a proper badge below. */
.aag-success__icon { display: none; }

.aag-success__message,
.aag-error__message { margin: 0; }

.aag-success .aag-success__message {
	display: flex;
	align-items: center;
	gap: 12px;
}
.aag-success .aag-success__message::before {
	content: "";
	display: inline-flex;
	flex-shrink: 0;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: #1e6b3a no-repeat center url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>");
}

/* ── Field-level error highlight (red background + red bottom border) ── */
.aag-form input.aag-has-error,
.aag-form textarea.aag-has-error,
.aag-form select.aag-has-error,
input.aag-has-error,
textarea.aag-has-error,
select.aag-has-error {
	background: rgba(179, 38, 30, 0.08) !important;
	background-color: rgba(179, 38, 30, 0.08) !important;
	border-color: #b3261e !important;
	box-shadow: 0 0 0 1px rgba(179, 38, 30, 0.25) !important;
}

/* ── Modal ────────────────────────────────────────────────── */

.aag-modal {
	position: fixed;
	inset: 0;
	z-index: 9999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1.5rem;
}

.aag-modal[hidden] { display: none; }

.aag-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(28, 18, 18, 0.55);
	backdrop-filter: blur(3px);
}

.aag-modal__panel {
	position: relative;
	width: 100%;
	max-width: 420px;
	max-height: 90svh;
	overflow-y: auto;
	padding: 2.5rem 2.25rem 2rem;
	border-radius: 2px;
	box-shadow: 0 24px 64px rgba(28,18,18,0.18);
}

.aag-modal__close {
	position: absolute;
	top: 1rem;
	right: 1rem;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	padding: 0;
	background: none;
	border: none;
	cursor: pointer;
	opacity: 0.45;
	transition: opacity 0.15s;
}
.aag-modal__close:hover { opacity: 1; }

.aag-modal__eyebrow {
	font-size: 0.6875rem;
	font-weight: 500;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	margin: 0 0 0.5rem;
}

.aag-modal__title {
	font-size: 1.375rem;
	line-height: 1.2;
	margin: 0 0 1.75rem;
	font-weight: 400;
	padding-right: 2rem;
}

body.aag-modal-open { overflow: hidden; }

/* ── Tabs ─────────────────────────────────────────────── */

.aag-tabs {
	display: flex;
	gap: 0;
	margin-bottom: 1.5rem;
	border-bottom: 1px solid currentColor;
	opacity: 0.9;
}

.aag-tab {
	background: none;
	border: none;
	border-bottom: 2px solid transparent;
	margin-bottom: -1px;
	padding: 0.5rem 1rem 0.5rem 0;
	font-size: 0.8125rem;
	font-weight: 500;
	font-family: inherit;
	cursor: pointer;
	opacity: 0.45;
	transition: opacity 0.15s, border-color 0.15s;
	letter-spacing: 0.01em;
}

.aag-tab.is-active {
	opacity: 1;
	border-bottom-color: currentColor;
}

.aag-tab-panel[hidden] { display: none; }

/* ── Gate page form (overridden further in theme.css) ──── */

.aag-gate-form-wrap {
	max-width: 400px;
	margin: 0 auto;
}

/* ── Elementor gate page ─────────────────────────────────────
   When an Elementor form drives the gate, hide the redundant
   AAG-rendered form (the shortcode is still emitted but not
   shown — the user's own form is wired to the AAG endpoints). */

body.aag-on-gate .aag-form-wrap {
	display: none !important;
}

.aag-gate-error {
	margin-top: 1rem;
	padding: 0.75rem 1rem;
	border-radius: 4px;
	background: #fdecea;
	color: #b3261e;
	font-size: 0.875rem;
}

.aag-gate-error[hidden] { display: none !important; }
