/**
 * Frontend Registration Form Layout, Dynamic Fields & Modal Styles
 * Plugin: ProSchool Registration
 * Author: MBILLE TECH
 *
 * @package ProSchool_Registration
 */

/* ==========================================================================
   1. CSS Custom Properties & Core Resets
   ========================================================================== */
.proschool-registration-wrapper {
	--psr-primary: #2563eb;
	--psr-primary-hover: #1d4ed8;
	--psr-secondary: #0f172a;
	--psr-accent: #f59e0b;
	--psr-success: #16a34a;
	--psr-danger: #dc2626;
	--psr-bg-light: #f8fafc;
	--psr-bg-card: #ffffff;
	--psr-border: #cbd5e1;
	--psr-text: #1e293b;
	--psr-text-muted: #64748b;
	--psr-radius: 10px;
	--psr-shadow: 0 4px 16px rgba(15, 23, 42, 0.08);

	max-width: 900px;
	margin: 30px auto;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
	color: var(--psr-text);
	line-height: 1.5;
}

.proschool-registration-wrapper * {
	box-sizing: border-box;
}

/* ==========================================================================
   2. Header Card & Institutional Branding
   ========================================================================== */
.proschool-header-card {
	background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
	color: #ffffff;
	padding: 30px;
	border-radius: var(--psr-radius);
	box-shadow: var(--psr-shadow);
	display: flex;
	align-items: center;
	gap: 24px;
	margin-bottom: 25px;
	position: relative;
	overflow: hidden;
}

.proschool-logo-container {
	flex-shrink: 0;
	background: #ffffff;
	padding: 10px;
	border-radius: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.proschool-header-logo {
	max-height: 75px;
	max-width: 140px;
	object-fit: contain;
}

.proschool-header-text {
	flex: 1;
}

.proschool-school-title {
	margin: 0;
	font-size: 24px;
	font-weight: 800;
	color: #ffffff;
	letter-spacing: -0.5px;
}

.proschool-school-tagline {
	margin: 4px 0 12px 0;
	font-size: 14px;
	color: #94a3b8;
}

.proschool-academic-badge {
	display: inline-block;
	background: rgba(255, 255, 255, 0.1);
	border: 1px solid rgba(255, 255, 255, 0.2);
	padding: 4px 12px;
	border-radius: 20px;
	font-size: 12px;
	color: #38bdf8;
}

.proschool-academic-badge strong {
	color: #ffffff;
}

/* ==========================================================================
   3. Legacy Student Lookup Bar
   ========================================================================== */
.proschool-legacy-search-box {
	background: var(--psr-bg-card);
	border: 2px solid #bfdbfe;
	border-radius: var(--psr-radius);
	padding: 20px;
	margin-bottom: 25px;
	box-shadow: var(--psr-shadow);
}

.proschool-legacy-search-box .proschool-card-header h3 {
	margin: 0 0 4px 0;
	font-size: 16px;
	font-weight: 700;
	color: var(--psr-primary);
}

.proschool-legacy-search-box .proschool-card-header p {
	margin: 0 0 14px 0;
	font-size: 13px;
	color: var(--psr-text-muted);
}

.proschool-search-field-wrap {
	position: relative;
}

.proschool-autocomplete-dropdown {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	background: #ffffff;
	border: 1px solid var(--psr-border);
	border-radius: 0 0 var(--psr-radius) var(--psr-radius);
	box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
	z-index: 1000;
	max-height: 250px;
	overflow-y: auto;
	display: none;
}

.proschool-autocomplete-item {
	padding: 12px 16px;
	cursor: pointer;
	border-bottom: 1px solid var(--psr-bg-light);
	transition: background 0.15s ease;
	font-size: 13px;
}

.proschool-autocomplete-item:last-child {
	border-bottom: none;
}

.proschool-autocomplete-item:hover {
	background: #eff6ff;
	color: var(--psr-primary);
}

/* ==========================================================================
   4. Multi-Child Cards & Form Elements Grid
   ========================================================================== */
.proschool-child-card {
	background: var(--psr-bg-card);
	border: 1px solid var(--psr-border);
	border-radius: var(--psr-radius);
	padding: 25px;
	margin-bottom: 25px;
	box-shadow: var(--psr-shadow);
	position: relative;
	transition: border-color 0.2s ease;
}

.proschool-child-card:hover {
	border-color: var(--psr-primary);
}

.proschool-child-card-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	border-bottom: 2px solid var(--psr-bg-light);
	padding-bottom: 14px;
	margin-bottom: 20px;
}

.proschool-child-title {
	margin: 0;
	font-size: 18px;
	font-weight: 700;
	color: var(--psr-secondary);
	display: flex;
	align-items: center;
	gap: 8px;
}

