/* ==========================================================================
   School Admission Manager — Frontend Form Styles
   ========================================================================== */

/* Wrapper */
#sam-form-wrapper {
	max-width: 880px;
	margin: 32px auto;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	font-size: 15px;
	color: #1a1a2e;
}

/* ── Progress Bar ──────────────────────────────────────────────────────── */
#sam-progress-bar { margin-bottom: 28px; }

#sam-progress-bar ul {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	list-style: none;
	padding: 0;
	margin: 0;
	counter-reset: step;
}

#sam-progress-bar li {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	padding: 10px 6px 8px;
	background: #f1f5f9;
	color: #94a3b8;
	font-size: 11px;
	border-radius: 6px;
	cursor: default;
	transition: background 0.2s, color 0.2s;
	text-align: center;
}

#sam-progress-bar li .sam-step-num {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: #cbd5e1;
	color: #fff;
	font-size: 12px;
	font-weight: 700;
}

#sam-progress-bar li.active {
	background: #2563eb;
	color: #fff;
}
#sam-progress-bar li.active .sam-step-num { background: rgba(255,255,255,.3); }

#sam-progress-bar li.completed {
	background: #16a34a;
	color: #fff;
}
#sam-progress-bar li.completed .sam-step-num { background: rgba(255,255,255,.3); }

/* ── Form Card ─────────────────────────────────────────────────────────── */
#sam-admission-form {
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 10px;
	padding: 36px 40px;
	box-shadow: 0 4px 16px rgba(0,0,0,.06);
}

#sam-admission-form h3 {
	margin: 0 0 24px;
	font-size: 20px;
	color: #1e3a5f;
	padding-bottom: 10px;
	border-bottom: 2px solid #2563eb;
}

#sam-admission-form h4 {
	margin: 24px 0 10px;
	font-size: 14px;
	font-weight: 700;
	color: #475569;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

/* ── Grid Row ──────────────────────────────────────────────────────────── */
.sam-row {
	display: grid;
	grid-template-columns: repeat( auto-fit, minmax( 180px, 1fr ) );
	gap: 16px;
}

/* ── Fields ────────────────────────────────────────────────────────────── */
.sam-field { margin-bottom: 18px; }

.sam-field label {
	display: block;
	font-size: 13px;
	font-weight: 600;
	color: #374151;
	margin-bottom: 6px;
}

