:root {
      --navy: #1e3a8a;
      --navy-light: #2d4fa1;
      --gold: #e8a020;
      --gold-light: #f0b030;
      --gray-50: #f9fafb;
      --gray-100: #f3f4f6;
      --gray-200: #e5e7eb;
      --gray-300: #d1d5db;
      --gray-400: #9ca3af;
      --gray-500: #6b7280;
      --gray-700: #374151;
      --gray-900: #111827;
      --white: #ffffff;
      --radius-sm: 6px;
      --radius-md: 10px;
      --radius-lg: 14px;
      --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
      --shadow-md: 0 4px 12px rgba(0,0,0,0.08);

      /* Glassmorphism */
      --glass-bg: rgba(255, 255, 255, 0.7);
      --glass-border: rgba(255, 255, 255, 0.3);
      --glass-blur: 12px;

      /* Smooth transitions */
      --t-fast: 0.2s;
      --t-base: 0.25s;
      --t-slow: 0.35s;
      --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
      --ease-in-out: ease-in-out;

      /* Lift shadows */
      --lift-sm: 0 4px 16px rgba(0,0,0,0.10);
      --lift-md: 0 8px 28px rgba(0,0,0,0.14);
      --lift-lg: 0 16px 48px rgba(0,0,0,0.18);
    }

    body {
      font-family: 'Poppins', sans-serif;
      background: #f0f4f8;
      color: var(--gray-900);
      min-height: 100vh;
    }

    /* PAGE WRAPPER */
    .page-wrap {
      max-width: 860px;
      margin: 0 auto;
      padding: 48px 24px 64px;
    }

    /* PAGE HEADER */
    .page-header {
      margin-bottom: 36px;
    }
    .header-badge {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      background: rgba(30, 58, 138, 0.1);
      color: var(--navy);
      padding: 5px 12px;
      border-radius: 20px;
      font-size: 11px;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.06em;
      margin-bottom: 14px;
    }
    .page-header h1 {
      font-size: 2rem;
      font-weight: 700;
      color: var(--navy);
      letter-spacing: -0.03em;
      line-height: 1.2;
      margin-bottom: 10px;
    }
    .page-header p {
      font-size: 14px;
      color: var(--gray-500);
      line-height: 1.65;
    }
    .page-header-brand {
      display: flex;
      align-items: flex-start;
      gap: 18px;
      margin-bottom: 4px;
    }
    .page-header-brand-text {
      flex: 1;
      min-width: 0;
    }
    .page-header-logo {
      width: 56px;
      height: 56px;
      object-fit: contain;
      flex-shrink: 0;
    }

    /* CARD */
    .card {
      background: var(--glass-bg);
      backdrop-filter: blur(var(--glass-blur));
      -webkit-backdrop-filter: blur(var(--glass-blur));
      border-radius: var(--radius-lg);
      box-shadow: var(--shadow-sm);
      border: 1px solid var(--glass-border);
      margin-bottom: 20px;
      overflow: hidden;
      transition: transform var(--t-slow) var(--ease-out-expo), box-shadow var(--t-slow) var(--ease-out-expo);
    }
    .card:hover {
      transform: translateY(-2px);
      box-shadow: var(--lift-md);
    }

    /* SECTION HEADER */
    .section-header {
      padding: 20px 28px;
      border-bottom: 1px solid var(--gray-100);
      display: flex;
      align-items: flex-start;
      gap: 14px;
    }
    .section-icon {
      width: 36px;
      height: 36px;
      background: rgba(30, 58, 138, 0.08);
      border-radius: var(--radius-sm);
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
      color: var(--navy);
      font-size: 15px;
    }
    .section-title h3 {
      font-size: 15px;
      font-weight: 600;
      color: var(--navy);
      line-height: 1.3;
    }
    .section-title p {
      font-size: 12px;
      color: var(--gray-500);
      margin-top: 2px;
      line-height: 1.5;
    }

    /* SECTION BODY */
    .section-body { padding: 28px; }

    /* FORM GRID */
    .form-grid {
      display: grid;
      gap: 16px;
    }
    .g-1 { grid-template-columns: 1fr; }
    .g-2 { grid-template-columns: repeat(2, 1fr); }
    .g-3 { grid-template-columns: repeat(3, 1fr); }
    .g-4 { grid-template-columns: repeat(4, 1fr); }
    .span2 { grid-column: span 2; }
    .span3 { grid-column: span 3; }
    .span4 { grid-column: span 4; }

    /* FIELD */
    .field {
      display: flex;
      flex-direction: column;
      gap: 6px;
    }
    .field label {
      font-size: 12px;
      font-weight: 600;
      color: var(--gray-700);
      letter-spacing: 0.01em;
    }
    .field input,
    .field select,
    .field textarea {
      padding: 10px 14px;
      border: 1.5px solid var(--gray-400);
      border-radius: var(--radius-sm);
      font-size: 14px;
      font-family: 'Poppins', sans-serif;
      color: var(--gray-900);
      background: var(--white);
      transition: border-color 0.15s, box-shadow 0.15s;
      width: 100%;
    }
    .field input::placeholder,
    .field select::placeholder,
    .field textarea::placeholder { color: var(--gray-400); font-size: 13px; }
    .field input:focus,
    .field select:focus,
    .field textarea:focus {
      outline: none;
      border-color: var(--navy);
      box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
    }
    .field select {
      appearance: none;
      background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5l5 5 5-5' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
      background-repeat: no-repeat;
      background-position: right 14px center;
      padding-right: 38px;
      cursor: pointer;
    }
    .field textarea { resize: vertical; min-height: 80px; }
    .field-hint { font-size: 11px; color: var(--gray-400); }
    .field input[type="file"] {
      padding: 8px 12px;
      font-size: 13px;
      cursor: pointer;
      background: var(--gray-50);
    }
    .field input[type="file"]::-webkit-file-upload-button {
      background: var(--navy);
      color: white;
      border: none;
      padding: 5px 12px;
      border-radius: 4px;
      font-size: 12px;
      font-family: 'Poppins', sans-serif;
      font-weight: 500;
      cursor: pointer;
      margin-right: 10px;
    }

    /* DIVIDER */
    .divider {
      border: none;
      border-top: 1px solid var(--gray-100);
      margin: 22px 0;
    }

    /* SUB LABEL */
    .sub-label {
      font-size: 12px;
      font-weight: 600;
      color: var(--navy);
      text-transform: uppercase;
      letter-spacing: 0.06em;
      margin-bottom: 14px;
      display: flex;
      align-items: center;
      gap: 8px;
    }
    .sub-label::after {
      content: '';
      flex: 1;
      height: 1px;
      background: var(--gray-100);
    }

    /* INLINE GROUP */
    .inline-group {
      display: flex;
      align-items: center;
      gap: 16px;
      flex-wrap: wrap;
      padding-top: 4px;
    }
    .inline-item {
      display: flex;
      align-items: center;
      gap: 7px;
      cursor: pointer;
      user-select: none;
    }
    .inline-item input[type="radio"],
    .inline-item input[type="checkbox"] {
      width: 17px;
      height: 17px;
      accent-color: var(--navy);
      cursor: pointer;
      flex-shrink: 0;
    }
    .inline-item span { font-size: 13px; color: var(--gray-700); font-weight: 500; }

    /* PHOTO BOX */
    .photo-upload-wrap {
      display: flex;
      gap: 20px;
      align-items: flex-start;
    }
    .photo-col { flex-shrink: 0; }
    .photo-box {
      border: 2px dashed var(--gray-300);
      border-radius: var(--radius-md);
      width: 96px;
      height: 116px;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 6px;
      cursor: pointer;
      transition: all 0.2s;
      overflow: hidden;
      background: var(--gray-50);
    }
    .photo-box:hover { border-color: var(--navy); background: rgba(30,58,138,0.03); }
    .photo-box i { font-size: 22px; color: var(--gray-300); }
    .photo-box span { font-size: 10px; color: var(--gray-500); font-weight: 500; text-align: center; text-transform: uppercase; letter-spacing: 0.05em; }
    .photo-box img { width: 100%; height: 100%; object-fit: cover; }
    .form-col { flex: 1; min-width: 0; }

    /* STRAND CHOICE ROWS */
    .choice-row {
      margin-bottom: 18px;
    }
    .choice-row:last-child { margin-bottom: 0; }
    .choice-label {
      display: flex;
      align-items: center;
      gap: 10px;
      margin-bottom: 10px;
    }
    .choice-badge {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 26px;
      height: 26px;
      border-radius: 50%;
      font-size: 12px;
      font-weight: 700;
      flex-shrink: 0;
    }
    .badge-1 { background: var(--navy); color: white; }
    .badge-2 { background: rgba(30,58,138,0.15); color: var(--navy); }
    .badge-3 { background: var(--gray-200); color: var(--gray-700); }
    .choice-label-text {
      font-size: 12px;
      font-weight: 600;
      color: var(--gray-700);
      text-transform: uppercase;
      letter-spacing: 0.05em;
    }
    .choice-label-text em {
      font-style: normal;
      font-weight: 400;
      color: var(--gray-400);
      text-transform: none;
      letter-spacing: 0;
      font-size: 11px;
    }

    /* STRAND GRID */
    .strand-grid {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 8px;
    }
    .strand-card {
      border: 1.5px solid var(--gray-200);
      border-radius: var(--radius-md);
      padding: 12px 10px;
      cursor: pointer;
      transition: all var(--t-base) var(--ease-out-expo);
      position: relative;
      background: var(--white);
    }
    .strand-card:hover {
      border-color: var(--navy-light);
      background: rgba(30,58,138,0.02);
      transform: translateY(-2px) scale(1.02);
      box-shadow: var(--lift-sm);
    }
    .strand-card.sel-1 {
      border-color: var(--navy);
      background: rgba(30,58,138,0.06);
      box-shadow: 0 0 0 3px rgba(30,58,138,0.12);
    }
    .strand-card.sel-2 {
      border-color: rgba(30,58,138,0.4);
      background: rgba(30,58,138,0.03);
      box-shadow: 0 0 0 2px rgba(30,58,138,0.08);
    }
    .strand-card.sel-3 {
      border-color: var(--gray-400);
      background: var(--gray-50);
      box-shadow: 0 0 0 2px rgba(0,0,0,0.05);
    }
    .strand-card.disabled {
      opacity: 0.4;
      cursor: not-allowed;
      pointer-events: none;
    }
    .strand-card input[type="radio"] {
      position: absolute;
      opacity: 0;
      pointer-events: none;
    }
    .strand-indicator {
      width: 20px;
      height: 20px;
      border-radius: 50%;
      border: 2px solid var(--gray-300);
      margin-bottom: 8px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 10px;
      font-weight: 700;
      transition: all 0.15s;
      color: transparent;
    }
    .strand-card.sel-1 .strand-indicator { background: var(--navy); border-color: var(--navy); color: white; }
    .strand-card.sel-2 .strand-indicator { background: rgba(30,58,138,0.5); border-color: rgba(30,58,138,0.5); color: white; }
    .strand-card.sel-3 .strand-indicator { background: var(--gray-400); border-color: var(--gray-400); color: white; }
    .strand-name { font-size: 13px; font-weight: 700; color: var(--navy); margin-bottom: 3px; }
    .strand-sub { font-size: 10px; color: var(--gray-500); line-height: 1.4; }

    .shs-curriculum-badge-wrap {
      text-align: center;
      margin-bottom: 14px;
    }
    .shs-curriculum-badge {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      background: linear-gradient(135deg, var(--gold), #d4901a);
      color: var(--navy);
      padding: 8px 16px;
      border-radius: 50px;
      font-size: 0.72rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      box-shadow: 0 4px 12px rgba(232,160,32,0.28);
    }
    .shs-curriculum-badge i { font-size: 0.68rem; }
    .strand-grid--academic { grid-template-columns: repeat(3, 1fr); }
    .strand-grid--tech { grid-template-columns: repeat(2, 1fr); max-width: 560px; }

    /* MINI TABLE */
    .mini-table { width: 100%; border-collapse: collapse; }
    .mini-table th {
      background: var(--gray-50);
      font-size: 11px;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      color: var(--gray-500);
      padding: 10px 14px;
      border-bottom: 1px solid var(--gray-200);
      text-align: left;
    }
    .mini-table td {
      padding: 4px 8px;
      border-bottom: 1px solid var(--gray-100);
    }
    .mini-table tr:last-child td { border-bottom: none; }
    .mini-table td input {
      border: none;
      outline: none;
      width: 100%;
      font-family: 'Poppins', sans-serif;
      font-size: 13px;
      color: var(--gray-900);
      background: transparent;
      padding: 8px 6px;
      border-radius: 4px;
      transition: background 0.15s;
    }
    .mini-table td input:focus {
      background: rgba(30,58,138,0.05);
      outline: 1.5px solid var(--navy);
    }

    /* CERTIFICATION */
    .cert-text {
      font-size: 14px;
      color: var(--gray-700);
      line-height: 1.75;
      margin-bottom: 18px;
      padding: 16px;
      background: var(--gray-50);
      border-radius: var(--radius-sm);
      border-left: 3px solid var(--navy);
    }
    .agree-label {
      display: flex;
      align-items: flex-start;
      gap: 10px;
      cursor: pointer;
    }
    .agree-label input[type="checkbox"] {
      margin-top: 2px;
      width: 18px;
      height: 18px;
      accent-color: var(--navy);
      flex-shrink: 0;
    }
    .agree-label span { font-size: 13px; color: var(--navy); font-weight: 500; line-height: 1.6; }

    /* SIGNATURE BOX */
    .sig-box {
      border: 1.5px solid var(--gray-200);
      border-radius: var(--radius-sm);
      height: 64px;
      display: flex;
      align-items: center;
      justify-content: center;
      background: var(--gray-50);
    }
    .sig-box span { font-size: 12px; color: var(--gray-400); }

    /* BUTTONS */
    .btn {
      padding: 10px 20px;
      border-radius: var(--radius-sm);
      font-weight: 600;
      font-size: 13px;
      cursor: pointer;
      transition: all var(--t-base) var(--ease-out-expo);
      display: inline-flex;
      align-items: center;
      gap: 7px;
      border: none;
      font-family: 'Poppins', sans-serif;
      text-decoration: none;
    }
    .btn-primary {
      background: var(--gold);
      color: var(--navy);
    }
    .btn-primary:hover {
      background: var(--gold-light);
      transform: translateY(-2px) scale(1.03);
      box-shadow: 0 4px 12px rgba(232,160,32,0.38);
    }
    .btn-primary i {
      transition: transform var(--t-base) var(--ease-out-expo);
    }
    .btn-primary:hover i {
      transform: translateX(3px);
    }
    .btn-secondary {
      background: var(--white);
      color: var(--navy);
      border: 1.5px solid var(--gray-200);
    }
    .btn-secondary:hover {
      border-color: var(--navy);
      background: var(--gray-50);
      transform: translateY(-2px);
    }
    .btn-ghost {
      background: transparent;
      color: var(--gray-500);
    }
    .btn-ghost:hover {
      color: var(--navy);
      background: var(--gray-100);
      transform: translateY(-2px);
    }

    /* ACTIONS */
    .form-actions {
      display: flex;
      justify-content: flex-end;
      align-items: center;
      gap: 10px;
      padding: 20px 28px;
      background: var(--white);
      border-radius: var(--radius-lg);
      border: 1px solid var(--gray-200);
      box-shadow: var(--shadow-sm);
    }
    .form-actions .left-actions { margin-right: auto; display: flex; gap: 8px; }

    /* SUCCESS MODAL */
    .modal-overlay {
      display: none;
      position: fixed;
      inset: 0;
      background: rgba(15,30,61,0.45);
      backdrop-filter: blur(5px);
      align-items: center;
      justify-content: center;
      z-index: 100;
    }
    .modal-overlay.show { display: flex; }
    .modal-box {
      background: var(--white);
      border-radius: var(--radius-lg);
      padding: 40px 36px;
      text-align: center;
      max-width: 400px;
      width: 90%;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 16px;
      box-shadow: 0 24px 48px rgba(0,0,0,0.18);
      animation: popIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    }
    @keyframes popIn { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
    .modal-icon {
      width: 64px;
      height: 64px;
      border-radius: 50%;
      background: rgba(232,160,32,0.12);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 26px;
      color: var(--gold);
    }
    .modal-box h3 { font-size: 1.2rem; font-weight: 700; color: var(--navy); }
    .modal-box p { font-size: 13px; color: var(--gray-500); line-height: 1.7; }
    .modal-ref {
      font-size: 13px;
      font-weight: 600;
      color: var(--navy);
      background: var(--gray-50);
      border: 1px solid var(--gray-200);
      border-radius: var(--radius-sm);
      padding: 10px 20px;
      letter-spacing: 0.05em;
    }

    /* ERROR STATE */
    .field.error input,
    .field.error select,
    .field.error textarea {
      border-color: #e24b4a;
      box-shadow: 0 0 0 3px rgba(226,75,74,0.1);
    }
    .field-error { font-size: 11px; color: #e24b4a; display: none; }
    .field.error .field-error { display: block; }

    /* RESPONSIVE */
    @media (max-width: 700px) {
      .page-wrap { padding: 32px 16px 48px; }
      .page-header h1 { font-size: 1.5rem; }
      .g-2, .g-3, .g-4 { grid-template-columns: 1fr; }
      .span2, .span3, .span4 { grid-column: span 1; }
      .strand-grid { grid-template-columns: repeat(2, 1fr); }
      .section-body { padding: 20px 18px; }
      .section-header { padding: 16px 18px; }
      .photo-upload-wrap { flex-direction: column; }
      .form-actions { flex-wrap: wrap; }
      .form-actions .left-actions { width: 100%; }
    }

    /* PHASE BANNER */
    .phase-banner {
      display: flex;
      align-items: center;
      gap: 0;
      background: var(--white);
      border: 1px solid var(--gray-200);
      border-radius: var(--radius-lg);
      padding: 20px 28px;
      margin-bottom: 16px;
      box-shadow: var(--shadow-sm);
    }
    .phase-step {
      display: flex;
      align-items: center;
      gap: 14px;
      flex: 1;
      opacity: 0.4;
    }
    .phase-step.active { opacity: 1; }
    .phase-num {
      width: 36px;
      height: 36px;
      border-radius: 50%;
      background: var(--gray-200);
      color: var(--gray-500);
      font-size: 15px;
      font-weight: 700;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
    }
    .phase-step.active .phase-num {
      background: var(--navy);
      color: white;
    }
    .phase-info strong {
      display: block;
      font-size: 13px;
      font-weight: 600;
      color: var(--navy);
      line-height: 1.3;
    }
    .phase-info span {
      font-size: 11px;
      color: var(--gray-500);
    }
    .phase-arrow {
      color: var(--gray-300);
      font-size: 13px;
      padding: 0 20px;
      flex-shrink: 0;
    }

    /* NOTICE BOX */
    .notice-box {
      display: flex;
      gap: 16px;
      background: rgba(30,58,138,0.04);
      border: 1px solid rgba(30,58,138,0.15);
      border-radius: var(--radius-lg);
      padding: 20px 24px;
      margin-bottom: 24px;
    }
    .notice-icon {
      font-size: 18px;
      color: var(--navy);
      flex-shrink: 0;
      margin-top: 1px;
    }
    .notice-body strong {
      display: block;
      font-size: 13px;
      font-weight: 600;
      color: var(--navy);
      margin-bottom: 10px;
    }
    .notice-list {
      list-style: none;
      display: flex;
      flex-direction: column;
      gap: 6px;
    }
    .notice-list li {
      font-size: 12px;
      color: var(--gray-700);
      display: flex;
      align-items: flex-start;
      gap: 8px;
      line-height: 1.5;
    }
    .notice-list li::before {
      content: '';
      width: 5px;
      height: 5px;
      border-radius: 50%;
      background: var(--navy);
      flex-shrink: 0;
      margin-top: 5px;
    }

    @media print {
      #header-container { display: none !important; }
      .form-actions, .phase-banner, .notice-box { display: none !important; }
      .page-wrap { padding: 0; }
      .card { box-shadow: none; border: 1px solid #ddd; }
    }

    /* ============================================================
       PDF TEMPLATE STYLES
       Pixel-accurate print-ready design for SHS Application Form
       ============================================================ */
#pdfTemplate, #pdfTemplate * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

#pdfTemplate {
            font-family: 'Times New Roman', Times, serif;
            font-size: 9.2pt;
            color: #000;
            background: #fff;
            line-height: 1.25;
        }

#pdfTemplate .page {
            width: 210mm;
            min-height: 297mm;
            margin: 0 auto 0 0;
            padding: 13mm;
            background: #fff;
            overflow: hidden;
            display: flex;
            flex-direction: column;
            transform-origin: top left;
        }

/* Generic building blocks */
#pdfTemplate .line-input {
            border: none;
            border-bottom: 0.75px solid #000;
            background: transparent;
            font-family: inherit;
            font-size: inherit;
            color: #000;
            padding: 1px 2px;
            width: 100%;
            outline: none;
            border-radius: 0;
        }

#pdfTemplate .field {
            display: flex;
            flex-direction: column;
            gap: 1px;
        }

