/* ============================================================
   GREENFIELD PUBLIC SCHOOL — ADMISSION FORM STYLES
   Theme: Professional dark teal + off-white
   ============================================================ */

/* ── RESET & BASE ─────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary: #1a3c5e;
  /* Dark navy-teal */
  --primary-light: #2a5c8e;
  /* Lighter shade */
  --accent: #e8a020;
  /* Gold accent */
  --accent-light: #fff3d6;
  --bg-page: #eef2f7;
  --bg-card: #ffffff;
  --bg-section: #f4f7fb;
  --border: #ccd6e0;
  --text-dark: #1c2b3a;
  --text-mid: #4a6072;
  --text-light: #7a96aa;
  --error: #c0392b;
  --error-bg: #fdf0ee;
  --success: #1e8449;
  --success-bg: #eafaf1;
  --radius: 8px;
  --shadow: 0 4px 20px rgba(26, 60, 94, 0.10);
  --shadow-hover: 0 8px 32px rgba(26, 60, 94, 0.18);
  --transition: 0.25s ease;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-page);
  color: var(--text-dark);
  min-height: 100vh;
  padding: 24px 16px 48px;
}

/* ── PAGE HEADER ──────────────────────────────────────────── */
.page-header {
  max-width: 920px;
  margin: 0 auto 0;
  background: var(--bg-card);
  border-radius: var(--radius) var(--radius) 0 0;
  box-shadow: var(--shadow);
  overflow: hidden;
  border: 1px solid var(--border);
  border-bottom: none;
}

.header-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 28px 32px 20px;
  gap: 24px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
}

.school-brand {
  display: flex;
  align-items: center;
  gap: 18px;
  flex: 1;
}

.school-logo-placeholder {
  width: 72px;
  height: 72px;
  background: rgba(255, 255, 255, 0.15);
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  flex-shrink: 0;
}

.school-sub {
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 4px;
}

.school-name {
  font-family: 'Merriweather', serif;
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
  margin-bottom: 6px;
}

.school-address {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.75);
}

/* Application meta box (top right) */
.form-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.form-meta-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 6px;
  padding: 7px 14px;
}

.meta-label {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.8);
  white-space: nowrap;
  min-width: 120px;
}

.meta-box {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
}

/* Form title bar */
.form-title-bar {
  background: var(--accent);
  text-align: center;
  padding: 10px;
}

.form-title-bar h2 {
  font-family: 'Merriweather', serif;
  font-size: 16px;
  letter-spacing: 3px;
  color: var(--primary);
  font-weight: 700;
}

/* ── FORM WRAPPER ─────────────────────────────────────────── */
.form-wrapper {
  max-width: 920px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: var(--shadow);
  padding: 0 0 32px;
}

/* ── FORM SECTIONS ────────────────────────────────────────── */
.form-section {
  border-bottom: 1px solid var(--border);
}

.form-section:last-of-type {
  border-bottom: none;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
  padding: 12px 28px;
}

.section-letter {
  width: 30px;
  height: 30px;
  background: var(--accent);
  color: var(--primary);
  font-weight: 700;
  font-size: 15px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.section-title {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.section-body {
  padding: 24px 32px;
  background: var(--bg-section);
}

/* ── FORM ROWS & GROUPS ───────────────────────────────────── */
.form-row {
  display: grid;
  gap: 20px;
  margin-bottom: 20px;
}

.form-row:last-child {
  margin-bottom: 0;
}

.one-col {
  grid-template-columns: 1fr;
}

.two-col {
  grid-template-columns: 1fr 1fr;
}

.three-col {
  grid-template-columns: 1fr 1fr 1fr;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-mid);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.req {
  color: var(--error);
}

input[type="text"],
input[type="tel"],
input[type="email"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 10px 14px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: var(--text-dark);
  background: white;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
  appearance: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(42, 92, 142, 0.12);
  background: #fbfdff;
}

input.error,
select.error,
textarea.error {
  border-color: var(--error);
  background: var(--error-bg);
}

textarea {
  resize: vertical;
  min-height: 80px;
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%234a6072' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}

.error-msg {
  font-size: 11px;
  color: var(--error);
  min-height: 16px;
  display: block;
  font-weight: 500;
}

/* ── DOCUMENTS CHECKLIST ──────────────────────────────────── */
.doc-note {
  font-size: 13px;
  color: var(--text-mid);
  margin-bottom: 16px;
  font-style: italic;
}

.checklist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.check-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: white;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-dark);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}

.check-item:hover {
  border-color: var(--primary-light);
  background: #f0f6ff;
}

.check-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  flex-shrink: 0;
  margin: 0;
  padding: 0;
  border: none;
  box-shadow: none;
}

/* ── DECLARATION ──────────────────────────────────────────── */
.declaration-text {
  font-size: 13px;
  color: var(--text-mid);
  line-height: 1.7;
  margin-bottom: 24px;
  padding: 14px 18px;
  background: white;
  border-left: 4px solid var(--accent);
  border-radius: 0 6px 6px 0;
}

.signature-row {
  margin-top: 0;
}

.signature-boxes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 36px;
}

.sig-box {
  text-align: center;
}

.sig-line {
  height: 1.5px;
  background: var(--text-dark);
  margin-bottom: 8px;
}

.sig-box p {
  font-size: 11px;
  color: var(--text-mid);
  font-weight: 500;
}

/* ── FORM ACTIONS ─────────────────────────────────────────── */
.form-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 16px;
  padding: 24px 32px;
  background: white;
  border-top: 1px solid var(--border);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 28px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
  box-shadow: 0 4px 14px rgba(26, 60, 94, 0.35);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(26, 60, 94, 0.45);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-secondary {
  background: white;
  color: var(--text-mid);
  border: 1.5px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-page);
  border-color: var(--primary-light);
  color: var(--primary);
}

/* Spinner inside button */
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

.hidden {
  display: none !important;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ── STATUS MESSAGE ───────────────────────────────────────── */
.form-status {
  margin: 0 32px 16px;
  padding: 14px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  animation: fadeIn 0.3s ease forwards;
}

.form-status.success {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid #a9dfbf;
}

.form-status.failure {
  background: var(--error-bg);
  color: var(--error);
  border: 1px solid #f5b7b1;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

/* ── PAGE FOOTER ──────────────────────────────────────────── */
.page-footer {
  max-width: 920px;
  margin: 0 auto;
  text-align: center;
  padding: 20px;
  font-size: 12px;
  color: var(--text-light);
}

/* ── RESPONSIVE ───────────────────────────────────────────── */
@media (max-width: 700px) {
  .header-inner {
    flex-direction: column;
  }

  .form-meta {
    width: 100%;
  }

  .form-meta-row {
    justify-content: space-between;
  }

  .two-col,
  .three-col {
    grid-template-columns: 1fr;
  }

  .section-body {
    padding: 18px 16px;
  }

  .form-actions {
    flex-direction: column;
    padding: 18px 16px;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }

  .signature-boxes {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .school-name {
    font-size: 18px;
  }
}

@media (max-width: 480px) {
  body {
    padding: 10px 6px 40px;
  }

  .header-inner {
    padding: 18px 16px 14px;
  }

  .form-title-bar h2 {
    font-size: 13px;
    letter-spacing: 2px;
  }
}

/* ── PRINT STYLES ─────────────────────────────────────────── */
@media print {
  body {
    background: white;
    padding: 0;
  }

  .form-actions,
  .page-footer {
    display: none;
  }

  .page-header,
  .form-wrapper {
    box-shadow: none;
    border: 1px solid #ccc;
  }
}