/* ==================== Root & Design System (ธีมชมพู-ฟ้า เน้นชมพู) ==================== */
:root {
  /* โทนสีหลัก: ชมพู (โรงเรียนหนองไผ่) */
  --primary: #D81B60;
  --primary-light: #FF4081;
  --primary-dark: #C2185B;
  --primary-subtle: #FCE4EC;
  --primary-tint: #FFF0F5;

  /* โทนสีรอง: ฟ้า */
  --secondary: #0288D1;
  --secondary-light: #03A9F4;
  --secondary-subtle: #E1F5FE;

  /* สีพื้นหลัง */
  --bg-start: #FFF5F8;
  --bg-end: #F8F9FA;
  --card-bg: #FFFFFF;

  /* สีข้อความ */
  --text-main: #212529;
  --text-muted: #6C757D;
  --text-light: #ADB5BD;

  /* สถานะ */
  --success: #2E7D32;
  --success-bg: #E8F5E9;
  --warning: #EF6C00;
  --warning-bg: #FFF3E0;
  --error: #D32F2F;
  --error-bg: #FFEBEE;

  /* ขนาดและมิติ */
  --radius: 16px;
  --radius-sm: 10px;
  --radius-pill: 9999px;
  --shadow-sm: 0 2px 8px rgba(216, 27, 96, 0.06);
  --shadow-md: 0 4px 20px rgba(216, 27, 96, 0.10);
  --shadow-lg: 0 10px 30px rgba(216, 27, 96, 0.15);
  --transition: all 0.25s ease-in-out;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Kanit', sans-serif;
  background: linear-gradient(180deg, var(--bg-start) 0%, var(--bg-end) 100%);
  min-height: 100vh;
  color: var(--text-main);
  line-height: 1.6;
  font-size: 16px; /* ตัวอักษรพื้นฐานขนาด 16px เพื่อไม่ให้มือถือซูมตอนแตะ input */
}

/* ==================== Header (Side-by-side logo + text) ==================== */
.header {
  background: linear-gradient(135deg, #D81B60 0%, #E91E63 50%, #0288D1 100%);
  padding: 24px 16px 20px;
  color: white;
  box-shadow: 0 4px 20px rgba(216, 27, 96, 0.25);
  position: relative;
}

.header-container {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
  text-align: left;
}

.school-logo {
  width: 68px;
  height: 68px;
  min-width: 68px;
  border-radius: 16px;
  background: #ffffff;
  padding: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  object-fit: contain;
  border: 2px solid rgba(255, 255, 255, 0.8);
}

.header-text {
  flex: 1;
}

.header-text h1 {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 4px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.header-text .subtitle {
  font-size: 0.92rem;
  font-weight: 300;
  opacity: 0.95;
  margin-bottom: 6px;
}

.header-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.header-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(8px);
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.82rem;
  border: 1px solid rgba(255, 255, 255, 0.3);
  font-weight: 400;
}

.header-badge-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #FFFBEB;
  color: #B45309;
  padding: 4px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid #FDE68A;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  transition: all 0.2s ease;
}
.header-badge-link:hover {
  background: #FEF3C7;
  color: #78350F;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}
.header-exam-announcement {
  background: #EFF6FF;
  color: #1D4ED8;
  border-color: #BFDBFE;
}
.header-exam-announcement:hover {
  background: #DBEAFE;
  color: #1E3A8A;
}
.header-enroll-announcement {
  background: #ECFDF5;
  color: #047857;
  border-color: #A7F3D0;
}
.header-enroll-announcement:hover {
  background: #D1FAE5;
  color: #065F46;
}

/* ==================== Timeline ==================== */
.timeline-section {
  max-width: 760px;
  margin: -10px auto 14px;
  padding: 0 12px;
  position: relative;
  z-index: 2;
}

.timeline-card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 12px 10px;
  border: 1px solid rgba(216, 27, 96, 0.1);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.timeline-items {
  display: flex;
  min-width: 460px;
  justify-content: space-between;
  align-items: center;
  position: relative;
}

.timeline-step {
  flex: 1;
  text-align: center;
  position: relative;
}

.timeline-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #F1F3F5;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 6px;
  font-size: 0.85rem;
  font-weight: 600;
  transition: var(--transition);
}

.timeline-step.active .timeline-dot {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  box-shadow: 0 0 0 4px var(--primary-subtle);
}

.timeline-date {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
}

.timeline-desc {
  font-size: 0.74rem;
  color: var(--text-muted);
}