#pdfTemplate .field .label {
            font-size: 7.6pt;
            font-weight: normal;
        }

#pdfTemplate .inline-field {
            display: flex;
            align-items: baseline;
            gap: 4px;
        }

#pdfTemplate .inline-field .label {
            white-space: nowrap;
            font-size: 8.4pt;
        }

#pdfTemplate .inline-field .line-input {
            flex: 1;
        }

#pdfTemplate .check {
            width: 3mm;
            height: 3mm;
            border: 1px solid #000;
            flex: none;
            margin: 0;
            display: inline-block;
            background: #fff;
        }

/* html2canvas does not reliably render native form-control state (not even
   via CSS :checked on a real <input>) — it screenshots the DOM and form
   widgets are a known blind spot for it. So every "checkbox" in this
   template is a plain <span class="checkbox check"> (not a real input),
   and JS toggles the plain ".checked" class below, which html2canvas
   paints correctly since it's just a normal CSS background. */
#pdfTemplate .checkbox.checked {
            background: #000;
        }

#pdfTemplate .check-item {
            display: inline-flex;
            align-items: center;
            gap: 2px;
            font-size: 8.4pt;
        }

#pdfTemplate .check-group {
            display: flex;
            gap: 10px;
            align-items: center;
            flex-wrap: wrap;
        }

