/* Star Admissions — public-facing styles */

/* Page-level scrollbar theming — safe here since this stylesheet only loads
   on pages carrying the [star_admissions_apply] / [star_admissions_form] shortcodes. */
html:has(.sa-root) { scrollbar-width: thin; scrollbar-color: #F2B705 #F5EDE0; }
html:has(.sa-root)::-webkit-scrollbar { width: 10px; }
html:has(.sa-root)::-webkit-scrollbar-track { background: #F5EDE0; }
html:has(.sa-root)::-webkit-scrollbar-thumb { background: #F2B705; border-radius: 8px; border: 2px solid #F5EDE0; }
html:has(.sa-root)::-webkit-scrollbar-thumb:hover { background: #A87A00; }

.sa-root, .sa-root * { box-sizing: border-box; }
.sa-overlay, .sa-overlay * { box-sizing: border-box; }
/* .sa-overlay repeats the theme variables (not just .sa-root) because the apply
   popup gets moved to a direct child of <body> at open time — to escape an
   Elementor ancestor that has a CSS transform (which breaks position:fixed
   centering) — so it can no longer rely on inheriting these from .sa-root. */
.sa-root, .sa-overlay {
	/* 5Star University palette: gold accents + dark charcoal chrome.
	   --sa-orange/-dark keep their names (used throughout) but now hold gold. */
	--sa-orange: #F2B705;       /* gold accent / fills */
	--sa-orange-dark: #A87A00;  /* deep gold — readable as text on light bg */
	--sa-dark: #2A2620;         /* charcoal for buttons / header bars */
	--sa-dark-2: #17140F;       /* deeper charcoal for gradients */
	--sa-ink: #1F1B16;
	--sa-muted: #7A7268;
	--sa-line: #EDE3D6;
	--sa-bg: #FFFCF8;
	font-family: 'Poppins', 'Segoe UI', Arial, sans-serif;
	color: var(--sa-ink);
}

/* Apply Now trigger button */
.sa-apply-btn {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	background: linear-gradient(135deg, var(--sa-dark), var(--sa-dark-2));
	color: var(--sa-orange);
	border: 1.5px solid var(--sa-orange);
	padding: 16px 34px;
	font-size: 16px;
	font-weight: 600;
	letter-spacing: .3px;
	border-radius: 999px;
	cursor: pointer;
	box-shadow: 0 10px 24px rgba(23,20,15,.35);
	transition: transform .15s ease, box-shadow .15s ease;
}
.sa-apply-btn:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(242,183,5,.35); }
.sa-apply-btn svg { width: 18px; height: 18px; }

/* Modal overlay */
.sa-overlay {
	position: fixed; inset: 0; background: rgba(20,15,8,.55);
	backdrop-filter: blur(2px);
	display: none; align-items: center; justify-content: center;
	z-index: 99999; padding: 20px;
}
.sa-overlay.sa-open { display: flex; }
.sa-modal {
	background: #fff; width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto;
	border-radius: 18px; box-shadow: 0 30px 80px rgba(0,0,0,.35);
	animation: sa-pop .18s ease;
	scrollbar-gutter: stable;
	scrollbar-width: thin; scrollbar-color: var(--sa-orange) #F5EDE0;
}
.sa-modal::-webkit-scrollbar { width: 8px; }
.sa-modal::-webkit-scrollbar-track { background: #F5EDE0; border-radius: 0 18px 18px 0; }
.sa-modal::-webkit-scrollbar-thumb { background: var(--sa-orange); border-radius: 8px; border: 2px solid #F5EDE0; }
.sa-modal::-webkit-scrollbar-thumb:hover { background: var(--sa-orange-dark); }
@keyframes sa-pop { from { transform: scale(.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.sa-modal-head {
	background: linear-gradient(135deg, var(--sa-dark), var(--sa-dark-2));
	color: #fff; padding: 22px 26px; border-radius: 18px 18px 0 0;
	border-bottom: 2px solid var(--sa-orange);
	display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.sa-modal-head h3 { color: var(--sa-orange); }
.sa-modal-body { padding: 24px 26px 26px; }
@media (max-width: 480px) { .sa-modal-body { padding: 18px 18px 20px; } }
.sa-close {
	appearance: none; -webkit-appearance: none; -moz-appearance: none;
	background: rgba(255,255,255,.22); border: none; color: #fff;
	width: 32px; height: 32px; min-width: 32px; padding: 0; margin: 0;
	border-radius: 50%; cursor: pointer; font-size: 20px; line-height: 1;
	display: flex; align-items: center; justify-content: center; flex-shrink: 0;
	font-family: Arial, sans-serif;
}
.sa-close:hover { background: rgba(255,255,255,.35); }

.sa-pay-warning {
	background: #FDEDED; color: #B3261E; border: 1.5px solid #F1B4B0;
	border-radius: 10px; padding: 12px 14px; font-size: 13px; margin-bottom: 18px; font-weight: 600;
	display: flex; align-items: center; gap: 8px;
	animation: sa-warn-pulse 1.7s ease-in-out infinite;
}
.sa-pay-warning-icon { display: inline-block; flex-shrink: 0; animation: sa-warn-icon-bounce 1.7s ease-in-out infinite; }
@keyframes sa-warn-pulse {
	0%, 100% { box-shadow: 0 0 0 0 rgba(179,38,30,.28); border-color: #F1B4B0; }
	50% { box-shadow: 0 0 0 7px rgba(179,38,30,0); border-color: #E8938D; }
}
@keyframes sa-warn-icon-bounce {
	0%, 100% { transform: scale(1) rotate(0deg); }
	25% { transform: scale(1.15) rotate(-6deg); }
	50% { transform: scale(1) rotate(0deg); }
	75% { transform: scale(1.15) rotate(6deg); }
}

.sa-proof-toggle { display: flex; gap: 10px; margin-bottom: 4px; }
.sa-proof-option {
	flex: 1; border: 2px solid var(--sa-line); border-radius: 10px; padding: 12px; text-align: center;
	cursor: pointer; font-weight: 600; font-size: 13px; color: var(--sa-muted); transition: all .15s;
}
.sa-proof-option.sa-selected { border-color: var(--sa-orange); color: var(--sa-orange-dark); background: #FFF6EA; }

.sa-steps { display:flex; gap:8px; margin-bottom: 20px; }
.sa-step-dot { flex:1; height:4px; border-radius: 4px; background: var(--sa-line); }
.sa-step-dot.sa-active { background: var(--sa-orange); }

.sa-pay-options { display: flex; gap: 12px; margin-bottom: 18px; }
.sa-pay-option {
	flex: 1; border: 2px solid var(--sa-line); border-radius: 12px; padding: 14px; text-align: center;
	cursor: pointer; font-weight: 600; color: var(--sa-muted); transition: all .15s;
}
.sa-pay-option.sa-selected { border-color: var(--sa-orange); color: var(--sa-orange-dark); background: #FFF6EA; }

.sa-pay-details {
	background: var(--sa-bg); border: 1px dashed var(--sa-line); border-radius: 12px; padding: 16px 18px; margin-bottom: 18px; font-size: 14px;
}
.sa-pay-details .sa-row { display: flex; justify-content: space-between; padding: 5px 0; border-bottom: 1px solid var(--sa-line); }
.sa-pay-details .sa-row:last-child { border-bottom: none; }
.sa-pay-details .sa-row span:first-child { color: var(--sa-muted); }
.sa-pay-details .sa-row span:last-child { font-weight: 600; }

.sa-field { margin-bottom: 16px; }
.sa-field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--sa-ink); }
.sa-field .sa-hint { font-size: 12px; color: var(--sa-muted); margin-top: 4px; }
.sa-field input[type=text], .sa-field input[type=email], .sa-field input[type=tel], .sa-field textarea, .sa-field select {
	width: 100%; padding: 12px 14px; border: 1.5px solid var(--sa-line); border-radius: 10px; font-size: 14px; font-family: inherit;
}
.sa-field input:focus, .sa-field textarea:focus, .sa-field select:focus { outline: none; border-color: var(--sa-orange); }
.sa-upload {
	border: 2px dashed var(--sa-line); border-radius: 12px; padding: 22px; text-align: center; cursor: pointer; color: var(--sa-muted);
}
.sa-upload.sa-has-file { border-color: var(--sa-orange); color: var(--sa-orange-dark); background: #FFF6EA; }
.sa-or-divider { text-align:center; color: var(--sa-muted); font-size: 12px; margin: 14px 0; text-transform: uppercase; letter-spacing: .1em; }

.sa-btn-row { display: flex; gap: 10px; margin-top: 22px; }
.sa-btn {
	flex: 1; padding: 14px; border-radius: 10px; border: none; font-weight: 600; cursor: pointer; font-size: 14px;
}
.sa-btn-primary { background: linear-gradient(135deg, var(--sa-dark), var(--sa-dark-2)); color: var(--sa-orange); border: 1.5px solid var(--sa-orange); }
.sa-btn-secondary { background: var(--sa-bg); border: 1.5px solid var(--sa-line); color: var(--sa-ink); }
.sa-btn:disabled { opacity: .5; cursor: not-allowed; }

.sa-alert { padding: 12px 14px; border-radius: 10px; font-size: 13px; margin-bottom: 16px; }
.sa-alert-error { background: #FDEDED; color: #B3261E; border: 1px solid #F6C7C7; }
.sa-alert-success { background: #ECF9EE; color: #1E7A34; border: 1px solid #BFE8C9; }

.sa-success-view { text-align: center; padding: 20px 0; }
.sa-success-view .sa-icon-circle {
	width: 66px; height: 66px; border-radius: 50%; background: #ECF9EE; color: #1E7A34;
	display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; font-size: 30px;
}

/* ---------------- Admission form: live overlay on the real PDF pages ---------------- */

#sa-form-content { max-width: 920px; margin: 0 auto; padding: 6px 10px 60px; }

.sa-form-bar {
	display: flex; align-items: center; justify-content: space-between; gap: 14px;
	flex-wrap: wrap; margin: 6px 0 18px;
}
.sa-form-bar-note { font-size: 13px; color: var(--sa-muted); flex: 1 1 260px; }
.sa-link-btn { display:inline-flex; align-items:center; gap:8px; background: #fff; border: 1.5px solid var(--sa-line); padding: 10px 18px; border-radius: 999px; color: var(--sa-ink); text-decoration:none; font-size: 13px; font-weight: 600; white-space: nowrap; }
.sa-link-btn:hover { border-color: var(--sa-orange); color: var(--sa-orange-dark); }

.sa-pages { display: flex; flex-direction: column; gap: 26px; }

/* Each page = the real form image as background, with inputs positioned on top.
   container-type lets us size overlay text in cqw (1cqw = 1% of the page width),
   so text scales proportionally with the page at any width. */
.sa-page {
	position: relative;
	width: 100%;
	aspect-ratio: 2480 / 3508;
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	border: 1px solid #E4D8C4;
	box-shadow: 0 14px 40px rgba(60,40,10,.10);
	border-radius: 4px;
	container-type: inline-size;
	overflow: hidden;
}

/* Text / date / textarea inputs sit transparently over their box. */
.sa-f {
	position: absolute;
	border: 0; margin: 0; padding: 0 0.4cqw;
	background: transparent;
	color: #11182d;
	font-family: 'Helvetica Neue', Arial, sans-serif;
	font-size: 15px; /* fallback; per-field cqw set inline */
	line-height: 1.05;
	-webkit-appearance: none; appearance: none;
	border-radius: 2px;
	transition: background .12s ease, box-shadow .12s ease;
}
textarea.sa-ta {
	line-height: 1.28;
	padding: 0.5cqw 0.5cqw 0;
	resize: none; overflow: hidden;
	white-space: pre-wrap;
}
.sa-f:focus {
	outline: none;
	background: rgba(242,183,5,.10);
	box-shadow: 0 0 0 1px rgba(242,183,5,.55) inset;
}
.sa-f:required:focus { box-shadow: 0 0 0 1px rgba(242,183,5,.55) inset; }
.sa-f.sa-missing { background: rgba(179,38,30,.10); box-shadow: 0 0 0 1px rgba(179,38,30,.55) inset; }
.sa-date { color: #11182d; }
.sa-date::-webkit-calendar-picker-indicator { opacity: .45; cursor: pointer; }

/* Radio / checkbox: transparent clickable pill + a mark shown when selected. */
.sa-opt { position: absolute; cursor: pointer; display: block; }
.sa-opt input { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }
.sa-opt:hover { background: rgba(242,183,5,.08); border-radius: 3px; }
.sa-mark {
	position: absolute;
	width: 2.05cqw; height: 2.05cqw;
	transform: translate(-50%, -50%);
	border-radius: 50%;
	background: #11182d;
	opacity: 0; transition: opacity .1s ease;
	pointer-events: none;
}
.sa-opt input:checked ~ .sa-mark { opacity: 1; }
.sa-opt:focus-within { outline: 2px solid rgba(242,183,5,.6); outline-offset: 1px; border-radius: 3px; }

/* Signature slot on the form's signature line. */
.sa-sign-slot {
	position: absolute; cursor: pointer;
	display: flex; align-items: center; justify-content: center;
	border: 1px dashed rgba(242,183,5,.75);
	border-radius: 3px;
	background: rgba(242,183,5,.05);
}
.sa-sign-slot:hover, .sa-sign-slot:focus { background: rgba(242,183,5,.12); outline: none; }
.sa-sign-slot.sa-signed { border-color: transparent; background: transparent; }
.sa-sign-hint { font-size: 1.5cqw; color: var(--sa-orange-dark); font-weight: 600; white-space: nowrap; pointer-events: none; }
.sa-sign-preview { display: none; max-width: 100%; max-height: 100%; object-fit: contain; }
.sa-sign-slot.sa-signed .sa-sign-preview { display: block; }
.sa-sign-slot.sa-signed .sa-sign-hint { display: none; }

/* Passport photo slot (top-right of page 1). */
.sa-photo-slot {
	position: absolute; cursor: pointer;
	display: flex; align-items: center; justify-content: center; text-align: center;
	border: 1px dashed rgba(242,183,5,.8);
	border-radius: 3px;
	background: rgba(242,183,5,.06);
	overflow: hidden;
}
.sa-photo-slot:hover, .sa-photo-slot:focus { background: rgba(242,183,5,.14); outline: none; }
.sa-photo-hint { font-size: 1.5cqw; line-height: 1.35; color: var(--sa-orange-dark); font-weight: 600; pointer-events: none; }
.sa-photo-preview { display: none; width: 100%; height: 100%; object-fit: contain; }
.sa-photo-slot.sa-has-photo { border-color: transparent; background: transparent; }
.sa-photo-slot.sa-has-photo .sa-photo-preview { display: block; }
.sa-photo-slot.sa-has-photo .sa-photo-hint { display: none; }

/* Mobile: keep the exact form but at a readable width — the user scrolls
   sideways / pinches to zoom rather than the whole form shrinking to nothing. */
@media (max-width: 760px) {
	#sa-form-content { padding: 6px 0 50px; }
	.sa-form-bar { padding: 0 10px; }
	.sa-pages { overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 6px; }
	.sa-page { width: 720px; max-width: none; flex: 0 0 auto; }
	.sa-submit-row { padding: 0 10px; }
	.sa-submit-row .sa-btn { width: 100%; min-width: 0; }
}
@media (max-width: 600px) {
	.sa-overlay { padding: 10px; }
	.sa-modal-head { padding: 18px 18px; }
	.sa-sign-canvas-wrap { margin: 14px 14px 4px; }
}

.sa-submit-row { margin-top: 26px; display: flex; justify-content: center; }
.sa-submit-row .sa-btn { flex: 0 0 auto; min-width: 260px; padding: 15px 30px; border-radius: 12px; font-size: 15px; }

/* Signature modal */
.sa-sign-modal {
	position: fixed; inset: 0; z-index: 100000;
	background: rgba(20,15,8,.6); backdrop-filter: blur(2px);
	display: none; align-items: center; justify-content: center; padding: 18px;
}
.sa-sign-modal.sa-open { display: flex; }
.sa-sign-dialog { background: #fff; width: 100%; max-width: 520px; border-radius: 16px; box-shadow: 0 30px 80px rgba(0,0,0,.35); overflow: hidden; }
.sa-sign-dialog-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--sa-line); }
.sa-sign-x { background: none; border: none; font-size: 24px; line-height: 1; cursor: pointer; color: var(--sa-muted); }
.sa-sign-canvas-wrap { position: relative; margin: 18px 20px 6px; }
#sa-sign-canvas { width: 100%; height: 200px; border: 1.5px solid var(--sa-line); border-radius: 10px; background: #fff; touch-action: none; cursor: crosshair; display: block; }
.sa-sign-baseline { position: absolute; left: 24px; right: 24px; bottom: 46px; border-bottom: 1.5px dashed #D8CBB0; pointer-events: none; }
.sa-sign-actions { display: flex; gap: 10px; padding: 8px 20px 20px; }
.sa-sign-actions .sa-btn { flex: 1; }

/* Success card */
.sa-success-card {
	max-width: 560px; margin: 30px auto; text-align: center; background: #fff;
	border: 1px solid var(--sa-line); border-radius: 16px; padding: 40px 30px;
	box-shadow: 0 14px 40px rgba(60,40,10,.08);
}
.sa-success-card .sa-icon-circle {
	width: 66px; height: 66px; border-radius: 50%; background: #ECF9EE; color: #1E7A34;
	display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; font-size: 30px;
}
.sa-success-card h2 { color: var(--sa-ink); margin: 0 0 8px; }
.sa-success-card p { color: var(--sa-muted); }

.sa-invalid-box { text-align:center; padding: 60px 20px; }
.sa-invalid-box h2 { color: var(--sa-ink); }
.sa-invalid-box p { color: var(--sa-muted); }