/* ==================== Navigation Tabs ==================== */
.tabs-container {
  max-width: 760px;
  margin: 0 auto 16px;
  padding: 0 12px;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: #FCE4EC;
  padding: 4px;
  border-radius: var(--radius-pill);
  gap: 4px;
}

.tab-btn {
  padding: 12px 14px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
}

.tab-btn.active {
  background: white;
  color: var(--primary);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(216, 27, 96, 0.15);
}

.tab-btn-link {
  background: rgba(255, 255, 255, 0.55);
  color: #B45309;
  font-weight: 500;
}
.tab-btn-link:hover {
  background: #FFFFFF;
  color: #92400E;
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.18);
}

@media (max-width: 680px) {
  .tabs {
    grid-template-columns: 1fr 1fr;
    border-radius: 16px;
  }
  .tabs .tab-btn-link {
    grid-column: span 2;
    border-radius: var(--radius-pill);
  }
}

/* ==================== Main Container ==================== */
.container {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 12px 30px;
}

/* ==================== Progress Steps Bar ==================== */
.progress-box {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  padding: 8px 12px;
}

.step-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.step-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: white;
  border: 2px solid #E0E0E0;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.95rem;
  transition: var(--transition);
}

.step-item.active .step-num {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  box-shadow: 0 0 0 4px var(--primary-subtle);
}

.step-item.done .step-num {
  background: var(--secondary);
  border-color: var(--secondary);
  color: white;
}

.step-name {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-muted);
}

.step-item.active .step-name {
  color: var(--primary);
  font-weight: 600;
}

.step-divider {
  width: 32px;
  height: 2px;
  background: #E0E0E0;
  margin: 0 8px;
}

.step-divider.done {
  background: var(--primary);
}

/* ==================== Card Form ==================== */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 24px 20px;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(216, 27, 96, 0.08);
}

.card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--primary-subtle);
}

.card-title .icon {
  font-size: 1.35rem;
}

/* ==================== Form Groups ==================== */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 0.98rem;
  font-weight: 500;
  margin-bottom: 7px;
  color: #333333;
}

.required {
  color: var(--primary);
  font-weight: bold;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-row-3 {
  display: grid;
  grid-template-columns: 140px 1fr 1fr;
  gap: 12px;
}

/* Input, Select, Textarea - Large & Mobile Friendly */
.form-control {
  width: 100%;
  padding: 13px 15px;
  font-family: inherit;
  font-size: 1rem;
  border: 1.5px solid #DCE2E6;
  border-radius: var(--radius-sm);
  background: #FFFFFF;
  color: var(--text-main);
  transition: var(--transition);
  -webkit-appearance: none;
  appearance: none;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-subtle);
}

select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='%23666'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 18px;
  padding-right: 40px;
}

textarea.form-control {
  resize: vertical;
  min-height: 90px;
}

.form-control.locked {
  background: #F8F9FA;
  color: #495057;
  font-weight: 600;
  border-color: #E9ECEF;
  cursor: not-allowed;
}

/* ==================== ตัวเลือกนักเรียนโรงเรียนหนองไผ่เดิม ==================== */
.former-np-box {
  background: #FFF5F8;
  border: 1.5px solid #F8BBD0;
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 18px;
  transition: var(--transition);
}
.former-np-box.active {
  background: #FCE4EC;
  border-color: var(--primary);
  box-shadow: 0 2px 10px rgba(216, 27, 96, 0.08);
}
.former-np-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  font-weight: 600;
  color: var(--primary-dark);
  font-size: 0.98rem;
}
.former-np-toggle input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--primary);
  cursor: pointer;
}
.former-np-id-wrap {
  margin-top: 12px;
  margin-bottom: 0;
  padding-top: 12px;
  border-top: 1px dashed #F48FB1;
}

.hint-text {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-top: 5px;
}

/* Validation Status on Inputs */
.id-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.82rem;
  font-weight: 500;
  margin-top: 5px;
  padding: 2px 8px;
  border-radius: 4px;
}

.id-status-badge.valid {
  background: var(--success-bg);
  color: var(--success);
}

.id-status-badge.invalid {
  background: var(--error-bg);
  color: var(--error);
}

.has-error .form-control {
  border-color: var(--error);
  background-color: #FFF8F8;
}

.error-text {
  color: var(--error);
  font-size: 0.82rem;
  margin-top: 4px;
}

