/* =====================================================
   MA (Madrasah Aliyah) Registration Form Stylesheet
   Madrasah As-Sunniyah | Tahun Pelajaran 2026/2027
   ===================================================== */

.ma-ppdb-page {
  background: #f4f6f8;
  min-height: 100vh;
  padding-bottom: 60px;
}

/* ── Hero Banner ── */
.ma-hero {
  background: linear-gradient(135deg, #1b4d3e 0%, #2c6e49 50%, #4c956c 100%);
  color: #fff;
  padding: 80px 20px 60px;
  text-align: center;
  position: relative;
}

.ma-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 6px 18px;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 16px;
}

.ma-hero h1 {
  font-size: 2.4rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.ma-hero p {
  font-size: 1.1rem;
  opacity: 0.9;
  margin-bottom: 24px;
}

.ma-hero-cta {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-ma-primary {
  padding: 12px 30px;
  background: #f0c040;
  color: #1b4d3e;
  font-weight: 700;
  border-radius: 50px;
  text-decoration: none;
  transition: all 0.3s ease;
}

.btn-ma-primary:hover {
  background: #fff;
  transform: translateY(-2px);
}

.btn-ma-outline {
  padding: 12px 30px;
  background: transparent;
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.5);
  font-weight: 600;
  border-radius: 50px;
  text-decoration: none;
  transition: all 0.3s ease;
}

.btn-ma-outline:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: #fff;
}

/* ── Paper Wrapper ── */
.ma-form-section {
  padding: 30px 20px 60px;
}

/* ── Paper Wrapper ── */
.ma-form-section {
  padding: 30px 20px 60px;
}

.ma-paper-wrapper {
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
  padding: 40px 45px;
  border: 1px solid #e2e8f0;
  box-sizing: border-box;
  overflow: hidden;
}

/* Kop Surat */
.ma-kop {
  display: flex;
  align-items: center;
  gap: 20px;
  padding-bottom: 12px;
}

.ma-kop-logo img {
  width: 80px;
  height: 80px;
  object-fit: contain;
}

.ma-kop-text {
  flex: 1;
  text-align: center;
}

.ma-kop-text h2 {
  font-family: 'Times New Roman', Times, serif;
  font-size: 1.8rem;
  font-weight: 800;
  font-style: italic;
  color: #1a1a2e;
  margin-bottom: 4px;
}

.ma-kop-text p {
  font-size: 0.78rem;
  color: #4a5568;
  margin: 0;
  line-height: 1.4;
}

.ma-kop-line {
  margin-bottom: 20px;
}

.ma-kop-line .thick {
  display: block;
  height: 3px;
  background: #1a1a2e;
}

.ma-kop-line .thin {
  display: block;
  height: 1px;
  background: #1a1a2e;
  margin-top: 2px;
}

/* Title & No Form Box */
.ma-title-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.ma-title-text {
  flex: 1;
  text-align: center;
}

.ma-title-text h2 {
  font-size: 1.2rem;
  font-weight: 800;
  color: #1a1a2e;
  margin-bottom: 2px;
  letter-spacing: 0.5px;
}

.ma-title-text h3 {
  font-size: 1rem;
  font-weight: 700;
  color: #2d3748;
  margin-bottom: 2px;
}

.ma-title-text h4 {
  font-size: 0.9rem;
  font-weight: 700;
  color: #4a5568;
  margin-bottom: 6px;
}

.ma-instruction {
  font-size: 0.78rem;
  font-style: italic;
  color: #718096;
}

.ma-no-form-box {
  border: 1.5px solid #1a1a2e;
  border-radius: 6px;
  padding: 6px 12px;
  text-align: center;
  min-width: 140px;
}

.ma-no-form-box .box-label {
  font-size: 0.75rem;
  font-weight: 700;
  display: block;
  border-bottom: 1px solid #1a1a2e;
  padding-bottom: 4px;
  margin-bottom: 4px;
}