#pdfTemplate .section {
            margin-bottom: 2.2mm;
        }

#pdfTemplate .section-title {
            font-size: 9.6pt;
            font-weight: bold;
            text-transform: uppercase;
            border-bottom: 1px solid #000;
            padding-bottom: 0.6mm;
            margin-bottom: 1.4mm;
        }

#pdfTemplate .section-title-sm {
            font-size: 8.6pt;
            font-weight: bold;
            text-transform: uppercase;
            margin-bottom: 1mm;
        }

/* Header */
#pdfTemplate .header {
            display: grid;
            grid-template-columns: 22mm minmax(0, 1fr) 40mm;
            gap: 3mm;
            align-items: start;
            margin-bottom: 2mm;
        }

#pdfTemplate .logo-box {
            width: 60px;
            height: 60px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 6.5pt;
            text-align: center;
            color: #555;
            margin-bottom: 2mm;
        }

#pdfTemplate .header-numbers {
            display: flex;
            justify-content: center;
            gap: 6mm;
            margin-bottom: 1.4mm;
            font-size: 7.6pt;
        }

#pdfTemplate .header-numbers .label {
            font-weight: bold;
        }

#pdfTemplate .header-numbers .line-input {
            width: 22mm;
            display: inline-block;
        }

#pdfTemplate .header-center {
            text-align: center;
            padding-top: 1mm;
        }

