/* ==========================================================================
   KEC Admission Form - Frontend & Admission Ticket Styles
   ========================================================================== */

.kec-af-wrapper,
.kec-af-lookup-wrapper {
	max-width: 860px;
	margin: 24px auto;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: #1f2937;
	line-height: 1.5;
	box-sizing: border-box;
}

.kec-af-wrapper *,
.kec-af-lookup-wrapper *,
.kec-ticket-sheet * {
	box-sizing: border-box;
}

/* Header */
.kec-af-header {
	background: #ffffff;
	border: 1px solid #d1d5db;
	border-radius: 10px;
	padding: 24px 28px;
	margin-bottom: 20px;
}

.kec-af-org {
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.08em;
	color: #4b5563;
	text-transform: uppercase;
	margin-bottom: 4px;
}

.kec-af-title {
	margin: 0 0 6px;
	font-size: 26px;
	font-weight: 800;
	color: #111827;
}

.kec-af-subtitle {
	margin: 0;
	font-size: 14px;
	color: #4b5563;
}

/* Form Sections */
.kec-af-section {
	background: #ffffff;
	border: 1px solid #d1d5db;
	border-radius: 10px;
	padding: 22px 26px;
	margin: 0 0 18px;
}

.kec-af-section legend {
	font-size: 14px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: #111827;
	padding: 0 8px;
}

.kec-af-personal-layout {
	display: grid;
	grid-template-columns: 1fr 180px;
	gap: 24px;
	align-items: start;
}

.kec-af-grid {
	display: grid;
	gap: 16px;
}