.proschool-remove-child-btn {
	background: #fee2e2;
	color: var(--psr-danger);
	border: 1px solid #fca5a5;
	padding: 6px 12px;
	border-radius: 6px;
	font-size: 12px;
	font-weight: 700;
	cursor: pointer;
	transition: all 0.2s ease;
}

.proschool-remove-child-btn:hover {
	background: var(--psr-danger);
	color: #ffffff;
}

.proschool-child-fields-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 18px 20px;
}

/* Specific field full-width overrides */
.proschool-field-type-textarea,
.proschool-field-type-signature,
.proschool-field-type-pdf_block,
.proschool-field-type-image_block {
	grid-column: span 2;
}

/* Form Group Controls */
.proschool-form-group {
	display: flex;
	flex-direction: column;
}

.proschool-label {
	font-size: 13px;
	font-weight: 700;
	color: var(--psr-secondary);
	margin-bottom: 6px;
}

.proschool-required-asterisk {
	color: var(--psr-danger);
	font-weight: 800;
}

.proschool-input,
.proschool-select,
.proschool-textarea {
	width: 100%;
	padding: 10px 14px;
	font-size: 14px;
	color: var(--psr-text);
	background-color: #ffffff;
	border: 1px solid var(--psr-border);
	border-radius: 6px;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
	outline: none;
}

.proschool-input:focus,
.proschool-select:focus,
.proschool-textarea:focus {
	border-color: var(--psr-primary);
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.proschool-help-text {
	font-size: 11px;
	color: var(--psr-text-muted);
	margin-top: 4px;
}

/* Choice Fields Styling */
.proschool-radio-group,
.proschool-checkbox-group {
	display: flex;
	gap: 16px;
	flex-wrap: wrap;
	padding-top: 4px;
}

.proschool-radio-label,
.proschool-checkbox-label {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 14px;
	cursor: pointer;
	user-select: none;
}

.proschool-radio-label input,
.proschool-checkbox-label input {
	accent-color: var(--psr-primary);
	width: 16px;
	height: 16px;
	cursor: pointer;
}

/* File Upload Box */
.proschool-file-upload-box {
	border: 2px dashed var(--psr-border);
	background: var(--psr-bg-light);
	padding: 16px;
	border-radius: 6px;
	text-align: center;
	transition: border-color 0.2s ease;
}

.proschool-file-upload-box:hover {
	border-color: var(--psr-primary);
}

.proschool-file-input {
	font-size: 13px;
	cursor: pointer;
}

/* Payment Display Field Block */
.proschool-payment-field-box {
	background: #f0f7ff;
	border: 1px solid #bfdbfe;
	border-radius: 6px;
	padding: 12px 16px;
}

.proschool-fee-display {
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.proschool-fee-display .fee-title {
	font-weight: 700;
	font-size: 13px;
	color: var(--psr-secondary);
}

.proschool-fee-display .fee-amount-text {
	font-size: 15px;
	color: var(--psr-primary);
	font-weight: 800;
}

/* Media Display Elements */
.proschool-image-display-block .proschool-banner-img {
	width: 100%;
	max-height: 250px;
	object-fit: cover;
	border-radius: 6px;
	border: 1px solid var(--psr-border);
}

.proschool-pdf-viewer-block {
	background: var(--psr-bg-light);
	border: 1px solid var(--psr-border);
	padding: 16px;
	border-radius: 6px;
}

.proschool-pdf-header {
	margin-bottom: 10px;
	font-size: 14px;
	color: var(--psr-secondary);
}

/* Digital Signature Canvas */
.proschool-signature-wrapper {
	border: 1px solid var(--psr-border);
	border-radius: 6px;
	background: #ffffff;
	padding: 10px;
	display: flex;
	flex-direction: column;
	align-items: center;
}

.proschool-signature-canvas {
	border: 1px dashed var(--psr-border);
	border-radius: 4px;
	background: #fcfcfc;
	touch-action: none;
	width: 100%;
	max-width: 450px;
	height: 150px;
}

.proschool-signature-tools {
	margin-top: 8px;
	width: 100%;
	display: flex;
	justify-content: flex-end;
}

/* ==========================================================================
   5. Action Bars & Multi-Child Trigger
   ========================================================================== */
.proschool-add-child-bar {
	text-align: center;
	margin-bottom: 25px;
}

.proschool-btn-add-child {
	background: #ffffff !important;
	color: var(--psr-primary) !important;
	border: 2px dashed var(--psr-primary) !important;
	padding: 12px 24px !important;
	font-size: 15px !important;
	font-weight: 700 !important;
	border-radius: var(--psr-radius) !important;
	cursor: pointer;
	transition: all 0.2s ease !important;
	display: inline-flex;
	align-items: center;
	gap: 8px;
}

.proschool-btn-add-child:hover {
	background: #eff6ff !important;
	border-style: solid !important;
}

/* Parent Information Card */
.proschool-parent-info-card,
.proschool-payment-summary-card {
	background: var(--psr-bg-card);
	border: 1px solid var(--psr-border);
	border-radius: var(--psr-radius);
	padding: 25px;
	margin-bottom: 25px;
	box-shadow: var(--psr-shadow);
}

.proschool-card-header {
	border-bottom: 2px solid var(--psr-bg-light);
	padding-bottom: 12px;
	margin-bottom: 20px;
}

.proschool-card-header h3 {
	margin: 0;
	font-size: 18px;
	font-weight: 700;
	color: var(--psr-secondary);
	display: flex;
	align-items: center;
	gap: 8px;
}

.proschool-grid-2col {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 18px 20px;
}

/* Summary Checkout Table */
.proschool-summary-table-wrap {
	overflow-x: auto;
	margin-bottom: 20px;
}

.proschool-summary-table {
	width: 100%;
	border-collapse: collapse;
}

.proschool-summary-table th,
.proschool-summary-table td {
	padding: 12px 16px;
	border-bottom: 1px solid var(--psr-border);
	font-size: 14px;
}

.proschool-summary-table th {
	background: var(--psr-bg-light);
	color: var(--psr-secondary);
	font-weight: 700;
	text-align: left;
}

.proschool-summary-table .text-right {
	text-align: right;
}

.proschool-summary-table tfoot td {
	border-bottom: none;
	font-size: 16px;
	background: #f0f7ff;
}

#proschool_grand_total_display {
	color: var(--psr-primary);
	font-size: 20px;
}

/* Submit Action Button */
.proschool-submit-action-wrap {
	text-align: center;
}

.proschool-submit-btn {
	background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
	color: #ffffff;
	border: none;
	padding: 16px 36px;
	font-size: 18px;
	font-weight: 800;
	border-radius: 8px;
	cursor: pointer;
	box-shadow: 0 6px 20px rgba(37, 99, 235, 0.3);
	transition: transform 0.15s ease, box-shadow 0.15s ease;
	display: inline-flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	justify-content: center;
}

.proschool-submit-btn:hover {
	transform: translateY(-2px);
	box-shadow: 0 8px 25px rgba(37, 99, 235, 0.4);
}

.proschool-submit-btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
	transform: none;
}