#pdfTemplate .header-center h1 {
            font-size: 13.5pt;
            font-weight: bold;
            text-transform: uppercase;
            margin: 0 0 1mm;
        }

#pdfTemplate .header-center .school-name {
            font-size: 10.5pt;
            font-weight: bold;
            margin: 0 0 0.6mm;
        }

#pdfTemplate .header-center .school-address {
            font-size: 8pt;
            font-weight: normal;
        }

#pdfTemplate .header-right {
            display: flex;
            flex-direction: column;
            gap: 1.6mm;
        }

#pdfTemplate .header-right .inline-field .label {
            font-size: 7.6pt;
            width: 15mm;
            flex: none;
        }

#pdfTemplate .header-right .inline-field input[name="header_date"] {
            min-width: 24mm;
            font-size: 7.4pt;
        }

/* Instructions */
#pdfTemplate .instructions {
            text-align: center;
            font-style: italic;
            font-size: 8.2pt;
            border-top: 1px solid #000;
            border-bottom: 1px solid #000;
            padding: 1.2mm 0;
            margin-bottom: 2.4mm;
        }

/* Personal Info */
#pdfTemplate .name-row {
            display: grid;
            grid-template-columns: 1fr 16mm;
            gap: 4mm;
            align-items: end;
            margin-bottom: 2mm;
        }