.kec-af-grid-2 {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.kec-af-col-span-2 {
	grid-column: span 2;
}

.kec-af-field {
	display: flex;
	flex-direction: column;
	gap: 5px;
}

.kec-af-field label {
	font-size: 13px;
	font-weight: 600;
	color: #374151;
}

.kec-req {
	color: #dc2626;
}

.kec-af-field input[type="text"],
.kec-af-field input[type="date"],
.kec-af-field input[type="tel"],
.kec-af-field input[type="email"],
.kec-af-field select,
.kec-af-field textarea {
	width: 100%;
	padding: 9px 12px;
	font-size: 14px;
	color: #111827;
	background: #ffffff;
	border: 1px solid #cbd5e1;
	border-radius: 6px;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.kec-af-field input:focus,
.kec-af-field select:focus,
.kec-af-field textarea:focus {
	outline: none;
	border-color: #111827;
	box-shadow: 0 0 0 2px rgba(17, 24, 39, 0.12);
}

.kec-af-field.has-error input,
.kec-af-field.has-error select,
.kec-af-field.has-error textarea {
	border-color: #dc2626;
}

.kec-field-error {
	font-size: 12px;
	color: #dc2626;
	min-height: 16px;
}

/* Photo Uploader */
.kec-af-photo-uploader {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: 8px;
}

.kec-af-photo-uploader > label {
	font-size: 13px;
	font-weight: 600;
	color: #374151;
}

.kec-photo-preview-box {
	width: 140px;
	height: 170px;
	border: 1.5px dashed #9ca3af;
	border-radius: 4px;
	background: #f9fafb;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	font-size: 11px;
	font-weight: 600;
	color: #6b7280;
	padding: 8px;
}

.kec-photo-preview-box img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.kec-af-photo-uploader input[type="file"] {
	width: 100%;
	font-size: 12px;
}

.kec-help {
	font-size: 11px;
	color: #6b7280;
}

/* Buttons & Alerts */
.kec-af-submit-row,
.kec-af-lookup-actions {
	margin-top: 16px;
	display: flex;
	justify-content: flex-end;
}

.kec-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 10px 20px;
	font-size: 14px;
	font-weight: 600;
	border-radius: 6px;
	border: 1px solid transparent;
	cursor: pointer;
	text-decoration: none;
	transition: background-color 0.15s ease, opacity 0.15s ease;
}

.kec-btn-lg {
	padding: 12px 28px;
	font-size: 15px;
}

.kec-btn-primary {
	background: #111827;
	color: #ffffff;
}

.kec-btn-primary:hover,
.kec-btn-primary:focus {
	background: #1f2937;
	color: #ffffff;
}

.kec-btn-secondary {
	background: #f3f4f6;
	color: #111827;
	border-color: #d1d5db;
}

.kec-btn-secondary:hover {
	background: #e5e7eb;
}

.kec-btn:disabled {
	opacity: 0.65;
	cursor: not-allowed;
}

.kec-af-alert {
	padding: 12px 16px;
	border-radius: 6px;
	margin-bottom: 16px;
	font-size: 14px;
}

.kec-af-alert-error {
	background: #fef2f2;
	border: 1px solid #fecaca;
	color: #991b1b;
}

/* Success Panel */
.kec-af-success-panel {
	background: #ffffff;
	border: 1px solid #bbf7d0;
	border-radius: 10px;
	padding: 32px 24px;
	text-align: center;
	margin-bottom: 20px;
}

.kec-af-success-badge {
	width: 48px;
	height: 48px;
	border-radius: 50%;
	background: #16a34a;
	color: #ffffff;
	font-size: 24px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 12px;
}

.kec-af-reg-pill {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: #f3f4f6;
	border: 1px solid #d1d5db;
	border-radius: 6px;
	padding: 10px 18px;
	margin: 14px 0 20px;
	font-size: 15px;
}

.kec-af-reg-pill strong {
	font-size: 18px;
	letter-spacing: 0.03em;
	color: #111827;
}

.kec-af-success-actions {
	display: flex;
	gap: 12px;
	justify-content: center;
	flex-wrap: wrap;
}

/* Ticket Lookup Card */
.kec-af-lookup-card {
	background: #ffffff;
	border: 1px solid #d1d5db;
	border-radius: 10px;
	padding: 24px 28px;
	margin-bottom: 24px;
}

.kec-af-lookup-card h3 {
	margin: 0 0 6px;
	font-size: 20px;
}

.kec-af-lookup-card p {
	margin: 0 0 18px;
	color: #4b5563;
	font-size: 14px;
}

/* ==========================================================================
   Admission Ticket Sheet (Matches Kerala Education Council PDF Layout)
   ========================================================================== */

.kec-print-body {
	background: #e5e7eb;
	margin: 0;
	padding: 24px 16px;
	font-family: Arial, Helvetica, sans-serif;
	color: #111827;
}

.kec-print-toolbar {
	max-width: 794px;
	margin: 0 auto 16px;
	display: flex;
	justify-content: flex-end;
	gap: 10px;
}

.kec-ticket-sheet {
	max-width: 794px;
	margin: 0 auto;
	font-family: Arial, Helvetica, sans-serif;
	color: #111827;
}

.kec-ticket-actions {
	display: flex;
	justify-content: flex-end;
	margin-bottom: 12px;
}

.kec-ticket-card {
	background: #ffffff;
	padding: 36px 40px 28px;
	border: 1px solid #e5e7eb;
	box-shadow: 0 4px 18px rgba(0, 0, 0, 0.06);
}

.kec-ticket-header-box {
	border: 1px solid #9ca3af;
	border-radius: 8px;
	padding: 18px 22px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 20px;
	margin-bottom: 14px;
}

.kec-ticket-institution {
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.06em;
	color: #4b5563;
	text-transform: uppercase;
	margin-bottom: 6px;
}

.kec-ticket-title {
	margin: 0 0 10px;
	font-size: 28px;
	font-weight: 800;
	letter-spacing: 0.02em;
	color: #111827;
	line-height: 1.1;
}

.kec-ticket-subtitle {
	font-size: 12px;
	color: #4b5563;
}

.kec-ticket-photo-box {
	width: 106px;
	height: 126px;
	border: 1px solid #9ca3af;
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	font-size: 10px;
	font-weight: 700;
	color: #4b5563;
	padding: 6px;
	overflow: hidden;
}

.kec-ticket-photo-box img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.kec-ticket-reg-box {
	border: 1px solid #9ca3af;
	border-radius: 6px;
	padding: 12px 18px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 22px;
}

.kec-ticket-reg-label {
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.05em;
	color: #4b5563;
	text-transform: uppercase;
}

.kec-ticket-reg-value {
	font-size: 19px;
	font-weight: 800;
	letter-spacing: 0.03em;
	color: #111827;
}

.kec-ticket-section-heading {
	font-size: 11px;
	font-weight: 800;
	letter-spacing: 0.04em;
	color: #111827;
	text-transform: uppercase;
	padding-bottom: 6px;
	border-bottom: 1.5px solid #111827;
	margin-bottom: 0;
}

.kec-ticket-instructions-heading {
	margin-top: 22px;
}

.kec-ticket-info-table,
.kec-ticket-instructions-table {
	width: 100%;
	border-collapse: collapse;
	margin: 0;
}

.kec-ticket-info-table th,
.kec-ticket-info-table td,
.kec-ticket-instructions-table td {
	border-bottom: 1px solid #e5e7eb;
	padding: 8px 6px;
	vertical-align: middle;
	text-align: left;
}

.kec-ticket-info-table th {
	width: 21%;
	font-size: 9.5px;
	font-weight: 700;
	color: #4b5563;
	text-transform: uppercase;
	letter-spacing: 0.02em;
}

.kec-ticket-info-table td {
	width: 29%;
	font-size: 12px;
	color: #111827;
}

.kec-val-strong {
	font-weight: 600;
}

.kec-ticket-instructions-table .kec-instr-num {
	width: 36px;
	font-size: 11px;
	font-weight: 700;
	color: #111827;
}

.kec-ticket-instructions-table .kec-instr-text {
	font-size: 11px;
	color: #1f2937;
}

.kec-ticket-divider {
	border-top: 1.5px solid #111827;
	margin-top: 26px;
	margin-bottom: 24px;
}

.kec-ticket-signatures {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	margin-bottom: 26px;
}

.kec-sig-col {
	min-width: 220px;
}

.kec-sig-right {
	text-align: left;
}

.kec-sig-label {
	font-size: 9.5px;
	font-weight: 700;
	color: #4b5563;
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

.kec-sig-org {
	font-size: 10px;
	color: #6b7280;
	margin-top: 3px;
}

.kec-ticket-footer {
	text-align: center;
	font-size: 9.5px;
	color: #6b7280;
	letter-spacing: 0.03em;
	text-transform: uppercase;
}

/* Responsive */
@media (max-width: 720px) {
	.kec-af-personal-layout {
		grid-template-columns: 1fr;
	}
	.kec-af-grid-2 {
		grid-template-columns: 1fr;
	}
	.kec-af-col-span-2 {
		grid-column: span 1;
	}
	.kec-ticket-card {
		padding: 20px 16px;
	}
	.kec-ticket-header-box {
		flex-direction: column;
		align-items: flex-start;
	}
	.kec-ticket-info-table th,
	.kec-ticket-info-table td {
		display: block;
		width: 100%;
	}
	.kec-ticket-info-table th {
		border-bottom: none;
		padding-bottom: 2px;
	}
}

/* Print Rules */
@media print {
	@page {
		size: A4 portrait;
		margin: 10mm;
	}
	body.kec-print-body {
		background: #ffffff;
		padding: 0;
		margin: 0;
	}
	.no-print {
		display: none !important;
	}
	.kec-ticket-card {
		border: none;
		box-shadow: none;
		padding: 8px 10px;
	}
}