/* ==================== Smart File Upload Component (ไม่ซ้อนทับ ไม่ล้น) ==================== */
.upload-card-item {
  background: #FCFDFD;
  border: 1.5px dashed #D3DDE6;
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 14px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.upload-card-item:hover, .upload-card-item.dragover {
  border-color: var(--primary);
  background: var(--primary-tint);
}

.upload-card-item.has-file {
  border-style: solid;
  border-color: #C8E6C9;
  background: #F9FFF9;
}

.upload-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.upload-title {
  font-weight: 500;
  font-size: 0.95rem;
  color: #2D3748;
}

.upload-optional {
  font-size: 0.78rem;
  background: #ECEFF1;
  color: #546E7A;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.upload-dropzone {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  padding: 10px;
  background: white;
  border-radius: 8px;
  border: 1px solid #EAEAEA;
}

.upload-icon {
  font-size: 1.8rem;
  color: var(--primary);
}

.upload-prompt {
  flex: 1;
}

.upload-prompt .main-prompt {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--primary);
}

.upload-prompt .sub-prompt {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Preview Box (Fixed size, beautifully contained) */
.preview-box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: #FFFFFF;
  border-radius: 8px;
  border: 1px solid #C8E6C9;
  margin-top: 8px;
}

.preview-thumb {
  width: 58px;
  height: 72px;
  min-width: 58px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid #E0E0E0;
  background: #FAFAFA;
}

.preview-thumb.pdf-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  background: #FFF3E0;
  color: #E65100;
}

.preview-info {
  flex: 1;
  overflow: hidden;
}

.preview-name {
  font-size: 0.88rem;
  font-weight: 500;
  color: #2D3748;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.preview-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.preview-badge {
  background: #E8F5E9;
  color: #2E7D32;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 500;
}

.preview-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-remove-file {
  background: #FFEBEE;
  color: #C62828;
  border: 1px solid #FFCDD2;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 0.82rem;
  cursor: pointer;
  font-family: inherit;
  font-weight: 500;
  transition: var(--transition);
}

.btn-remove-file:hover {
  background: #FFCDD2;
}

.btn-recrop-file {
  background: var(--primary-subtle);
  color: var(--primary);
  border: 1px solid rgba(216, 27, 96, 0.35);
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 0.82rem;
  cursor: pointer;
  font-family: inherit;
  font-weight: 500;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-recrop-file:hover {
  background: #F8BBD0;
  color: var(--primary-dark);
}

/* Checkbox toggle (e.g. ปพ.1 ไม่มีด้านหลัง / ผู้ปกครองคือบิดามารดา) */
.helper-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-size: 0.86rem;
  color: #495057;
  cursor: pointer;
}

.helper-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* ==================== Buttons ==================== */
.btn-group {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid #EEEEEE;
}

.btn {
  padding: 13px 26px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, #E91E63 100%);
  color: white;
  box-shadow: 0 4px 14px rgba(216, 27, 96, 0.3);
}

.btn-primary:hover, .btn-primary:active {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  box-shadow: 0 6px 18px rgba(216, 27, 96, 0.4);
}

.btn-secondary {
  background: #F1F3F5;
  color: #495057;
}

.btn-secondary:hover {
  background: #E9ECEF;
}

