*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --gold: #C9A84C; --gold-light: #E2C97E; --gold-dark: #8B6914;
  --black: #1A1A1A; --white: #FFFFFF; --cream: #FFFDF7;
  --border: #D4B96A; --input-border: #C8C8C8;
}
body { font-family: 'Montserrat', sans-serif; background: #F0EDE4; color: var(--black); font-size: 12px; line-height: 1.4; }
.page { max-width: 900px; margin: 20px auto; background: var(--cream); padding: 28px 32px 24px; border: 1.5px solid var(--border); box-shadow: 0 4px 24px rgba(0,0,0,0.12); position: relative; overflow: hidden; }
.page::before { content: '♪ ♫ ♩ ♬'; position: absolute; top: 10px; left: 10px; font-size: 28px; color: var(--gold-light); opacity: 0.25; letter-spacing: 14px; pointer-events: none; }
.page::after  { content: '♪ ♫ ♩ ♬'; position: absolute; top: 10px; right: 10px; font-size: 28px; color: var(--gold-light); opacity: 0.25; letter-spacing: 14px; pointer-events: none; }

/* HEADER */
.header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 10px; gap: 12px; }
.header-logo { display: flex; align-items: center; gap: 16px; flex: 1; min-width: 0; }
.logo-icon { width: 100%; text-align: center; }
.logo-icon img { width: 500px; max-width: 100%; height: auto; display: block; margin: 0 auto; }
.logo-text { display: flex; flex-direction: column; gap: 2px; }
.logo-title { font-size: 38px; font-weight: 700; letter-spacing: 6px; color: var(--black); line-height: 1; }
.logo-title span { color: var(--gold); }
.logo-subtitle { font-size: 11px; letter-spacing: 8px; color: var(--gold); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.logo-subtitle::before { content: '—•'; } .logo-subtitle::after { content: '•—'; }
.logo-tagline-row { font-size: 9.5px; letter-spacing: 4px; font-weight: 600; margin-top: 2px; }
.tagline-script { text-align: center; margin: 4px 0 10px; font-family: 'Dancing Script', cursive; font-size: 20px; }
.tagline-script em { color: var(--gold-dark); font-style: italic; }
.gold-line { height: 2px; background: linear-gradient(90deg, transparent, var(--gold), var(--gold-dark), var(--gold), transparent); margin: 8px 0; border-radius: 2px; }

/* PHOTO BOX */
.photo-box { width: 100px; min-height: 110px; border: 1.5px dashed var(--gold); border-radius: 4px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; cursor: pointer; position: relative; overflow: hidden; flex-shrink: 0; background: #fffcf2; transition: background 0.2s; }
.photo-box:hover { background: #fff8e6; border-color: var(--gold-dark); }
.photo-box input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; z-index: 2; }
.photo-box svg { width: 28px; height: 28px; }
.photo-box p { font-size: 9.5px; text-align: center; color: #666; line-height: 1.4; font-weight: 600; pointer-events: none; }
#photo-preview { display: none; width: 100%; height: 110px; object-fit: cover; position: absolute; inset: 0; border-radius: 3px; z-index: 1; }

/* TITLE BAR */
.form-title-bar { background: var(--black); border-radius: 30px; text-align: center; padding: 10px 0; margin: 6px 0 16px; position: relative; }
.form-title-bar h1 { font-size: 20px; font-weight: 700; letter-spacing: 6px; color: var(--gold); }
.form-title-bar::before { content: '❧'; position: absolute; top: 50%; transform: translateY(-50%); left: 24px; color: var(--gold); font-size: 18px; }
.form-title-bar::after  { content: '❧'; position: absolute; top: 50%; transform: translateY(-50%); right: 24px; color: var(--gold); font-size: 18px; }

/* SECTION HEADER */
.section-header { background: var(--gold); color: var(--black); font-weight: 700; font-size: 11.5px; letter-spacing: 1px; padding: 6px 12px; border-radius: 4px; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.form-section { margin-bottom: 16px; }
.section-icon { display: inline-flex; align-items: center; justify-content: center; background: var(--black); border-radius: 50%; width: 20px; height: 20px; flex-shrink: 0; }
.section-icon svg { width: 12px; height: 12px; fill: var(--gold); }

/* FORM GRID */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 24px; }
.form-row { display: flex; align-items: center; gap: 8px; }
.form-row label { font-size: 11px; font-weight: 600; white-space: nowrap; min-width: 90px; }
.form-row input[type="text"],
.form-row input[type="email"],
.form-row input[type="date"] { flex: 1; border: none; border-bottom: 1px solid var(--input-border); background: transparent; font-family: 'Montserrat', sans-serif; font-size: 11px; padding: 3px 2px; outline: none; color: var(--black); width: 100%; min-width: 0; }
.form-row input:focus { border-bottom-color: var(--gold); }
.gender-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.gender-row label.main-label { font-size: 11px; font-weight: 600; min-width: 90px; }
.checkbox-group { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.checkbox-item { display: flex; align-items: center; gap: 4px; font-size: 11px; }
.checkbox-item input[type="checkbox"],
.checkbox-item input[type="radio"] { width: 13px; height: 13px; accent-color: var(--gold-dark); cursor: pointer; flex-shrink: 0; }

/* COURSES */
.course-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; border: 1px solid var(--border); border-radius: 6px; padding: 10px; margin-bottom: 12px; }
.course-item { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 10px; font-weight: 600; text-align: center; line-height: 1.3; }
.course-item input { width: 13px; height: 13px; accent-color: var(--gold-dark); cursor: pointer; }
.batch-days-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; border: 1px solid var(--border); border-radius: 6px; padding: 10px 14px; }
.batch-label { font-size: 11px; font-weight: 700; margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.batch-label svg { width: 14px; height: 14px; flex-shrink: 0; }
.batch-options { display: flex; gap: 14px; flex-wrap: wrap; }
.days-options { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }

/* EXPERIENCE */
.exp-student-row { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
.exp-table { width: 100%; border-collapse: collapse; border: 1px solid var(--border); overflow: hidden; }
.exp-table th { background: var(--black); color: var(--gold); font-size: 10.5px; font-weight: 700; padding: 7px 10px; text-align: center; }
.exp-table th:first-child { text-align: left; }
.exp-table td { border: 1px solid var(--border); padding: 7px 10px; font-size: 11px; text-align: center; font-weight: 600; }
.exp-table td:first-child { text-align: left; }
.exp-table tr:nth-child(even) td { background: #FBF8F0; }

/* STUDENT INTEREST */
.student-interest-box { border: 1px solid var(--border); border-radius: 6px; padding: 10px 12px; }
.si-title { background: var(--gold); color: var(--black); font-weight: 700; font-size: 10.5px; padding: 5px 10px; border-radius: 3px; margin: -10px -12px 10px; display: flex; align-items: center; gap: 6px; }
.si-title svg { width: 14px; height: 14px; }
.si-goal { font-size: 10.5px; font-weight: 700; margin-bottom: 6px; }
.si-items { display: flex; flex-direction: column; gap: 4px; }
.si-items .checkbox-item { font-size: 10.5px; }
.si-other-input { width: 100%; border: 1px solid var(--input-border); border-radius: 3px; padding: 4px 6px; font-size: 10px; margin-top: 6px; font-family: 'Montserrat', sans-serif; outline: none; }
.si-other-input:focus { border-color: var(--gold); }

/* TWO-COL */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.sub-section { border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.sub-section-header { background: var(--gold); color: var(--black); font-weight: 700; font-size: 11px; padding: 6px 12px; display: flex; align-items: center; gap: 6px; }
.sub-section-body { padding: 10px 12px; }
textarea.training-area { width: 100%; height: 80px; border: none; resize: none; font-family: 'Montserrat', sans-serif; font-size: 11px; outline: none; background: transparent; }
.medical-question { font-size: 11px; font-weight: 600; margin-bottom: 6px; }
.medical-options { display: flex; gap: 14px; margin-bottom: 8px; flex-wrap: wrap; }
textarea.medical-area { width: 100%; height: 40px; border: 1px solid var(--input-border); border-radius: 3px; resize: none; font-family: 'Montserrat', sans-serif; font-size: 11px; padding: 4px 6px; outline: none; background: transparent; }

/* TERMS + OFFICE */
.terms-office-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.terms-list { display: flex; flex-direction: column; gap: 5px; padding: 10px 12px; }
.terms-list .checkbox-item { font-size: 10.5px; align-items: flex-start; }
.terms-list .checkbox-item input { margin-top: 2px; }
.signature-row { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; padding: 10px 12px 6px; border-top: 1px solid var(--input-border); }
.sig-field label { font-size: 10.5px; font-weight: 600; display: block; margin-bottom: 4px; }
.sig-line { border-bottom: 1px solid #999; height: 22px; }
.office-table { width: 100%; border-collapse: collapse; }
.office-table td { padding: 5px 10px; font-size: 10.5px; border-bottom: 1px solid var(--input-border); }
.office-table td:first-child { font-weight: 600; white-space: nowrap; width: 110px; }
.office-table td input[type="text"] { width: 100%; border: none; border-bottom: 1px solid var(--input-border); background: transparent; font-family: 'Montserrat', sans-serif; font-size: 10.5px; outline: none; padding: 2px; }
.office-fee-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.office-fee-row input[type="text"] { width: 70px !important; }

/* FOOTER */
.footer { background: var(--black); color: var(--white); border-radius: 6px; padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.footer-item { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; }
.footer-item svg { width: 18px; height: 18px; fill: var(--gold); flex-shrink: 0; }
.footer-item .addr { font-size: 10px; line-height: 1.4; }
.qr-box { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.qr-placeholder { width: 48px; height: 48px; border: 2px solid var(--gold); border-radius: 3px; display: flex; align-items: center; justify-content: center; }
.qr-label { font-size: 8.5px; text-align: center; color: var(--gold); font-weight: 600; }
.footer-tagline { text-align: center; font-family: 'Dancing Script', cursive; font-size: 15px; color: var(--gold); margin-top: 8px; }

/* SUBMIT */
.submit-wrap { text-align: center; margin: 16px 0 8px; }
.btn-submit { background: var(--black); color: var(--gold); border: 2px solid var(--gold); border-radius: 30px; padding: 12px 48px; font-family: 'Montserrat', sans-serif; font-size: 13px; font-weight: 700; letter-spacing: 3px; cursor: pointer; transition: all 0.2s; }
.btn-submit:hover:not(:disabled) { background: var(--gold); color: var(--black); }
.btn-submit:disabled { opacity: 0.6; cursor: not-allowed; }

/* TOAST */
#toast { display: none; position: fixed; top: 24px; left: 50%; transform: translateX(-50%); z-index: 9999; padding: 14px 28px; border-radius: 8px; font-family: 'Montserrat', sans-serif; font-size: 13px; font-weight: 600; box-shadow: 0 4px 20px rgba(0,0,0,0.2); min-width: 300px; text-align: center; transition: opacity 0.3s; }
#toast.success { background: #1a1a1a; color: #C9A84C; border: 1.5px solid #C9A84C; }
#toast.error   { background: #fff0f0; color: #c0392b; border: 1.5px solid #e74c3c; }

/* FIELD ERROR */
.field-error { color: #c0392b; font-size: 10px; margin-top: 2px; display: block; }
input.invalid, textarea.invalid { border-color: #e74c3c !important; }

/* SUCCESS BANNER */
#success-banner { display: none; background: #1a1a1a; color: var(--gold); border: 2px solid var(--gold); border-radius: 8px; padding: 32px; text-align: center; margin: 16px 0; }
#success-banner h2 { font-size: 20px; margin-bottom: 8px; letter-spacing: 2px; }
#success-banner p  { font-size: 12px; color: #ccc; margin-top: 8px; }
.app-id-display { font-size: 26px; font-weight: 700; letter-spacing: 5px; color: var(--gold); margin: 12px 0; border: 1px dashed var(--gold); display: inline-block; padding: 8px 24px; border-radius: 6px; }

.error {
  border: 2px solid red !important;
  background: #ffe6e6;
  border-radius: 4px;
}

/* ═══════════════════════════════
   RESPONSIVE BREAKPOINTS
═══════════════════════════════ */

/* Tablet: ≤ 768px */
@media (max-width: 768px) {
  .page { margin: 0; padding: 16px; border: none; box-shadow: none; border-radius: 0; }

  /* Header */
  .header { flex-direction: column; align-items: center; }
  .header-logo { width: 100%; justify-content: center; }
  .logo-icon img { width: 300px; }
  .photo-box { width: 80px; min-height: 90px; align-self: center; }

  /* Title bar */
  .form-title-bar h1 { font-size: 15px; letter-spacing: 3px; }

  /* Personal info grid → single column */
  .form-grid { grid-template-columns: 1fr; gap: 10px; }
  .form-row { flex-wrap: wrap; }
  .form-row label { min-width: unset; width: 100%; margin-bottom: 2px; }
  .form-row input[type="text"],
  .form-row input[type="email"],
  .form-row input[type="date"] { width: 100%; }

  /* Gender row */
  .gender-row { flex-direction: column; align-items: flex-start; gap: 6px; }
  .gender-row label.main-label { min-width: unset; }

  /* Courses: 4 columns on tablet */
  .course-grid { grid-template-columns: repeat(4, 1fr); }

  /* Batch + Days → single column */
  .batch-days-row { grid-template-columns: 1fr; gap: 12px; }
  .days-options { grid-template-columns: repeat(3, 1fr); }

  /* Experience + Student Interest → single column */
  .exp-student-row { grid-template-columns: 1fr; gap: 16px; }

  /* Experience table: make columns equal */
  .exp-table th, .exp-table td { padding: 6px 6px; font-size: 10px; }

  /* Two-col sections → single column */
  .two-col { grid-template-columns: 1fr; }

  /* Terms + Office → single column */
  .terms-office-row { grid-template-columns: 1fr; }

  /* Signature row */
  .signature-row { grid-template-columns: 1fr; gap: 12px; }

  /* Footer */
  .footer { flex-direction: column; align-items: flex-start; gap: 10px; padding: 12px; }
  .footer-item { font-size: 11px; }

  /* Submit button */
  .btn-submit { padding: 12px 32px; font-size: 12px; letter-spacing: 2px; }

  /* Office fee row */
  .office-fee-row { gap: 8px; }
}

/* Mobile: ≤ 480px */
@media (max-width: 480px) {
  .page { padding: 12px 10px; }

  /* Header */
  .logo-icon img { width: 220px; }
  .photo-box { width: 70px; min-height: 80px; }
  #photo-preview { height: 80px; }

  /* Title bar */
  .form-title-bar { border-radius: 20px; padding: 8px 36px; }
  .form-title-bar h1 { font-size: 13px; letter-spacing: 2px; }
  .form-title-bar::before,
  .form-title-bar::after { font-size: 14px; left: 10px; right: 10px; }

  /* Section headers */
  .section-header { font-size: 10px; padding: 5px 8px; }

  /* Courses: 2 columns on small mobile */
  .course-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; padding: 8px; }
  .course-item { font-size: 10px; }

  /* Days: 2 columns */
  .days-options { grid-template-columns: repeat(2, 1fr); }

  /* Batch options stacked */
  .batch-options { flex-direction: column; gap: 6px; }

  /* Exp table: shrink padding further */
  .exp-table th, .exp-table td { padding: 5px 4px; font-size: 9.5px; }

  /* Office table */
  .office-table td:first-child { width: 90px; font-size: 10px; }
  .office-table td { padding: 4px 6px; font-size: 10px; }

  /* Footer compact */
  .footer { gap: 8px; }
  .footer-item { font-size: 10px; }
  .footer-tagline { font-size: 12px; }

  /* Submit */
  .btn-submit { width: 100%; padding: 13px 16px; font-size: 12px; letter-spacing: 1.5px; border-radius: 24px; }

  /* Success banner */
  #success-banner { padding: 20px 12px; }
  #success-banner h2 { font-size: 15px; letter-spacing: 1px; }
  .app-id-display { font-size: 18px; letter-spacing: 3px; padding: 6px 14px; }

  /* Toast */
  #toast { min-width: calc(100vw - 32px); font-size: 12px; padding: 12px 16px; }
}

@media print {
  body { background: white; }
  .page { box-shadow: none; margin: 0; border: none; }
  .btn-submit, #toast, #success-banner { display: none !important; }
}