#pdfTemplate .name-row .line-input {
            font-size: 10pt;
        }

#pdfTemplate .block-letter-row {
            display: grid;
            grid-template-columns: 26mm 1fr;
            align-items: center;
            gap: 2mm;
            margin-bottom: 1.2mm;
        }

#pdfTemplate .block-letter-row .row-label {
            font-size: 8pt;
            font-weight: bold;
        }

#pdfTemplate .char-boxes {
            display: grid;
            grid-template-columns: repeat(20, 1fr);
            gap: 0.6mm;
        }

#pdfTemplate .char-boxes input {
            width: 100%;
            height: 6.2mm;
            border: 0.75px solid #000;
            text-align: center;
            text-transform: uppercase;
            font-family: inherit;
            font-size: 8pt;
            padding: 0;
            background: transparent;
            border-radius: 0;
        }

/* Address */
#pdfTemplate .address-input {
            margin-bottom: 0.8mm;
        }

#pdfTemplate .address-guide {
            font-size: 7pt;
            text-align: center;
            color: #333;
        }

/* Grids */
#pdfTemplate .grid-4 {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 3mm;
            margin-bottom: 1.8mm;
        }

#pdfTemplate .grid-3 {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 3mm;
            margin-bottom: 1.8mm;
        }

#pdfTemplate .grid-2 {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 5mm;
        }

