

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

    :root {
      --blue: #2563eb;
      --blue-light: #3b82f6;
      --blue-dark: #1d4ed8;
      --cyan: #0ea5e9;
      --bg: #f1f5f9;
      --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.13);
    }

    body {
      font-family: 'Bricolage Grotesque', -apple-system, BlinkMacSystemFont, sans-serif;
      background: #f4f4f5;
      color: var(--text);
      min-height: 100vh;
    }

    /* ── Top Bar ── */
    .top-bar {
      position: sticky;
      top: 0;
      z-index: 100;
      background: rgba(255,255,255,0.92);
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
      border-bottom: 1px solid #e5e7eb;
      padding: 0 32px;
      height: 52px;
      display: flex;
      align-items: center;
    }
    .back-link {
      display: flex;
      align-items: center;
      gap: 7px;
      font-size: 0.82rem;
      font-weight: 600;
      color: #4b5563;
      text-decoration: none;
      transition: color 0.15s;
      letter-spacing: 0.01em;
    }
    .back-link:hover { color: #111827; }

    /* ── Page wrapper ── */
    .page-wrap {
      max-width: 860px;
      margin: 0 auto;
      padding: 32px 20px 60px;
    }

    /* ── Hero Header ── */
    .form-hero {
      background: linear-gradient(135deg, #0f172a 0%, #1e293b 60%, #111827 100%);
      border-radius: var(--radius);
      padding: 36px 40px;
      margin-bottom: 24px;
      position: relative;
      overflow: hidden;
      box-shadow: var(--shadow-lg);
    }
    .form-hero::before {
      content: '';
      position: absolute;
      top: -60px; right: -60px;
      width: 260px; height: 260px;
      background: radial-gradient(circle, rgba(255,255,255,0.04) 0%, transparent 70%);
      pointer-events: none;
    }
    .form-hero::after {
      content: '';
      position: absolute;
      bottom: -40px; left: 40%;
      width: 180px; height: 180px;
      background: radial-gradient(circle, rgba(255,255,255,0.03) 0%, transparent 70%);
      pointer-events: none;
    }
    .hero-inner {
      display: flex;
      align-items: center;
      gap: 24px;
      position: relative;
      z-index: 1;
    }
    .hero-logo {
      width: 58px;
      height: 58px;
      border-radius: 14px;
      background: rgba(255,255,255,0.08);
      border: 1px solid rgba(255,255,255,0.14);
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
    }
    .hero-logo img { width: 38px; height: 38px; object-fit: contain; }
    .hero-text { flex: 1; }
    .hero-text .badge {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      background: rgba(255,255,255,0.08);
      border: 1px solid rgba(255,255,255,0.14);
      color: rgba(255,255,255,0.6);
      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.45);
      margin-top: 4px;
      font-weight: 500;
    }
    .hero-photo { flex-shrink: 0; }
    .photo-upload-wrap {
      width: 96px;
      height: 112px;
      border-radius: 12px;
      background: rgba(255,255,255,0.07);
      border: 1.5px dashed rgba(255,255,255,0.28);
      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.13);
      border-color: rgba(255,255,255,0.5);
    }
    .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.55);
      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 ── (keeps blue) */
    .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, #0f172a 0%, #1e3a5f 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(--blue), var(--cyan));
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
      box-shadow: 0 2px 8px rgba(37,99,235,0.4);
    }
    .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.45); margin-top: 1px; }
    .ocr-top-badge {
      margin-left: 35px;
      background: rgba(34,197,94,0.15);
      border: 1px solid rgba(34,197,94,0.3);
      color: #4ade80;
      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: #4ade80;
      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: #f8fafc;
      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: #eff6ff; border-color: var(--blue); color: var(--blue); }
    .ocr-upload-zone.has-image { border-style: solid; border-color: var(--blue); background: #f0f9ff; 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(--blue-dark) 0%, var(--blue-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 rgba(37,99,235,0.25);
      font-family: inherit;
    }
    .ocr-action-btn:hover { box-shadow: 0 4px 18px rgba(37,99,235,0.38); 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: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }

    /* ── 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: #f3f4f6;
      border: 1px solid #e5e7eb;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
    }
    .section-icon svg { width: 16px; height: 16px; stroke: #374151; fill: none; }
    .section-title { font-size: 0.88rem; font-weight: 700; color: #111827; letter-spacing: -0.01em; }
    .section-num { font-size: 0.68rem; font-weight: 700; color: #9ca3af; 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: 80px; line-height: 1.5; }
    .field input:focus,
    .field select:focus,
    .field textarea:focus {
      border-color: #374151;
      background: #fff;
      box-shadow: 0 0 0 3px rgba(55,65,81,0.08);
    }
    .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(37,99,235,0.35); background: #eff6ff; }
      60% { box-shadow: 0 0 0 4px rgba(37,99,235,0.1); }
      100% { box-shadow: none; background: #fafafa; }
    }
    .ocr-filled { animation: ocrHighlight 1.1s ease; }

    /* ── Same address ── */
    .copy-check {
      display: inline-flex;
      align-items: center;
      gap: 7px;
      font-size: 0.77rem;
      font-weight: 600;
      color: #374151;
      cursor: pointer;
      margin-top: 8px;
      text-transform: none;
      letter-spacing: 0;
    }
    .copy-check input[type="checkbox"] {
      width: 14px; height: 14px;
      accent-color: #111827;
      cursor: pointer;
    }

    /* ── 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: #9ca3af; background: #f9fafb; }
    .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-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: #9ca3af; background: #f9fafb; }
    .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, #e5e7eb, 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: #f9fafb; border-top: 1px solid #f3f4f6; }
    .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: #111827; flex-shrink: 0; cursor: pointer;
    }

    /* ── 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: #9ca3af; color: #111827; background: #f9fafb; }
    .btn-submit {
      background: #111827;
      border: none; color: #fff;
      box-shadow: 0 2px 8px rgba(0,0,0,0.18);
    }
    .btn-submit:hover { background: #1f2937; box-shadow: 0 4px 16px rgba(0,0,0,0.24); 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;
    }

    /* ── Modal ── */
    .modal-overlay {
      position: fixed; inset: 0;
      background: rgba(0,0,0,0.45);
      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.2);
      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: #111827;
      border-radius: 50%;
      display: flex; align-items: center; justify-content: center;
      margin: 0 auto 20px;
      box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    }
    .modal-icon svg { stroke: #fff; }
    .modal h3 { font-size: 1.2rem; font-weight: 800; color: #111827; margin-bottom: 8px; }
    .modal p { font-size: 0.85rem; color: #4b5563; margin-bottom: 6px; }
    .modal-id { margin-bottom: 24px !important; }
    .modal-id strong { color: #111827; font-weight: 700; }

    /* ── Age error ── */
    .age-error {
      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: 24px 20px; }
      .hero-inner { gap: 14px; }
      .hero-text h1 { font-size: 1.25rem; }
      .section { padding: 20px 18px; }
      .btn-row { padding: 18px; }
      .two-col, .three-col { grid-template-columns: 1fr; }
      .thumb-grid, .sig-grid { grid-template-columns: 1fr; }
      .ocr-body { flex-direction: column; }
      .ocr-action-btn { width: 100%; min-width: unset; padding: 12px; }
      .hero-photo { display: none; }
      .declaration-section { padding: 20px 18px; }
    }