.sam-field label span[aria-hidden] { color: #dc2626; margin-left: 2px; }

.sam-field input[type="text"],
.sam-field input[type="email"],
.sam-field input[type="tel"],
.sam-field input[type="number"],
.sam-field input[type="date"],
.sam-field select,
.sam-field textarea {
	width: 100%;
	box-sizing: border-box;
	padding: 9px 12px;
	border: 1.5px solid #d1d5db;
	border-radius: 6px;
	font-size: 14px;
	color: #111827;
	background: #f9fafb;
	transition: border-color 0.2s, box-shadow 0.2s;
}

.sam-field input:focus,
.sam-field select:focus,
.sam-field textarea:focus {
	outline: none;
	border-color: #2563eb;
	background: #fff;
	box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

.sam-field input.sam-error,
.sam-field select.sam-error,
.sam-field textarea.sam-error,
input[type="checkbox"].sam-error {
	border-color: #ef4444 !important;
	box-shadow: 0 0 0 3px rgba(239,68,68,.1);
}

/* Checkbox */
.sam-checkbox-field label {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	font-weight: normal;
	font-size: 14px;
	cursor: pointer;
	line-height: 1.5;
}
.sam-checkbox-field input[type="checkbox"] { margin-top: 3px; flex-shrink: 0; }

/* File inputs */
.sam-field input[type="file"] {
	padding: 6px 0;
	border: none;
	background: transparent;
	font-size: 13px;
}
.sam-upload-note {
	background: #eff6ff;
	border: 1px solid #bfdbfe;
	border-radius: 6px;
	padding: 10px 14px;
	font-size: 13px;
	color: #1d4ed8;
	margin-bottom: 20px;
}

/* ── Declaration Box ───────────────────────────────────────────────────── */
.sam-declaration-box {
	background: #f0f9ff;
	border: 1px solid #bae6fd;
	border-radius: 8px;
	padding: 18px 20px;
	margin-bottom: 20px;
	font-size: 14px;
	color: #0c4a6e;
	line-height: 1.7;
}

/* ── Repeater Headers ──────────────────────────────────────────────────── */
.sam-repeater-header {
	display: grid;
	gap: 8px;
	padding: 0 0 6px;
	font-size: 12px;
	font-weight: 700;
	color: #6b7280;
	text-transform: uppercase;
	letter-spacing: 0.4px;
}
.sam-academic-header {
	grid-template-columns: 2fr 1fr 1fr 1fr 1fr 2fr 48px;
}

/* ── Repeater Rows ─────────────────────────────────────────────────────── */
.sam-academic-row,
.sam-sibling-row {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
	padding: 10px 12px;
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 6px;
	margin-bottom: 8px;
}

.sam-academic-row input,
.sam-sibling-row input,
.sam-sibling-row select {
	flex: 1 1 100px;
	min-width: 80px;
	padding: 7px 10px;
	border: 1.5px solid #d1d5db;
	border-radius: 5px;
	font-size: 13px;
	background: #fff;
}

.sam-btn-remove {
	flex-shrink: 0;
	width: 32px;
	height: 32px;
	background: #fef2f2;
	border: 1px solid #fca5a5;
	color: #dc2626;
	border-radius: 5px;
	cursor: pointer;
	font-size: 14px;
	line-height: 1;
	display: flex;
	align-items: center;
	justify-content: center;
}
.sam-btn-remove:hover { background: #fee2e2; }

.sam-add-btn {
	margin-top: 4px;
	background: #eff6ff;
	border: 1.5px dashed #93c5fd;
	color: #2563eb;
	padding: 8px 18px;
	border-radius: 6px;
	cursor: pointer;
	font-size: 13px;
	font-weight: 600;
	transition: background 0.2s;
}
.sam-add-btn:hover { background: #dbeafe; }

/* ── Navigation Buttons ────────────────────────────────────────────────── */
.sam-nav-buttons {
	display: flex;
	gap: 12px;
	margin-top: 30px;
	padding-top: 20px;
	border-top: 1px solid #e2e8f0;
}

.sam-nav-buttons button {
	padding: 11px 28px;
	border-radius: 6px;
	font-size: 14px;
	font-weight: 700;
	cursor: pointer;
	border: none;
	transition: background 0.2s, transform 0.1s;
}
.sam-nav-buttons button:active { transform: scale(0.98); }

#sam-prev-btn { background: #f1f5f9; color: #374151; }
#sam-prev-btn:hover { background: #e2e8f0; }

#sam-next-btn   { background: #2563eb; color: #fff; margin-left: auto; }
#sam-next-btn:hover   { background: #1d4ed8; }

#sam-submit-btn { background: #16a34a; color: #fff; margin-left: auto; }
#sam-submit-btn:hover { background: #15803d; }
#sam-submit-btn:disabled { background: #94a3b8; cursor: not-allowed; }

/* ── Messages ──────────────────────────────────────────────────────────── */
.sam-success-box {
	background: #f0fdf4;
	border: 1px solid #86efac;
	border-radius: 10px;
	padding: 36px 28px;
	text-align: center;
	color: #14532d;
}
.sam-success-icon {
	width: 56px;
	height: 56px;
	background: #16a34a;
	color: #fff;
	border-radius: 50%;
	font-size: 28px;
	line-height: 56px;
	margin: 0 auto 16px;
}
.sam-success-box h3 { font-size: 22px; margin: 0 0 12px; }
.sam-success-box p  { font-size: 15px; margin: 6px 0; }

.sam-error-box {
	background: #fef2f2;
	border: 1px solid #fca5a5;
	border-radius: 7px;
	padding: 13px 18px;
	color: #991b1b;
	font-size: 14px;
	margin-bottom: 18px;
}

/* ── Responsive ────────────────────────────────────────────────────────── */
@media ( max-width: 640px ) {
	#sam-admission-form        { padding: 20px 18px; }
	#sam-progress-bar li       { font-size: 9px; padding: 8px 3px; }
	.sam-step-label            { display: none; }
	.sam-row                   { grid-template-columns: 1fr; }
	.sam-academic-row,
	.sam-sibling-row           { flex-direction: column; align-items: stretch; }
	.sam-academic-row input,
	.sam-sibling-row input,
	.sam-sibling-row select    { flex: 1 1 100%; }
	.sam-nav-buttons button    { padding: 10px 16px; font-size: 13px; }
}