:root {
  --grad-start: #4FB3E0;
  --grad-end: #7CB93E;
  --bg-light: #f2f9fd;
  --text-dark: #1c2b36;
  --border-soft: #dceaf3;
  --shadow-soft: 0 10px 30px rgba(79, 179, 224, 0.12);
}

body {
  background: linear-gradient(180deg, var(--bg-light) 0%, #eaf6fd 100%);
  color: var(--text-dark);
  font-family: 'Segoe UI', 'Poppins', Roboto, Arial, sans-serif;
  min-height: 100vh;
}

/* ---------- Header ---------- */
.app-header {
  background: linear-gradient(135deg, var(--grad-start), var(--grad-end));
  color: #fff;
  padding: 40px 16px;
  box-shadow: var(--shadow-soft);
  position: relative;
}

.app-header .home-btn {
  position: absolute;
  top: 16px;
  left: 16px;
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 8px 16px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  transition: 0.2s;
}

.app-header .home-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  color: #fff;
}

.app-header .logo-plate {
  display: inline-block;
  background: #fff;
  border-radius: 14px;
  padding: 8px 22px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
  margin-bottom: 0.5rem;
}

.app-header .logo-plate img {
  height: 56px;
  width: auto;
  display: block;
}

.app-header .logo-badge {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  padding: 6px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
  margin-bottom: 0.15rem !important;
}

.app-header h1 {
  font-weight: 700;
  font-size: 1.55rem;
  margin-top: -6px;
  margin-bottom: 2px;
  letter-spacing: 0.3px;
}

.app-header p {
  margin: 0;
  opacity: 0.92;
  font-size: 0.95rem;
}

/* ---------- Layout ---------- */
.form-shell {
  max-width: 1280px;
  margin: 24px auto 60px;
  padding: 0 16px;
}

.section-card {
  background: #ffffff;
  border-radius: 18px;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--border-soft);
  margin-bottom: 26px;
  overflow: hidden;
}

.section-card .section-title {
  background: linear-gradient(135deg, rgba(79, 179, 224, 0.08), rgba(124, 185, 62, 0.06));
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-title .step-badge {
  width: 34px;
  height: 34px;
  min-width: 34px;
  border-radius: 50%;
  background: #7CB93E;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
}

.section-title h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
  color: var(--text-dark);
}

.section-body {
  padding: 24px;
}

/* ---------- Form controls ---------- */
label.form-label {
  font-weight: 600;
  font-size: 0.87rem;
  color: #33495a;
}

.form-control, .form-select {
  border-radius: 10px;
  border: 1px solid #cfe3ee;
  padding: 10px 12px;
  font-size: 0.93rem;
}

.form-control:focus, .form-select:focus {
  border-color: var(--grad-end);
  box-shadow: 0 0 0 0.2rem rgba(124, 185, 62, 0.18);
}

/* ---------- Date inputs (Flatpickr) ---------- */
.date-picker {
  background-color: #fff;
  cursor: pointer;
}

.flatpickr-calendar {
  border-radius: 14px;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--border-soft);
  z-index: 9999;
}

.flatpickr-months {
  background: linear-gradient(135deg, var(--grad-start), var(--grad-end));
  border-radius: 14px 14px 0 0;
}

.flatpickr-months .flatpickr-month {
  color: #fff;
  fill: #fff;
}

.flatpickr-months .flatpickr-prev-month,
.flatpickr-months .flatpickr-next-month {
  fill: #fff;
  color: #fff;
}

.flatpickr-months .flatpickr-prev-month:hover svg,
.flatpickr-months .flatpickr-next-month:hover svg {
  fill: #f0f0f0;
}

.flatpickr-current-month input.cur-year,
.flatpickr-current-month span.cur-month,
.flatpickr-current-month .flatpickr-monthDropdown-months {
  color: #fff;
  font-weight: 600;
}

.flatpickr-current-month .flatpickr-monthDropdown-months option {
  color: var(--text-dark);
  background: #fff;
}

.numInputWrapper {
  width: 7ch;
}

.numInputWrapper span.arrowUp:after {
  border-bottom-color: #fff;
}

.numInputWrapper span.arrowDown:after {
  border-top-color: #fff;
}

.flatpickr-weekdays {
  background: #f2fbff;
}

span.flatpickr-weekday {
  background: #f2fbff;
  color: var(--grad-start);
  font-weight: 700;
}

.flatpickr-day.selected,
.flatpickr-day.selected:hover {
  background: #7CB93E;
  border-color: #7CB93E;
}

.flatpickr-day.today {
  border-color: var(--grad-end);
}

.flatpickr-day:hover {
  background: rgba(79, 179, 224, 0.15);
}

.required-mark {
  color: #e6544c;
  margin-left: 2px;
}