.ma-no-form-box .box-value {
  font-size: 0.85rem;
  font-weight: 800;
  color: #1b4d3e;
}

/* ── Fieldsets ── */
.ma-fieldset {
  border: none;
  padding: 0;
  margin-bottom: 24px;
}

.ma-fieldset legend {
  font-size: 0.95rem;
  font-weight: 800;
  color: #1a1a2e;
  padding: 0;
  margin-bottom: 12px;
  border-bottom: 2px solid #cbd5e0;
  width: 100%;
}

/* Fields & Grid Layout */
.ma-field {
  display: flex;
  align-items: flex-start;
  margin-bottom: 10px;
  gap: 6px;
  width: 100%;
  min-width: 0;
}

.ma-field label {
  font-size: 0.85rem;
  color: #2d3748;
  width: 175px;
  min-width: 175px;
  flex-shrink: 0;
  display: flex;
  gap: 4px;
  padding-top: 6px;
}

.f-num {
  font-weight: 700;
}

.f-colon {
  width: 12px;
  flex-shrink: 0;
  text-align: center;
  font-weight: bold;
  padding-top: 6px;
}

.ma-field input[type="text"],
.ma-field input[type="tel"],
.ma-field input[type="email"],
.ma-field input[type="date"] {
  flex: 1;
  min-width: 0;
  padding: 7px 12px;
  border: 1px solid #cbd5e0;
  border-radius: 6px;
  font-size: 0.85rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.ma-field input:focus {
  border-color: #2c6e49;
  box-shadow: 0 0 0 3px rgba(44, 110, 73, 0.1);
}

.f-split {
  display: flex;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.f-split input {
  flex: 1;
  min-width: 0;
}

.f-options {
  display: flex;
  gap: 20px;
  flex: 1;
  align-items: center;
  flex-wrap: wrap;
  min-width: 0;
  padding-top: 6px;
}

.f-options-grid {
  display: grid;
  gap: 6px 14px;
  flex: 1;
  min-width: 0;
  padding-top: 4px;
}

.f-options-grid.col-3 {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

.f-options-grid.col-4 {
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}

.opt {
  display: inline-flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 0.82rem;
  color: #2d3748;
  cursor: pointer;
  white-space: normal;
  line-height: 1.35;
}

.opt input {
  accent-color: #2c6e49;
  cursor: pointer;
  margin-top: 2px;
  flex-shrink: 0;
}

.f-triple-input {
  display: flex;
  gap: 14px;
  flex: 1;
  min-width: 0;
  flex-wrap: wrap;
}

.f-sub-inp {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
}

.f-sub-inp input {
  width: 70px !important;
  text-align: center;
}

.f-split-status {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
  flex-wrap: wrap;
}

.f-split-status input {
  flex: 1;
  min-width: 140px;
}

.f-label-inline {
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
}

.inp-short-val {
  max-width: 140px !important;
}

/* ── Photo Box (3x4) ── */
.ma-row-with-photo {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.ma-fields-col {
  flex: 1;
}

.ma-photo-box {
  width: 105px;
  height: 140px;
  border: 2px dashed #a0aec0;
  border-radius: 8px;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  background: #f7fafc;
}

.photo-box-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #718096;
  font-size: 0.75rem;
  cursor: pointer;
  padding: 6px;
}

.photo-box-inner i {
  font-size: 1.4rem;
  color: #2c6e49;
  margin-bottom: 4px;
}

.photo-preview-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

/* ── Sub Sections A, B, C ── */
.ma-sub-section {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 12px;
}

.ma-sub-section h4 {
  font-size: 0.88rem;
  font-weight: 800;
  color: #1b4d3e;
  margin-bottom: 10px;
  border-bottom: 1px solid #cbd5e0;
  padding-bottom: 4px;
}

/* ── Persyaratan ── */
.ma-syarat-box {
  background: #fffdf5;
  border: 1.5px solid #f6e05e;
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 24px;
}

.ma-syarat-box h4 {
  font-size: 0.88rem;
  font-weight: 800;
  color: #744210;
  margin-bottom: 8px;
}

.ma-syarat-box ol {
  padding-left: 18px;
  margin: 0;

}

.ma-syarat-box li {
  font-size: 0.8rem;
  color: #4a5568;
  margin-bottom: 4px;
  line-height: 1.4;
}

/* ── TTD Grid ── */
.ma-ttd-grid {
  display: flex;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 20px;
}

.ma-ttd-col {
  flex: 1;
  text-align: center;
}

.ma-ttd-place {
  font-size: 0.85rem;
  color: #2d3748;
  margin-bottom: 4px;
}

.ma-ttd-title {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 8px;
  line-height: 1.3;
}

.ma-ttd-box {
  position: relative;
  width: 180px;
  height: 70px;
  margin: 0 auto 6px;
  border: 1px dashed #cbd5e0;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ma-ttd-upload-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  color: #2c6e49;
  cursor: pointer;
}

.ma-ttd-img-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: none;
}

.ma-ttd-line {
  font-size: 0.82rem;
}

.ma-ttd-penerima {
  text-align: center;
  margin-top: 20px;
}

.ma-ttd-penerima p {
  font-size: 0.85rem;
  margin-bottom: 4px;
}

.ma-ttd-space-penerima {
  height: 50px;
}

/* ── Actions ── */
.ma-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  margin-top: 30px;
}

.btn-ma-submit {
  padding: 12px 36px;
  background: #2c6e49;
  color: #fff;
  font-weight: 700;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
}

.btn-ma-reset {
  padding: 12px 24px;
  background: #fff;
  color: #4a5568;
  border: 1.5px solid #cbd5e0;
  font-weight: 600;
  border-radius: 50px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-ma-print {
  padding: 12px 24px;
  background: #fff;
  color: #d69e2e;
  border: 1.5px solid #d69e2e;
  font-weight: 600;
  border-radius: 50px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.ma-alert {
  display: flex;
  gap: 14px;
  padding: 16px 20px;
  border-radius: 10px;
  margin-bottom: 24px;
}

.ma-alert-success {
  background: #f0fff4;
  border: 1px solid #9ae6b4;
  color: #22543d;
}

.ma-alert-error {
  background: #fff5f5;
  border: 1px solid #feb2b2;
  color: #742a2a;
}

.d-none { display: none !important; }

/* ═════════════════════════════════════════════════════
   PRINT MEDIA QUERY FOR MA FORM
   ═════════════════════════════════════════════════════ */
@media print {
  @page {
    size: A4 portrait;
    margin: 8mm 12mm;
  }

  body, html {
    background: #fff !important;
    color: #000 !important;
    font-family: Arial, sans-serif !important;
    font-size: 8.5pt !important;
    line-height: 1.3 !important;
    margin: 0 !important;
    padding: 0 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .ma-hero,
  .site-header,
  .footer,
  .topbar,
  .navbar,
  .back-to-top,
  .ma-actions,
  .ma-alert,
  .ma-ttd-upload-area {
    display: none !important;
  }

  .ma-form-section {
    padding: 0 !important;
  }

  .ma-paper-wrapper {
    box-shadow: none !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    max-width: 100% !important;
  }

  .ma-kop {
    padding-bottom: 4px !important;
  }

  .ma-kop-logo img {
    width: 65px !important;
    height: 65px !important;
  }

  .ma-kop-text h2 {
    font-size: 15pt !important;
    color: #000 !important;
    margin-bottom: 2px !important;
  }

  .ma-kop-text p {
    font-size: 7.5pt !important;
    color: #000 !important;
  }

  .ma-kop-line .thick { background: #000 !important; height: 2.5px !important; }
  .ma-kop-line .thin { background: #000 !important; height: 1px !important; }

  .ma-title-header {
    margin-bottom: 12px !important;
  }

  .ma-title-text h2 { font-size: 11pt !important; color: #000 !important; }
  .ma-title-text h3 { font-size: 9.5pt !important; color: #000 !important; }
  .ma-title-text h4 { font-size: 8.5pt !important; color: #000 !important; }
  .ma-instruction { font-size: 7.5pt !important; color: #000 !important; }

  .ma-no-form-box {
    border: 1.5px solid #000 !important;
    padding: 4px 8px !important;
  }

  .ma-no-form-box .box-label {
    border-bottom-color: #000 !important;
    font-size: 7pt !important;
  }

  .ma-no-form-box .box-value {
    color: #000 !important;
    font-size: 8.5pt !important;
  }

  .ma-fieldset {
    margin-bottom: 10px !important;
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }

  .ma-fieldset legend {
    font-size: 9pt !important;
    color: #000 !important;
    border-bottom: 1.5px solid #000 !important;
    margin-bottom: 6px !important;
  }

  .ma-field {
    margin-bottom: 3px !important;
  }

  .ma-field label {
    width: 160px !important;
    min-width: 160px !important;
    font-size: 8.5pt !important;
    color: #000 !important;
  }

  .f-colon {
    color: #000 !important;
  }

  .ma-field input[type="text"],
  .ma-field input[type="tel"],
  .ma-field input[type="email"],
  .ma-field input[type="date"] {
    border: none !important;
    border-bottom: 1px dotted #000 !important;
    border-radius: 0 !important;
    background: transparent !important;
    padding: 0 2px !important;
    font-size: 8.5pt !important;
    color: #000 !important;
    height: 16px !important;
  }

  .opt {
    font-size: 8pt !important;
    color: #000 !important;
  }

  .opt input {
    accent-color: #000 !important;
  }

  .ma-photo-box {
    width: 85px !important;
    height: 115px !important;
    border: 1.5px solid #000 !important;
    background: #fff !important;
    border-radius: 0 !important;
  }

  .photo-box-inner i, .photo-box-inner span {
    display: none !important;
  }

  .photo-box-inner strong {
    font-size: 11pt !important;
    color: #000 !important;
  }

  .ma-sub-section {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin-bottom: 6px !important;
  }

  .ma-sub-section h4 {
    font-size: 8.5pt !important;
    color: #000 !important;
    border-bottom: 1px solid #000 !important;
    margin-bottom: 4px !important;
  }

  .ma-syarat-box {
    background: transparent !important;
    border: 1px solid #000 !important;
    padding: 8px 12px !important;
    margin-bottom: 12px !important;
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }

  .ma-syarat-box h4 {
    color: #000 !important;
    font-size: 8.5pt !important;
    margin-bottom: 4px !important;
  }

  .ma-syarat-box li {
    font-size: 7.5pt !important;
    color: #000 !important;
    margin-bottom: 2px !important;
  }

  .ma-ttd-grid {
    margin-bottom: 10px !important;
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }

  .ma-ttd-place, .ma-ttd-title, .ma-ttd-line {
    font-size: 8.5pt !important;
    color: #000 !important;
  }

  .ma-ttd-box {
    border: none !important;
    height: 50px !important;
  }

  .ma-ttd-penerima {
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }

  .ma-ttd-penerima p {
    font-size: 8.5pt !important;
  }
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .ma-paper-wrapper {
    padding: 20px 16px;
  }

  .ma-kop {
    flex-direction: column;
    text-align: center;
  }

  .ma-title-header {
    flex-direction: column;
    align-items: center;
  }

  .ma-row-with-photo {
    flex-direction: column-reverse;
    align-items: center;
  }

  .ma-field {
    flex-direction: column;
    align-items: stretch;
  }

  .ma-field label {
    width: 100%;
  }

  .f-colon {
    display: none;
  }

  .f-options-grid.col-3,
  .f-options-grid.col-4 {
    grid-template-columns: 1fr;
  }

  .ma-ttd-grid {
    flex-direction: column;
    gap: 20px;
  }
}