/* ==========================================================================
   6. MTN MoMo Modal & Spinner Loader
   ========================================================================== */
.proschool-modal-overlay {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(15, 23, 42, 0.75);
	backdrop-filter: blur(4px);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 999999;
}

.proschool-modal-content {
	background: #ffffff;
	padding: 35px 30px;
	border-radius: var(--psr-radius);
	max-width: 460px;
	width: 90%;
	text-align: center;
	box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.proschool-spinner-loader {
	width: 50px;
	height: 50px;
	border: 5px solid #e2e8f0;
	border-top: 5px solid var(--psr-primary);
	border-radius: 50%;
	animation: psr-spin 1s linear infinite;
	margin: 0 auto 20px auto;
}

@keyframes psr-spin {
	0% { transform: rotate(0deg); }
	100% { transform: rotate(360deg); }
}

.proschool-modal-title {
	margin: 0 0 10px 0;
	font-size: 20px;
	font-weight: 800;
	color: var(--psr-secondary);
}

.proschool-momo-ref-info {
	background: var(--psr-bg-light);
	padding: 10px;
	border-radius: 6px;
	margin-top: 15px;
	font-size: 13px;
	border: 1px solid var(--psr-border);
}

/* ==========================================================================
   7. Mandatory Footer Attribution
   ========================================================================== */
.proschool-frontend-footer-branding {
	text-align: center;
	padding: 16px 10px;
	margin-top: 30px;
	border-top: 1px solid var(--psr-border);
	font-size: 13px;
	font-weight: 700;
	color: var(--psr-text-muted);
	background-color: var(--psr-bg-card);
	border-radius: var(--psr-radius);
}

/* ==========================================================================
   8. Responsive Media Queries
   ========================================================================== */
@media (max-width: 768px) {
	.proschool-header-card {
		flex-direction: column;
		text-align: center;
	}

	.proschool-child-fields-grid,
	.proschool-grid-2col {
		grid-template-columns: 1fr;
	}

	.proschool-field-type-textarea,
	.proschool-field-type-signature,
	.proschool-field-type-pdf_block,
	.proschool-field-type-image_block {
		grid-column: span 1;
	}

	.proschool-submit-btn {
		font-size: 16px;
		padding: 14px 20px;
	}
}