#pdfTemplate .birthday-row {
            display: flex;
            align-items: center;
            gap: 2px;
        }

#pdfTemplate .birthday-row input {
            width: 9mm;
            text-align: center;
            border: none;
            border-bottom: 0.75px solid #000;
            background: transparent;
            font-family: inherit;
            font-size: 8pt;
            border-radius: 0;
        }

/* "Sep"-style short month names need more room than a numeric day. */
#pdfTemplate .birthday-row input.birth-month {
            width: 14mm;
        }

#pdfTemplate .birthday-row span {
            font-size: 7pt;
        }

/* Education — one shared grid across all 3 rows so "Year Graduated" lines
   up in the same column for JHS and Elementary, and the LRN line (which
   has no competing second field on its row) stretches to fill the space. */
#pdfTemplate .edu-grid {
            display: grid;
            grid-template-columns: max-content 1fr max-content 16mm;
            column-gap: 2mm;
            row-gap: 1.4mm;
            align-items: baseline;
        }

#pdfTemplate .edu-grid .label {
            font-size: 8.2pt;
            white-space: nowrap;
        }

#pdfTemplate .edu-grid .edu-span-value {
            grid-column: 2 / 5;
        }

#pdfTemplate .edu-grid .lrn-input {
            width: 100%;
            border-radius: 0;
        }