.btn-success {
  background: linear-gradient(135deg, #2E7D32 0%, #43A047 100%);
  color: white;
  box-shadow: 0 4px 14px rgba(46, 125, 50, 0.3);
}

.btn-block {
  width: 100%;
}

/* ==================== Status Card ==================== */
.status-card {
  background: white;
  border-radius: var(--radius);
  padding: 24px 20px;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(216, 27, 96, 0.08);
}

.status-result-box {
  margin-top: 20px;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.status-found {
  background: #F9FFF9;
  border: 1.5px solid #A5D6A7;
  padding: 18px;
}

.status-not-found {
  background: #FFF8F8;
  border: 1.5px solid #FFCDD2;
  padding: 20px;
  text-align: center;
  color: #C62828;
}

.status-row {
  display: flex;
  justify-content: space-between;
  padding: 9px 0;
  border-bottom: 1px solid #E8F5E9;
  font-size: 0.92rem;
}

.status-row:last-child {
  border-bottom: none;
}

.status-badge {
  padding: 3px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 600;
}

.status-badge.pending {
  background: #FFF3E0;
  color: #E65100;
}

.status-badge.approved {
  background: #E8F5E9;
  color: #2E7D32;
}

.status-badge.rejected {
  background: #FFEBEE;
  color: #C62828;
}

/* ==================== Success Screen ==================== */
.success-screen {
  text-align: center;
  padding: 24px 12px;
}

.success-icon-badge {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, #43A047, #2E7D32);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  margin: 0 auto 16px;
  box-shadow: 0 6px 20px rgba(46, 125, 50, 0.3);
}

.reg-number-display {
  display: inline-block;
  background: var(--primary-subtle);
  color: var(--primary-dark);
  font-size: 1.35rem;
  font-weight: 700;
  padding: 8px 24px;
  border-radius: var(--radius-pill);
  letter-spacing: 1px;
  margin: 14px 0;
}

.success-guidance {
  background: #F8F9FA;
  border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 16px;
  text-align: left;
  margin: 18px 0;
}

.success-guidance p {
  font-size: 0.9rem;
  color: #495057;
  margin: 8px 0;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

/* ==================== Loading Overlay ==================== */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  color: white;
  text-align: center;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(255, 255, 255, 0.25);
  border-top-color: var(--primary-light);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 16px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  font-size: 1.15rem;
  font-weight: 600;
}

.loading-sub {
  font-size: 0.88rem;
  opacity: 0.85;
  margin-top: 6px;
}

/* ==================== Footer ==================== */
.footer {
  text-align: center;
  padding: 20px 16px 36px;
  color: var(--text-muted);
  font-size: 0.8rem;
  line-height: 1.6;
}

.footer a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.footer-contact {
  margin: 8px 0 6px;
}

.footer-contact a {
  font-family: 'Kanit', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: #D81B60 !important;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 16px;
  background: #FFF0F5;
  border-radius: 20px;
  border: 1.5px solid #F8BBD0;
  box-shadow: 0 2px 8px rgba(216, 27, 96, 0.1);
  transition: all 0.2s ease;
}

.footer-contact a:hover {
  background: #FCE4EC;
  border-color: #D81B60;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(216, 27, 96, 0.2);
}

/* ==================== Modern Alert Modal ==================== */
.alert-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: alertFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes alertFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.alert-modal-dialog {
  background: #FFFFFF;
  border-radius: 20px;
  width: 100%;
  max-width: 420px;
  padding: 26px 22px 20px;
  text-align: center;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.35);
  animation: alertScaleIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid rgba(226, 232, 240, 0.9);
}

@keyframes alertScaleIn {
  from { opacity: 0; transform: scale(0.92) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.alert-modal-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  margin: 0 auto 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  font-weight: 700;
}

.alert-modal-icon.warning {
  background: #FFFBEB;
  color: #D97706;
  border: 2px solid #FDE68A;
}

.alert-modal-icon.error {
  background: #FEF2F2;
  color: #DC2626;
  border: 2px solid #FECACA;
}

.alert-modal-icon.success {
  background: #ECFDF5;
  color: #059669;
  border: 2px solid #A7F3D0;
}

.alert-modal-icon.info {
  background: #EFF6FF;
  color: #2563EB;
  border: 2px solid #BFDBFE;
}

.alert-modal-title {
  font-family: 'Kanit', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: #1E293B;
  margin-bottom: 8px;
}

.alert-modal-message {
  font-size: 0.95rem;
  color: #475569;
  line-height: 1.6;
  white-space: pre-line;
  margin-bottom: 22px;
  padding: 0 4px;
}

.alert-modal-footer {
  display: flex;
  justify-content: center;
}

.alert-modal-btn {
  width: 100%;
  padding: 12px 20px;
  font-size: 1rem;
  font-weight: 600;
  font-family: 'Kanit', sans-serif;
  border-radius: 12px;
  background: linear-gradient(135deg, #D81B60 0%, #C2185B 100%);
  color: #FFFFFF;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(216, 27, 96, 0.35);
  transition: all 0.2s;
}

.alert-modal-btn:hover {
  background: linear-gradient(135deg, #C2185B 0%, #AD1457 100%);
  box-shadow: 0 6px 18px rgba(216, 27, 96, 0.45);
  transform: translateY(-1px);
}

/* ==================== Registration Gate (ยังไม่เปิด / ปิดรับสมัคร) ==================== */
.reg-checking {
  text-align: center;
  padding: 50px 20px;
}

.reg-gate-card {
  --gate-color: #EF6C00;
  --gate-soft: #FFF3E0;
  --gate-grad: linear-gradient(135deg, #FB8C00 0%, #EF6C00 100%);
  position: relative;
  overflow: hidden;
  background: var(--card-bg);
  border-radius: 24px;
  padding: 48px 28px 36px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  border: 2px solid var(--gate-soft);
  border-top: 8px solid var(--gate-color);
  margin: 10px 0 30px;
  animation: gateIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.reg-gate-card[data-state="closed"] {
  --gate-color: #D81B60;
  --gate-soft: #FCE4EC;
  --gate-grad: linear-gradient(135deg, #EC407A 0%, #C2185B 100%);
}
.reg-gate-card[data-state="outside_hours"] {
  --gate-color: #0288D1;
  --gate-soft: #E1F5FE;
  --gate-grad: linear-gradient(135deg, #29B6F6 0%, #0277BD 100%);
}
@keyframes gateIn {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
.reg-gate-glow {
  position: absolute;
  top: -120px; left: 50%;
  width: 360px; height: 360px;
  transform: translateX(-50%);
  background: radial-gradient(circle, var(--gate-soft) 0%, transparent 70%);
  pointer-events: none;
}
.reg-gate-icon {
  position: relative;
  width: 104px; height: 104px;
  margin: 0 auto 18px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 3rem;
  background: var(--gate-grad);
  box-shadow: 0 12px 30px rgba(0,0,0,0.15), 0 0 0 10px var(--gate-soft);
  animation: gatePulse 2.4s ease-in-out infinite;
}
@keyframes gatePulse {
  0%, 100% { box-shadow: 0 12px 30px rgba(0,0,0,0.15), 0 0 0 10px var(--gate-soft); }
  50% { box-shadow: 0 12px 30px rgba(0,0,0,0.15), 0 0 0 18px transparent; }
}
.reg-gate-title {
  position: relative;
  font-family: 'Kanit', sans-serif;
  font-size: clamp(1.9rem, 6vw, 2.8rem);
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 18px;
  background: var(--gate-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.reg-gate-message {
  position: relative;
  max-width: 620px;
  margin: 0 auto;
  padding: 18px 22px;
  border-radius: 16px;
  background: var(--gate-soft);
  font-family: 'Kanit', sans-serif;
  color: var(--text-main);
}
.reg-gate-message:empty { display: none; }
.reg-gate-message .line {
  font-size: clamp(1.05rem, 3.6vw, 1.3rem);
  font-weight: 500;
  line-height: 1.6;
}
.reg-gate-message .line + .line {
  font-size: clamp(0.98rem, 3.2vw, 1.12rem);
  font-weight: 400;
  color: #37474F;
}
.reg-gate-message a {
  color: var(--gate-color);
  font-weight: 600;
  text-decoration: underline;
  word-break: break-all;
}
.reg-gate-countdown { position: relative; margin-top: 24px; }
.cd-label {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.cd-grid {
  display: inline-grid;
  grid-template-columns: repeat(4, minmax(64px, 1fr));
  gap: 10px;
}
.cd-cell {
  background: #FFFFFF;
  border: 1.5px solid var(--gate-soft);
  border-radius: 14px;
  padding: 10px 6px 8px;
  box-shadow: var(--shadow-sm);
}
.cd-cell span {
  display: block;
  font-family: 'Kanit', sans-serif;
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--gate-color);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.cd-cell small { font-size: 0.75rem; color: var(--text-muted); }
.reg-gate-actions {
  position: relative;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}
.reg-gate-contact {
  margin-top: 16px;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.reg-gate-contact a { color: var(--primary); font-weight: 600; text-decoration: none; }

.reg-close-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 16px;
  margin-bottom: 14px;
  border-radius: 12px;
  background: linear-gradient(90deg, #FFF3E0, #FFF8F0);
  border: 1px solid #FFE0B2;
  color: #8D4A00;
  font-size: 0.9rem;
}
.reg-close-banner strong { font-family: 'Kanit', sans-serif; }
.reg-close-banner.urgent {
  background: linear-gradient(90deg, #FFEBEE, #FFF5F6);
  border-color: #FFCDD2;
  color: #B71C1C;
  animation: bannerBlink 1.6s ease-in-out infinite;
}
@keyframes bannerBlink {
  0%, 100% { box-shadow: 0 0 0 0 rgba(211, 47, 47, 0.0); }
  50% { box-shadow: 0 0 0 4px rgba(211, 47, 47, 0.12); }
}

/* ==================== Utilities ==================== */
.hidden { display: none !important; }
.ml-auto { margin-left: auto; }


/* ==================== Responsive ==================== */
@media (max-width: 600px) {
  .header { padding: 18px 12px 16px; }
  .school-logo { width: 56px; height: 56px; min-width: 56px; }
  .header-text h1 { font-size: 1.1rem; }
  .header-text .subtitle { font-size: 0.82rem; }
  .header-badge { font-size: 0.75rem; padding: 2px 10px; }
  .card { padding: 18px 14px; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; gap: 10px; }
  .btn-group { flex-direction: column-reverse; }
  .btn { width: 100%; }
  .step-name { display: none; }
  .step-divider { width: 20px; }
  .timeline-card { padding: 10px 6px; }
  .preview-box { flex-direction: column; align-items: flex-start; }
  .preview-actions { width: 100%; justify-content: flex-end; margin-top: 6px; }
}