/**
 * ESE School Modals — fully self-contained, theme-agnostic styles.
 * Everything is namespaced under .ese-* to avoid collisions with any theme.
 */

:root {
	--ese-primary: #0d6efd;
	--ese-accent: #198754;
}

/* ---------- Floating action buttons ---------- */
.ese-fab {
	position: fixed;
	z-index: 99999;
	border: 0;
	cursor: pointer;
	color: #fff;
	font: 600 14px/1 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
	letter-spacing: .03em;
	text-transform: uppercase;
	box-shadow: 0 2px 10px rgba(0, 0, 0, .2);
	transition: filter .15s ease;
}
.ese-fab:hover { filter: brightness(.92); }
.ese-fab:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }

.ese-fab--login {
	left: 0;
	top: 50%;
	transform: translateY(-50%);
	background: var(--ese-primary);
	padding: 14px 10px;
	border-radius: 0 6px 6px 0;
	writing-mode: vertical-rl;
}
.ese-fab--enroll {
	right: 14px;
	bottom: 0;
	background: var(--ese-accent);
	padding: 12px 30px;
	border-radius: 6px 6px 0 0;
}

/* ---------- Modal shell ---------- */
.ese-modal[hidden] { display: none; }
.ese-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding: 5vh 16px;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
}
.ese-modal__backdrop {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, .55);
	animation: ese-fade .15s ease;
}
.ese-modal__dialog {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: 420px;
	margin: auto;
	background: #fff;
	color: #1d2327;
	border-radius: 10px;
	box-shadow: 0 18px 60px rgba(0, 0, 0, .35);
	font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
	animation: ese-pop .18s ease;
}
.ese-modal__dialog--lg { max-width: 720px; }

@keyframes ese-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes ese-pop { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: none; } }

.ese-modal__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 16px 20px;
	border-bottom: 1px solid #e5e7eb;
}
.ese-modal__title { margin: 0; font-size: 18px; font-weight: 700; }
.ese-modal__close {
	border: 0;
	background: none;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	color: #6b7280;
	padding: 0 4px;
}
.ese-modal__close:hover { color: #111; }
.ese-modal__body { padding: 20px; }
.ese-modal__footer {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 10px;
	padding: 14px 20px;
	border-top: 1px solid #e5e7eb;
}

/* ---------- Logo ---------- */
.ese-logo { text-align: center; margin-bottom: 14px; }
.ese-logo img { max-width: 120px; height: auto; }

/* ---------- Form fields ---------- */
.ese-field { margin-bottom: 14px; }
.ese-field label { display: block; margin-bottom: 5px; font-weight: 600; font-size: 13px; }
.ese-field label small { font-weight: 400; color: #6b7280; }
.ese-field input,
.ese-field select {
	box-sizing: border-box;
	width: 100%;
	padding: 9px 11px;
	border: 1px solid #c7ccd1;
	border-radius: 7px;
	font-size: 15px;
	background: #fff;
	color: #1d2327;
	text-transform: none;
}
.ese-field input:focus,
.ese-field select:focus {
	outline: 0;
	border-color: var(--ese-primary);
	box-shadow: 0 0 0 3px rgba(13, 110, 253, .18);
}
.ese-field input.is-invalid,
.ese-field select.is-invalid {
	border-color: #dc3545;
	box-shadow: 0 0 0 3px rgba(220, 53, 69, .16);
}

.ese-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0 16px;
}
.ese-field--full { grid-column: 1 / -1; }
@media (max-width: 560px) { .ese-grid { grid-template-columns: 1fr; } }

/* Honeypot — visually + functionally hidden from humans. */
.ese-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	opacity: 0;
}

/* ---------- Verification code ---------- */
.ese-code { display: flex; gap: 8px; justify-content: center; margin: 8px 0 12px; }
.ese-code__box {
	width: 48px;
	height: 58px;
	text-align: center;
	font-size: 26px;
	border: 1px solid #c7ccd1;
	border-radius: 8px;
}
.ese-code__box:focus { outline: 0; border-color: var(--ese-primary); box-shadow: 0 0 0 3px rgba(13, 110, 253, .18); }
.ese-code__box.is-invalid { border-color: #dc3545; }
.ese-hint { font-size: 12px; color: #6b7280; }

/* ---------- Buttons ---------- */
.ese-btn {
	display: inline-block;
	border: 0;
	border-radius: 8px;
	padding: 10px 18px;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	line-height: 1.2;
	text-decoration: none;
}
.ese-btn:disabled { opacity: .6; cursor: default; }
.ese-btn--primary { background: var(--ese-primary); color: #fff; }
.ese-btn--secondary { background: #e5e7eb; color: #1d2327; }
.ese-btn--primary:hover:not(:disabled) { filter: brightness(.93); }
.ese-btn--trigger { background: var(--ese-primary); color: #fff; }

/* ---------- Messages ---------- */
.ese-msg:empty { display: none; }
.ese-msg { margin-bottom: 12px; }
.ese-alert { padding: 10px 14px; border-radius: 8px; font-size: 14px; }
.ese-alert--success { background: #d1e7dd; color: #0f5132; }
.ese-alert--danger { background: #f8d7da; color: #842029; }

/* ---------- A11y: lock background scroll ---------- */
body.ese-modal-open { overflow: hidden; }