/* ---------- File upload ---------- */
.upload-box {
  border: 2px dashed #b9dcee;
  border-radius: 14px;
  padding: 16px;
  text-align: center;
  background: #f8fcff;
  transition: 0.2s;
  position: relative;
}

.upload-box:hover {
  border-color: var(--grad-end);
  background: #f0faff;
}

.upload-box .preview-img {
  max-width: 100%;
  max-height: 110px;
  border-radius: 10px;
  margin-top: 8px;
  display: none;
  box-shadow: 0 3px 10px rgba(0,0,0,0.12);
}

.upload-box small {
  color: #6c8494;
}

.file-name-tag {
  display: none;
  margin-top: 6px;
  font-size: 0.8rem;
  color: #17754e;
  font-weight: 600;
}

/* ---------- Dynamic qualification rows ---------- */
.qualification-row {
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 14px;
  background: #fbfeff;
  position: relative;
}

.remove-row-btn {
  border: none;
  background: #fdeceb;
  color: #d9463b;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-weight: 700;
  line-height: 1;
}

.remove-row-btn:hover {
  background: #f8d3d0;
}

#addQualificationBtn {
  border: 1.5px dashed var(--grad-end);
  color: var(--grad-start);
  background: #f2fbff;
  border-radius: 10px;
  font-weight: 600;
}

#addQualificationBtn:hover {
  background: #e3f5fe;
}

.percentage-badge {
  font-weight: 700;
  color: #0a7c47;
}

.subject-table {
  font-size: 0.88rem;
}

.subject-table th {
  background: #f2fbff;
  font-weight: 700;
  color: #33495a;
}

.subject-table tfoot td {
  background: #f8fcff;
  color: #0a7c47;
}

.add-subject-btn {
  border: 1.5px dashed var(--grad-end);
  color: var(--grad-start);
  background: #f2fbff;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.85rem;
}

.add-subject-btn:hover {
  background: #e3f5fe;
}

.remove-subject-btn {
  border: none;
  background: #fdeceb;
  font-weight: 700;
  line-height: 1;
}

.remove-subject-btn:hover {
  background: #f8d3d0;
}

/* ---------- Buttons ---------- */
.btn-gradient {
  background: linear-gradient(135deg, var(--grad-start), var(--grad-end));
  border: none;
  color: #fff;
  font-weight: 600;
  border-radius: 12px;
  padding: 12px 34px;
  box-shadow: 0 8px 20px rgba(124, 185, 62, 0.28);
}

.btn-gradient:hover {
  filter: brightness(1.06);
  color: #fff;
}

.btn-outline-soft {
  border: 1.5px solid var(--grad-end);
  color: var(--grad-start);
  border-radius: 12px;
  font-weight: 600;
  background: #fff;
}

/* ---------- Declaration ---------- */
.declaration-box {
  background: #f5fbff;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 16px;
  font-size: 0.88rem;
  color: #45606f;
  max-height: 160px;
  overflow-y: auto;
}

/* ---------- Footer ---------- */
.app-footer {
  text-align: center;
  color: #6c8494;
  font-size: 0.85rem;
  padding: 20px;
}

/* ---------- Success page ---------- */
.success-card {
  max-width: 720px;
  margin: 60px auto;
  background: #fff;
  border-radius: 20px;
  box-shadow: var(--shadow-soft);
  padding: 40px;
  text-align: center;
}

.success-icon {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--grad-start), var(--grad-end));
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
  color: #fff;
  font-size: 2.2rem;
}

.app-no-box {
  display: inline-block;
  background: #f2fbff;
  border: 1.5px dashed var(--grad-end);
  border-radius: 12px;
  padding: 12px 26px;
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--grad-start);
  margin: 16px 0;
}

.detail-table td {
  padding: 8px 10px;
  font-size: 0.9rem;
  border-color: var(--border-soft) !important;
}

.detail-table td.label {
  color: #6c8494;
  font-weight: 600;
  width: 42%;
}

/* ---------- Responsive ---------- */
@media (max-width: 576px) {
  .section-body { padding: 18px; }
  .app-header h1 { font-size: 1.25rem; }
  .btn-gradient { width: 100%; }
  .btn-outline-soft { width: 100%; }
}

/* ---------- Print ---------- */
@page {
  size: A4;
  margin: 14mm;
}

@media print {
  .no-print { display: none !important; }
  body { background: #fff !important; }
  .app-header { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .section-card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
  .form-shell { margin: 0; max-width: 100%; }

  table { break-inside: avoid; page-break-inside: avoid; }
  tr { break-inside: avoid; page-break-inside: avoid; }
  .detail-section { break-inside: avoid; page-break-inside: avoid; }

  .success-card {
    max-width: 100%;
    margin: 0;
    padding: 0;
    box-shadow: none;
    border-radius: 0;
  }
}

/* Honeypot anti-spam field: kept in normal flow (not display:none) so basic bots still fill it */
.hp-field {
  position: absolute;
  left: -9999px;
  top: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
