@font-face {
  font-family: "TASA Explorer";
  src: url("../fonts/TASAExplorer-Regular.woff2") format("woff2"),
       url("../fonts/TASAExplorer-Regular.woff") format("woff");
  font-weight: 100 900;
  font-display: swap;
  font-style: normal;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

    :root {
      --primary: #e87b2f;
      --primary-light: #f5a623;
      --primary-dark: #c96521;
      --navy: #0a1628;
      --navy-light: #0f1d32;
      --navy-mid: #162a46;
      --accent-glow: rgba(232,123,47,0.3);
      --bg: #f0f2f5;
      --card: #ffffff;
      --border: #d1d5db;
      --text: #0f172a;
      --text-secondary: #374151;
      --text-muted: #6b7280;
      --red: #ef4444;
      --green: #22c55e;
      --radius: 16px;
      --radius-sm: 10px;
      --shadow: 0 1px 3px rgba(0,0,0,0.07), 0 4px 16px rgba(0,0,0,0.06);
      --shadow-lg: 0 8px 32px rgba(0,0,0,0.18);
    }

    body {
      font-family: "TASA Explorer", sans-serif;
      background: var(--bg);
      color: var(--text);
      min-height: 100vh;
    }

    /* ── Top Bar ── */
    .top-bar {
      position: sticky;
      top: 0;
      z-index: 100;
      background: var(--navy);
      border-bottom: 1px solid rgba(255,255,255,0.08);
      padding: 0 32px;
      height: 52px;
      display: flex;
      align-items: center;
      justify-content: space-between;
    }
    .back-link {
      display: flex;
      align-items: center;
      gap: 7px;
      font-size: 0.82rem;
      font-weight: 600;
      color: rgba(255,255,255,0.65);
      text-decoration: none;
      transition: color 0.15s;
      letter-spacing: 0.01em;
    }
    .back-link:hover { color: var(--primary-light); }
    .top-bar-brand {
      display: flex;
      align-items: center;
      gap: 8px;
      font-size: 0.78rem;
      font-weight: 700;
      color: #fff;
      letter-spacing: 0.01em;
    }
    .top-bar-actions {
      display: flex;
      align-items: center;
      gap: 14px;
    }
    .top-bar-download {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 32px;
      height: 32px;
      border-radius: 7px;
      background: rgba(255,255,255,0.06);
      border: 1px solid rgba(255,255,255,0.1);
      color: rgba(255,255,255,0.55);
      transition: all 0.18s;
      text-decoration: none;
      cursor: pointer;
      padding: 0;
      font-family: inherit;
    }
    .top-bar-download:hover {
      background: rgba(232,123,47,0.15);
      border-color: rgba(232,123,47,0.35);
      color: var(--primary-light);
    }
    .top-bar-logo {
      width: 26px;
      height: 26px;
      object-fit: contain;
    }

    /* ── Page wrapper ── */
    .page-wrap {
      max-width: 860px;
      margin: 0 auto;
      padding: 32px 20px 60px;
    }

    /* ── Hero Header ── */
    .form-hero {
      background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 40%, var(--navy-mid) 100%);
      border-radius: var(--radius);
      padding: 36px 40px;
      margin-bottom: 24px;
      position: relative;
      overflow: hidden;
      box-shadow: var(--shadow-lg);
      border: 1px solid rgba(255,255,255,0.06);
    }
    .form-hero::before {
      content: '';
      position: absolute;
      top: -80px; right: -80px;
      width: 300px; height: 300px;
      background: radial-gradient(circle, rgba(232,123,47,0.08) 0%, transparent 70%);
      pointer-events: none;
    }
    .form-hero::after {
      content: '';
      position: absolute;
      bottom: -50px; left: 30%;
      width: 220px; height: 220px;
      background: radial-gradient(circle, rgba(245,166,35,0.06) 0%, transparent 70%);
      pointer-events: none;
    }
    .hero-inner {
      display: flex;
      align-items: center;
      gap: 24px;
      position: relative;
      z-index: 1;
    }
    .hero-logo {
      width: 62px;
      height: 62px;
      border-radius: 14px;
      background: rgba(255,255,255,0.07);
      border: 1px solid rgba(255,255,255,0.1);
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
      padding: 0;
      overflow: hidden;
    }
    .hero-logo img { width: 100%; height: 100%; object-fit: cover; border-radius: 14px; }
    .hero-text { flex: 1; }
    .hero-text .badge {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      background: rgba(232,123,47,0.12);
      border: 1px solid rgba(232,123,47,0.25);
      color: var(--primary-light);
      font-size: 0.68rem;
      font-weight: 700;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      padding: 3px 10px;
      border-radius: 20px;
      margin-bottom: 8px;
    }
    .hero-text h1 {
      font-size: 1.7rem;
      font-weight: 800;
      color: #fff;
      letter-spacing: -0.02em;
      line-height: 1.15;
    }
    .hero-text p {
      font-size: 0.82rem;
      color: rgba(255,255,255,0.4);
      margin-top: 4px;
      font-weight: 500;
    }

    /* ── Download Blank Form Button ── */
    .download-blank-btn {
      display: none;
    }

    .hero-photo { flex-shrink: 0; }
    .photo-upload-wrap {
      width: 96px;
      height: 112px;
      border-radius: 12px;
      background: rgba(255,255,255,0.05);
      border: 1.5px dashed rgba(255,255,255,0.2);
      cursor: pointer;
      transition: all 0.2s;
      overflow: hidden;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    .photo-upload-wrap:hover {
      background: rgba(255,255,255,0.1);
      border-color: var(--primary);
    }
    .photo-upload-wrap.required-error {
      border-color: #ef4444 !important;
      border-style: solid !important;
    }
    .photo-upload-wrap .photo-inner {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 6px;
      color: rgba(255,255,255,0.45);
      font-size: 0.65rem;
      font-weight: 600;
      text-align: center;
      text-transform: uppercase;
      letter-spacing: 0.05em;
    }
    .photo-upload-wrap .photo-inner svg { opacity: 0.6; }
    #photoPreview {
      width: 96px;
      height: 112px;
      object-fit: cover;
      display: none;
      border-radius: 12px;
    }

    /* ── OCR Panel ── */
    .ocr-panel {
      background: var(--card);
      border: 1px solid #e2e8f0;
      border-radius: var(--radius);
      margin-bottom: 20px;
      box-shadow: var(--shadow);
      overflow: hidden;
    }
    .ocr-top {
      background: linear-gradient(90deg, var(--navy) 0%, var(--navy-mid) 100%);
      padding: 16px 22px;
      display: flex;
      align-items: center;
      gap: 12px;
    }
    .ocr-icon-wrap {
      width: 36px;
      height: 36px;
      border-radius: 9px;
      background: linear-gradient(135deg, var(--primary), var(--primary-light));
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
      box-shadow: 0 2px 8px var(--accent-glow);
    }
    .ocr-icon-wrap svg { width: 18px; height: 18px; stroke: #fff; fill: none; }
    .ocr-top-text h3 { font-size: 0.95rem; font-weight: 700; color: #fff; letter-spacing: -0.01em; }
    .ocr-top-text p { font-size: 0.73rem; color: rgba(255,255,255,0.4); margin-top: 1px; }
    .ocr-top-badge {
      margin-left: 35px;
      background: rgba(232,123,47,0.12);
      border: 1px solid rgba(232,123,47,0.3);
      color: var(--primary-light);
      font-size: 0.65rem;
      font-weight: 700;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      padding: 3px 9px;
      border-radius: 20px;
      display: flex;
      align-items: center;
      gap: 5px;
    }
    .ocr-live-dot {
      width: 6px; height: 6px;
      border-radius: 50%;
      background: var(--primary-light);
      animation: pulse-dot 1.5s infinite;
    }
    @keyframes pulse-dot {
      0%, 100% { opacity: 1; transform: scale(1); }
      50% { opacity: 0.5; transform: scale(0.7); }
    }
    .ocr-body {
      padding: 18px 22px;
      display: flex;
      gap: 14px;
      align-items: stretch;
    }
    .ocr-upload-zone {
      flex: 1;
      min-height: 180px;
      border: 1.5px dashed #cbd5e1;
      border-radius: var(--radius-sm);
      cursor: pointer;
      background: #fafbfc;
      transition: all 0.2s;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 12px 16px;
      color: #64748b;
      font-size: 0.82rem;
      overflow: hidden;
    }
    .ocr-upload-zone:hover { background: #fff8f0; border-color: var(--primary); color: var(--primary); }
    .ocr-upload-zone.has-image { border-style: solid; border-color: var(--primary); background: #fff8f0; padding: 6px; }
    .ocr-upload-inner { display: flex; align-items: center; gap: 10px; font-weight: 500; }
    .ocr-upload-inner svg { opacity: 0.55; flex-shrink: 0; }
    .ocr-upload-zone:hover .ocr-upload-inner svg { opacity: 1; }
    .ocr-upload-zone img {
      max-height: 165px;
      max-width: 100%;
      border-radius: 8px;
      object-fit: contain;
    }
    .ocr-action-btn {
      padding: 0 26px;
      background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-light) 100%);
      color: #fff;
      border: none;
      border-radius: var(--radius-sm);
      font-size: 0.84rem;
      font-weight: 700;
      cursor: pointer;
      transition: all 0.2s;
      white-space: nowrap;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      min-width: 165px;
      letter-spacing: 0.01em;
      box-shadow: 0 2px 10px var(--accent-glow);
      font-family: inherit;
    }
    .ocr-action-btn:hover { box-shadow: 0 4px 18px rgba(232,123,47,0.4); transform: translateY(-1px); }
    .ocr-action-btn:active { transform: translateY(0); }
    .ocr-action-btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }
    .ocr-spinner {
      width: 15px; height: 15px;
      border: 2px solid rgba(255,255,255,0.3);
      border-top-color: #fff;
      border-radius: 50%;
      animation: spin 0.7s linear infinite;
      display: none;
    }
    @keyframes spin { to { transform: rotate(360deg); } }
    .ocr-msg {
      margin: 0 22px 16px;
      padding: 10px 14px;
      border-radius: 8px;
      font-size: 0.79rem;
      display: none;
      align-items: center;
      gap: 8px;
      font-weight: 500;
    }
    .ocr-msg svg { width: 15px; height: 15px; flex-shrink: 0; }
    .ocr-error { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; }
    .ocr-success { background: #fff8f0; border: 1px solid #fde0b5; color: #92400e; }

    /* ── Form Card ── */
    .form-card {
      background: var(--card);
      border: 1px solid #e5e7eb;
      border-radius: var(--radius);
      box-shadow: var(--shadow);
      overflow: hidden;
    }

    /* ── Section ── */
    .section { padding: 28px 36px; border-bottom: 1px solid #f3f4f6; }
    .section:last-child { border-bottom: none; }
    .section-header { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
    .section-icon {
      width: 34px; height: 34px;
      border-radius: 9px;
      background: var(--navy);
      border: 1px solid rgba(255,255,255,0.05);
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
    }
    .section-icon svg { width: 16px; height: 16px; stroke: var(--primary-light); fill: none; }
    .section-title { font-size: 0.88rem; font-weight: 700; color: var(--navy); letter-spacing: -0.01em; }
    .section-num { font-size: 0.68rem; font-weight: 700; color: var(--primary); letter-spacing: 0.06em; text-transform: uppercase; }

    /* ── Form Grid ── */
    .form-grid { display: grid; gap: 16px; margin-bottom: 16px; }
    .form-grid:last-child { margin-bottom: 0; }
    .two-col { grid-template-columns: 1fr 1fr; }
    .three-col { grid-template-columns: 1fr 1fr 1fr; }
    .single-col { grid-template-columns: 1fr; }

    /* ── Field ── */
    .field { display: flex; flex-direction: column; gap: 6px; }
    .field label {
      font-size: 0.73rem;
      font-weight: 700;
      color: #4b5563;
      letter-spacing: 0.04em;
      text-transform: uppercase;
    }
    .req { color: var(--red); }
    .field input,
    .field select,
    .field textarea {
      width: 100%;
      padding: 10px 14px;
      border: 1.5px solid #e5e7eb;
      border-radius: var(--radius-sm);
      font-size: 0.875rem;
      font-family: inherit;
      color: #111827;
      background: #fafafa;
      transition: all 0.18s;
      outline: none;
      appearance: none;
      -webkit-appearance: none;
    }
    .field select {
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
      background-repeat: no-repeat;
      background-position: right 12px center;
      padding-right: 36px;
      cursor: pointer;
    }
    .field textarea { resize: vertical; min-height: 100px; line-height: 1.5; }
    .field input:focus,
    .field select:focus,
    .field textarea:focus {
      border-color: var(--primary);
      background: #fff;
      box-shadow: 0 0 0 3px rgba(232,123,47,0.1);
    }
    .field input::placeholder,
    .field textarea::placeholder { color: #d1d5db; }
    .field input.field-error,
    .field select.field-error,
    .field textarea.field-error {
      border-color: #ef4444;
      background: #fff5f5;
    }

    /* filled highlight */
    @keyframes ocrHighlight {
      0% { box-shadow: 0 0 0 0 rgba(232,123,47,0.35); background: #fff8f0; }
      60% { box-shadow: 0 0 0 4px rgba(232,123,47,0.1); }
      100% { box-shadow: none; background: #fafafa; }
    }
    .ocr-filled { animation: ocrHighlight 1.1s ease; }

    /* ── Same address toggle ── */
    .same-address-row {
      margin-bottom: 16px;
      display: flex;
      justify-content: flex-end;
    }
    .same-address-btn {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      padding: 6px 14px;
      border: 1.5px solid #e5e7eb;
      border-radius: 8px;
      background: #fafafa;
      font-family: inherit;
      font-size: 0.77rem;
      font-weight: 600;
      color: #4b5563;
      cursor: pointer;
      transition: all 0.18s;
      user-select: none;
    }
    .same-address-btn:hover {
      border-color: var(--primary);
      background: #fff8f0;
      color: var(--primary-dark);
    }
    .same-address-check {
      width: 18px;
      height: 18px;
      border-radius: 5px;
      border: 1.5px solid #d1d5db;
      background: #fff;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: all 0.18s;
      flex-shrink: 0;
    }
    .same-address-check .check-icon {
      opacity: 0;
      transform: scale(0.5);
      transition: all 0.15s;
    }
    .same-address-btn[aria-pressed="true"] .same-address-check {
      background: var(--primary);
      border-color: var(--primary);
    }
    .same-address-btn[aria-pressed="true"] .same-address-check .check-icon {
      opacity: 1;
      transform: scale(1);
      stroke: #fff;
    }
    .same-address-btn[aria-pressed="true"] {
      border-color: var(--primary);
      background: #fff8f0;
      color: var(--primary-dark);
    }

    /* ── Remove old copy-check (no longer used) ── */

    /* ── Biometric / Thumb ── */
    .thumb-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
    .thumb-card {
      border: 1.5px dashed #e5e7eb;
      border-radius: var(--radius-sm);
      padding: 18px;
      text-align: center;
      transition: all 0.2s;
      background: #fafafa;
    }
    .thumb-card:hover { border-color: var(--primary); background: #fff8f0; }
    .thumb-card.required-error { border-color: #ef4444; border-style: solid; background: #fff5f5; }
    .thumb-card label.thumb-label { cursor: pointer; display: block; }
    .thumb-card .thumb-cap {
      font-size: 0.72rem; font-weight: 700;
      color: #4b5563;
      text-transform: uppercase; letter-spacing: 0.05em;
      margin-bottom: 12px;
    }
    .thumb-upload-area {
      height: 90px;
      display: flex; align-items: center; justify-content: center;
      flex-direction: column; gap: 6px;
      color: #9ca3af; font-size: 0.78rem; font-weight: 500;
    }
    .thumb-upload-area svg { opacity: 0.35; }
    .thumb-upload-area img { max-height: 82px; max-width: 100%; border-radius: 6px; object-fit: contain; display: none; }

    /* ── Signatures ── */
    .sig-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
    .sig-grid.sig-grid-three { grid-template-columns: 1fr 1fr 1fr; }
    .sig-card {
      border: 1.5px dashed #e5e7eb;
      border-radius: var(--radius-sm);
      padding: 18px;
      text-align: center;
      background: #fafafa;
      transition: all 0.2s;
    }
    .sig-card:hover { border-color: var(--primary); background: #fff8f0; }
    .sig-card.required-error { border-color: #ef4444; border-style: solid; background: #fff5f5; }
    .sig-upload-area {
      height: 70px;
      display: flex; align-items: center; justify-content: center;
      flex-direction: column; gap: 5px;
      color: #9ca3af; font-size: 0.78rem; font-weight: 500;
      cursor: pointer;
    }
    .sig-upload-area svg { opacity: 0.35; }
    .sig-upload-area img { max-height: 62px; max-width: 100%; object-fit: contain; display: none; border-radius: 4px; }
    .sig-line {
      height: 1.5px;
      background: linear-gradient(90deg, transparent, #d1d5db, transparent);
      margin: 12px 0 8px;
    }
    .sig-lbl { font-size: 0.71rem; font-weight: 700; color: #9ca3af; text-transform: uppercase; letter-spacing: 0.05em; }

    /* ── Declaration ── */
    .declaration-section { padding: 22px 36px; background: #faf6f1; border-top: 1px solid #f5e6d0; }
    .declaration-check {
      display: flex; align-items: flex-start; gap: 12px;
      font-size: 0.82rem; color: #374151; line-height: 1.5;
    }
    .declaration-check input[type="checkbox"] {
      width: 16px; height: 16px; margin-top: 2px;
      accent-color: var(--primary); flex-shrink: 0; cursor: pointer;
    }

    /* ── Employee Terms Panel ── */
    .terms-panel {
      border-bottom: 1px solid #f3f4f6;
    }
    .terms-toggle {
      width: 100%;
      padding: 18px 36px;
      background: var(--navy);
      border: none;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: space-between;
      font-family: inherit;
      transition: background 0.2s;
    }
    .terms-toggle:hover { background: var(--navy-light); }
    .terms-toggle-left {
      display: flex;
      align-items: center;
      gap: 10px;
      color: #fff;
    }
    .terms-toggle-left svg { stroke: var(--primary-light); flex-shrink: 0; }
    .terms-toggle-title {
      font-size: 0.85rem;
      font-weight: 700;
      letter-spacing: -0.01em;
    }
    .terms-toggle-sub {
      font-size: 0.68rem;
      font-weight: 500;
      color: rgba(255,255,255,0.4);
      letter-spacing: 0.02em;
    }
    .terms-chevron {
      stroke: rgba(255,255,255,0.5);
      transition: transform 0.25s;
      flex-shrink: 0;
    }
    .terms-toggle[aria-expanded="true"] .terms-chevron {
      transform: rotate(180deg);
    }
    .terms-body {
      max-height: 0;
      overflow: hidden;
      transition: max-height 0.35s ease;
    }
    .terms-body.open {
      max-height: 3000px;
    }
    .terms-content {
      padding: 24px 36px 28px;
      background: #fdfcfb;
      border-top: 1px solid #f5e6d0;
    }
    .terms-intro {
      font-size: 0.8rem;
      color: #374151;
      line-height: 1.6;
      margin-bottom: 20px;
      padding-bottom: 16px;
      border-bottom: 1px solid #f0ebe4;
    }
    .terms-clause {
      display: flex;
      gap: 14px;
      margin-bottom: 18px;
    }
    .terms-clause:last-of-type { margin-bottom: 20px; }
    .clause-num {
      width: 26px;
      height: 26px;
      border-radius: 7px;
      background: var(--navy);
      color: var(--primary-light);
      font-size: 0.7rem;
      font-weight: 800;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
      margin-top: 1px;
    }
    .clause-text {
      flex: 1;
    }
    .clause-text strong {
      display: block;
      font-size: 0.78rem;
      font-weight: 700;
      color: var(--navy);
      margin-bottom: 5px;
      letter-spacing: -0.01em;
    }
    .clause-text p {
      font-size: 0.77rem;
      color: #4b5563;
      line-height: 1.6;
      margin-bottom: 6px;
    }
    .clause-text ul {
      margin: 6px 0 6px 16px;
      padding: 0;
    }
    .clause-text ul li {
      font-size: 0.76rem;
      color: #4b5563;
      line-height: 1.55;
      margin-bottom: 4px;
      list-style: disc;
    }
    .clause-text ul li strong { display: inline; font-size: inherit; }
    .terms-full-link {
      padding-top: 16px;
      border-top: 1px solid #f0ebe4;
    }
    .terms-full-link a {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      font-size: 0.74rem;
      font-weight: 600;
      color: var(--primary);
      text-decoration: none;
      transition: color 0.15s;
    }
    .terms-full-link a:hover { color: var(--primary-dark); text-decoration: underline; }
    .declaration-check-row {
      padding: 20px 36px;
      background: #faf6f1;
      border-top: 1px solid #f5e6d0;
    }

    /* ── Print styles for terms ── */
    @media print {
      .top-bar, .ocr-panel, .btn-row, .form-footer, .terms-toggle, .terms-full-link { display: none !important; }
      .terms-body { max-height: none !important; overflow: visible !important; }
      .terms-content { padding: 16px 0; }
      .terms-declaration-section { break-inside: avoid; }
    }

    /* ── Buttons ── */
    .btn-row {
      padding: 24px 36px;
      display: flex; justify-content: flex-end; gap: 12px;
      border-top: 1px solid #f3f4f6;
      background: var(--card);
    }
    .btn {
      padding: 11px 28px;
      border-radius: var(--radius-sm);
      font-size: 0.875rem; font-weight: 700;
      cursor: pointer;
      transition: all 0.18s;
      font-family: inherit;
      letter-spacing: 0.01em;
      display: inline-flex; align-items: center; gap: 8px;
    }
    .btn-reset {
      background: #fff;
      border: 1.5px solid #e5e7eb;
      color: #4b5563;
    }
    .btn-reset:hover { border-color: var(--primary); color: var(--primary-dark); background: #fff8f0; }
    .btn-submit {
      background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-light) 100%);
      border: none; color: #fff;
      box-shadow: 0 2px 8px var(--accent-glow);
    }
    .btn-submit:hover { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%); box-shadow: 0 4px 16px rgba(232,123,47,0.4); transform: translateY(-1px); }
    .btn-submit:active { transform: translateY(0); }
    .btn-submit:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

    /* ── Footer ── */
    .form-footer {
      text-align: center; padding: 20px 0 0;
      font-size: 0.73rem; color: #9ca3af; font-weight: 500; letter-spacing: 0.02em;
    }
    .form-footer .powered-by {
      margin-top: 4px;
      font-size: 0.65rem;
      color: #b0b8c1;
      letter-spacing: 0.03em;
    }
    .form-footer .powered-by strong {
      color: #6b7280;
      font-weight: 700;
    }

    /* ── Modal ── */
    .modal-overlay {
      position: fixed; inset: 0;
      background: rgba(10,22,40,0.6);
      backdrop-filter: blur(6px);
      display: none; align-items: center; justify-content: center;
      z-index: 999; padding: 20px;
    }
    .modal-overlay.active { display: flex; }
    .modal {
      background: var(--card);
      border-radius: 20px;
      padding: 40px 40px 32px;
      max-width: 400px; width: 100%;
      text-align: center;
      box-shadow: 0 24px 60px rgba(0,0,0,0.25);
      animation: modal-in 0.3s cubic-bezier(0.34,1.56,0.64,1);
    }
    @keyframes modal-in {
      from { opacity: 0; transform: scale(0.88) translateY(16px); }
      to   { opacity: 1; transform: scale(1) translateY(0); }
    }
    .modal-icon {
      width: 64px; height: 64px;
      background: linear-gradient(135deg, var(--primary-dark), var(--primary-light));
      border-radius: 50%;
      display: flex; align-items: center; justify-content: center;
      margin: 0 auto 20px;
      box-shadow: 0 4px 16px var(--accent-glow);
    }
    .modal-icon svg { stroke: #fff; }
    .modal h3 { font-size: 1.2rem; font-weight: 800; color: var(--navy); margin-bottom: 8px; }
    .modal p { font-size: 0.85rem; color: #4b5563; margin-bottom: 6px; }
    .modal-id { margin-bottom: 24px !important; }
    .modal-id strong { color: var(--primary-dark); font-weight: 700; }

    /* ── Age error ── */
    .age-error {
      font-size: 0.72rem;
      color: #ef4444;
      font-weight: 600;
      margin-top: 3px;
      display: none;
    }

    /* ── Field hint / validation error ── */
    .field-hint {
      font-size: 0.72rem;
      color: #ef4444;
      font-weight: 600;
      margin-top: 3px;
      display: none;
    }

    /* ── Responsive ── */
    @media (max-width: 680px) {
      .page-wrap { padding: 16px 12px 48px; }
      .form-hero { padding: 20px 18px; border-radius: 12px; }
      .hero-inner { gap: 12px; }
      .ocr-action-btn { padding: 10px; font-size: 0.75rem; height: 40px; }
      .hero-logo { width: 48px; height: 48px; border-radius: 10px; }
      .hero-text .badge { font-size: 0.6rem; padding: 2px 8px; margin-bottom: 6px; }
      .hero-text h1 { font-size: 1.15rem; font-weight: 800; letter-spacing: -0.01em; line-height: 1.2; }
      .hero-text p { font-size: 0.72rem; font-weight: 500; margin-top: 3px; }
      .section { padding: 18px 16px; }
      .section-header { margin-bottom: 16px; gap: 10px; }
      .section-icon { width: 30px; height: 30px; border-radius: 7px; }
      .section-icon svg { width: 14px; height: 14px; }
      .section-title { font-size: 0.82rem; font-weight: 700; }
      .section-num { font-size: 0.62rem; font-weight: 700; letter-spacing: 0.05em; }
      .btn-row { padding: 16px; gap: 10px; }
      .two-col, .three-col { grid-template-columns: 1fr; }
      .form-grid { gap: 12px; margin-bottom: 12px; }
      .thumb-grid, .sig-grid { grid-template-columns: 1fr; }
      .sig-grid.sig-grid-three { grid-template-columns: 1fr; }

      /* Field labels */
      .field label {
        font-size: 0.68rem;
        font-weight: 700;
        letter-spacing: 0.03em;
      }

      /* Inputs, selects, textareas */
      .field input,
      .field select,
      .field textarea {
        padding: 10px 12px;
        font-size: 0.84rem;
        font-weight: 500;
        border-radius: 8px;
      }
      .field textarea { min-height: 80px; }

      /* Photo upload area */
      #photoLabel,
      [id="photoLabel"] {
        width: 80px !important;
        height: 106px !important;
        border-radius: 8px !important;
      }
      #photoPreview {
        width: 80px !important;
        height: 106px !important;
      }
      .photo-inner {
        font-size: 0.56rem !important;
      }
      .photo-inner svg { width: 20px !important; height: 20px !important; }

      /* Section 1 header + photo flex */
      .section > div:first-child {
        gap: 12px !important;
        margin-bottom: 16px !important;
      }

      /* Biometric cards */
      .thumb-card { padding: 14px; }
      .thumb-card .thumb-cap { font-size: 0.66rem; font-weight: 700; margin-bottom: 10px; }
      .thumb-upload-area { height: 80px; font-size: 0.72rem; font-weight: 500; }

      /* Signature cards */
      .sig-card { padding: 14px; }
      .sig-upload-area { height: 60px; font-size: 0.72rem; font-weight: 500; }
      .sig-lbl { font-size: 0.65rem; font-weight: 700; }
      .sig-line { margin: 10px 0 6px; }

      /* Same address button */
      .same-address-btn {
        font-size: 0.72rem;
        font-weight: 600;
        padding: 6px 12px;
      }
      .same-address-row { margin-bottom: 12px; }

      /* Buttons */
      .btn {
        padding: 10px 20px;
        font-size: 0.82rem;
        font-weight: 700;
        border-radius: 8px;
        gap: 6px;
      }
      .btn svg { width: 13px; height: 13px; }

      /* Validation errors */
      .age-error, .field-hint {
        font-size: 0.66rem;
        font-weight: 600;
      }

      /* OCR panel */
      .ocr-body { flex-direction: column; }
      .ocr-action-btn { width: 100%; min-width: unset; padding: 12px; font-size: 0.78rem; font-weight: 700; height: 30px; }
      .ocr-upload-zone { min-height: 50px !important; }
      .ocr-top-text h3 { font-size: 0.8rem !important; font-weight: 700; }
      .ocr-top-badge { font-size: 0.58rem; font-weight: 700; }
      .ocr-msg { font-size: 0.72rem; font-weight: 500; margin: 0 14px 12px; padding: 8px 12px; }

      /* Terms panel */
      .terms-toggle { padding: 14px 16px; }
      .terms-toggle-title { font-size: 0.78rem; font-weight: 700; }
      .terms-toggle-sub { font-size: 0.6rem; font-weight: 500; }
      .terms-content { padding: 18px 16px 22px; }
      .terms-intro { font-size: 0.74rem; font-weight: 500; line-height: 1.55; margin-bottom: 16px; padding-bottom: 12px; }
      .terms-clause { gap: 10px; margin-bottom: 14px; }
      .clause-num { width: 22px; height: 22px; font-size: 0.62rem; font-weight: 800; border-radius: 6px; }
      .clause-text strong { font-size: 0.72rem; font-weight: 700; margin-bottom: 4px; }
      .clause-text p { font-size: 0.7rem; font-weight: 500; line-height: 1.55; margin-bottom: 4px; }
      .clause-text ul { margin: 4px 0 4px 14px; }
      .clause-text ul li { font-size: 0.68rem; font-weight: 500; line-height: 1.5; margin-bottom: 3px; }
      .terms-full-link a { font-size: 0.68rem; font-weight: 600; }

      /* Declaration */
      .declaration-check-row { padding: 16px; }
      .declaration-check {
        font-size: 0.74rem;
        font-weight: 500;
        line-height: 1.45;
        gap: 10px;
      }
      .declaration-check input[type="checkbox"] { width: 18px; height: 18px; margin-top: 1px; }
      .declaration-check strong { font-weight: 700; }

      /* Hero photo hidden */
      .hero-photo { display: none; }
      .declaration-section { padding: 16px; }

      /* Top bar */
      .top-bar { padding: 0 12px; height: 48px; }
      .top-bar-brand span { display: none; }
      .top-bar-brand { gap: 0; }
      .top-bar-logo { width: 24px; height: 24px; }
      .back-link { font-size: 0.74rem; font-weight: 600; gap: 5px; }
      .back-link svg { width: 14px; height: 14px; }
      .top-bar-download { width: 30px; height: 30px; border-radius: 6px; }
      .top-bar-download svg { width: 14px; height: 14px; }
      .top-bar-actions { gap: 10px; }

      /* Footer */
      .form-footer { padding: 16px 0 0; }
      .form-footer p { font-size: 0.66rem; font-weight: 500; }
      .form-footer .powered-by { font-size: 0.58rem; }

      /* Modal */
      .modal { padding: 28px 24px 24px; border-radius: 16px; }
      .modal-icon { width: 52px; height: 52px; margin-bottom: 16px; }
      .modal-icon svg { width: 22px; height: 22px; }
      .modal h3 { font-size: 1.05rem; font-weight: 800; }
      .modal p { font-size: 0.78rem; font-weight: 500; }
      .modal-id strong { font-weight: 700; }

      /* Form card */
      .form-card { border-radius: 12px; }
    }

    /* Extra small devices */
    @media (max-width: 400px) {
      .page-wrap { padding: 10px 8px 40px; }
      .form-hero { padding: 16px 14px; }
      .hero-logo { width: 42px; height: 42px; border-radius: 8px; }
      .hero-text h1 { font-size: 1.05rem; }
      .hero-text p { font-size: 0.66rem; }
      .hero-text .badge { font-size: 0.55rem; padding: 2px 6px; }
      .section { padding: 14px 12px; }
      .section-title { font-size: 0.78rem; }
      .section-num { font-size: 0.58rem; }
      .section-icon { width: 26px; height: 26px; }
      .section-icon svg { width: 12px; height: 12px; }
      .field label { font-size: 0.64rem; }
      .field input,
      .field select,
      .field textarea {
        padding: 9px 10px;
        font-size: 0.8rem;
      }
      .btn { padding: 9px 16px; font-size: 0.78rem; }
      .btn-row { padding: 14px 12px; }
      .terms-toggle { padding: 12px; }
      .terms-toggle-title { font-size: 0.72rem; }
      .terms-content { padding: 14px 12px 18px; }
      .declaration-check-row { padding: 12px; }
      .declaration-check { font-size: 0.7rem; }
      .top-bar { padding: 0 8px; height: 44px; }
      .back-link { font-size: 0.68rem; }
      .modal { padding: 24px 18px 20px; }
      .modal h3 { font-size: 0.95rem; }
    }