#pdfTemplate .edu-grid .year-input {
            width: 100%;
            border-radius: 0;
        }

/* Choice rows */
#pdfTemplate .choice-row {
            display: flex;
            align-items: center;
            gap: 2mm;
            margin-bottom: 1.3mm;
            font-size: 8.2pt;
        }

#pdfTemplate .choice-row .label {
            flex: 0 0 20mm;
        }

#pdfTemplate .choice-row input {
            width: 8mm;
            text-align: center;
            border: none;
            border-bottom: 0.75px solid #000;
            background: transparent;
            font-family: inherit;
            font-size: 8pt;
            border-radius: 0;
        }

#pdfTemplate .req-item {
            display: flex;
            align-items: center;
            gap: 2mm;
            margin-bottom: 1mm;
            font-size: 8.2pt;
        }

/* Parent/Guardian */
#pdfTemplate .parent-col {
            display: flex;
            flex-direction: column;
            gap: 1.3mm;
        }

#pdfTemplate .parent-head {
            display: flex;
            align-items: center;
            gap: 2mm;
            font-weight: bold;
            font-size: 9pt;
            margin-bottom: 0.6mm;
        }

#pdfTemplate .parent-head .note {
            font-weight: normal;
            font-size: 7.4pt;
        }

#pdfTemplate .guardian-grid {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 3mm;
        }

/* School Use */
#pdfTemplate .school-use-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 5mm;
        }

#pdfTemplate .school-use-box {
            border: 1px solid #000;
            padding: 2mm;
        }

#pdfTemplate .school-use-box .title {
            font-weight: bold;
            font-size: 8.6pt;
            text-align: center;
            margin-bottom: 1mm;
        }

#pdfTemplate .school-use-box .subtitle {
            font-weight: normal;
            font-size: 7pt;
            display: block;
        }

#pdfTemplate .school-use-box .field {
            margin-bottom: 1.4mm;
        }

#pdfTemplate .school-use-box .rec-line {
            border-bottom: 0.75px solid #000;
            height: 3.6mm;
            margin-bottom: 0.8mm;
        }

/* Declaration */
#pdfTemplate .declaration-text {
            font-size: 8.2pt;
            text-align: justify;
            line-height: 1.4;
            margin-bottom: 1.6mm;
        }

#pdfTemplate .declaration-text .line-input {
            display: inline-block;
            width: 55mm;
            margin: 0 1mm;
        }

#pdfTemplate .sig-row {
            display: flex;
            justify-content: space-around;
            gap: 8mm;
            margin-top: 1.2mm;
        }

#pdfTemplate .sig-field {
            text-align: center;
            flex: 1;
        }

#pdfTemplate .sig-field .line-input {
            text-align: center;
        }

#pdfTemplate .sig-field .label {
            font-size: 7.6pt;
            margin-top: 0.6mm;
        }

/* Data Privacy */
#pdfTemplate .privacy-title {
            font-weight: bold;
            font-size: 8.8pt;
            margin-bottom: 1mm;
        }

#pdfTemplate .privacy-text {
            font-size: 7.4pt;
            text-align: justify;
            line-height: 1.35;
            margin-bottom: 1.8mm;
        }

#pdfTemplate .privacy-sig-row {
            display: grid;
            grid-template-columns: 2fr 1fr;
            gap: 6mm;
        }

/* Hidden container so html2canvas can render it without showing on screen.
   Kept at the top-left with real dimensions (not 0x0/overflow:hidden and
   not pushed thousands of pixels off-screen) — extreme negative offsets
   combined with a zero-size, clipped ancestor are a known source of
   html2canvas silently clipping most of the content out of the capture,
   or capturing extra blank space / misaligned output.
   Uses position:absolute rather than fixed — html2canvas does not reliably
   support position:fixed and can capture such elements shifted by the
   page's current scroll offset. */
#pdfTemplateWrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 210mm;
    z-index: -9999;
    opacity: 0;
    pointer-events: none;
}


/* CARDS: SQUARE CORNERS (ALL MODULES) */
.card,
[class$="-card"],
[class^="card-"] {
  border-radius: 0 !important;
}
