/* ============================================================
   AXA iHealthy — Application Form (trilingual DE/EN/FR)
   Faithful to the paper form "Application Form AXA ihealthy
   english_062026". The generated PDF is always ENGLISH.
   ============================================================ */

:root {
  --ink: #1a1f2b;
  --muted: #5a6270;
  --accent: #00458a;        /* Krungthai AXA blue */
  --accent-dark: #003062;
  --line: #9aa4b2;
  --soft: #f2f5f9;
  --paper: #ffffff;
  --warn-bg: #fff7e6;
  --warn-border: #e6b800;
  --ok: #1e7d32;
  --err: #c62828;
  --red: #bf0041;
  --radius: 6px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: #e9edf2;
  color: var(--ink);
  font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
}

/* ---------- Top bar ---------- */
.topbar {
  background: var(--accent);
  color: #fff;
  padding: 10px 20px;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .18);
}
.topbar-inner {
  max-width: 1040px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15.5px; letter-spacing: .2px; }
.brand-dot {
  width: 14px; height: 14px; border-radius: 3px;
  background: #fff;
  box-shadow: inset 0 0 0 3px var(--accent);
}
.lang { display: flex; align-items: center; gap: 6px; }
.lang-label { font-size: 12.5px; opacity: .85; margin-right: 4px; }
.lang-btn {
  background: transparent; color: #fff;
  border: 1px solid rgba(255, 255, 255, .5);
  border-radius: 999px;
  padding: 5px 12px; cursor: pointer; font-size: 12.5px; font-weight: 600;
}
.lang-btn:hover { background: rgba(255, 255, 255, .12); }
.lang-btn.active { background: #fff; color: var(--accent-dark); }

/* ---------- Layout ---------- */
.container {
  max-width: 1040px;
  margin: 18px auto 50px;
  background: var(--paper);
  box-shadow: 0 2px 14px rgba(0, 0, 0, .12);
  border-radius: 4px;
  padding: 26px 34px 40px;
}

.doc-meta {
  display: flex; justify-content: space-between; align-items: center;
  gap: 10px; flex-wrap: wrap;
  font-size: 12px; color: var(--muted);
  border-bottom: 2px solid var(--accent);
  padding-bottom: 10px; margin-bottom: 14px;
}
.doc-meta-ref { font-weight: 600; color: var(--accent-dark); }

.alert { border-radius: var(--radius); padding: 9px 13px; font-size: 13px; margin: 12px 0; }
.alert.warn { background: var(--warn-bg); border: 1px solid var(--warn-border); color: #7a6200; }

/* ---------- Sections ---------- */
.form-section {
  border: 1px solid var(--line);
  border-radius: 4px;
  margin: 18px 0;
  background: #fff;
  padding-bottom: 14px;
}
.section-title {
  background: var(--accent);
  color: #fff;
  padding: 9px 14px;
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  border-radius: 3px 3px 0 0;
  letter-spacing: .2px;
}
.section-body { padding: 12px 14px; }

.field { padding: 8px 14px 2px; }
.field label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 4px; color: var(--ink); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; column-gap: 18px; }
@media (max-width: 720px) { .grid-2 { grid-template-columns: 1fr; } }

input[type="text"], input[type="tel"], input[type="email"], textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 8px 10px;
  font-size: 14px;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
}
input:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(0, 69, 138, .14);
}

/* ---------- Radios / checkboxes ---------- */
.radio-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; padding: 6px 0; }
.radio { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 14px; }
.radio input[type="radio"], .checkbox input[type="checkbox"] {
  width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer;
}
.radio-pair { display: inline-flex; gap: 14px; }

.phone-row { display: flex; align-items: center; gap: 6px; }
.phone-prefix {
  background: var(--soft); border: 1px solid var(--line); border-radius: 4px;
  padding: 7px 10px; font-size: 13.5px; color: var(--muted); font-weight: 600;
  white-space: nowrap;
}

/* ---------- Plan cards ---------- */
.plan-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  padding: 6px 0;
}
@media (max-width: 860px) { .plan-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 520px) { .plan-grid { grid-template-columns: repeat(2, 1fr); } }
.plan-card {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  border: 1.5px solid var(--line);
  border-radius: 5px;
  padding: 12px 6px;
  cursor: pointer;
  font-weight: 700;
  font-size: 12.5px;
  text-align: center;
  background: #fff;
  transition: border-color .12s, background .12s;
}
.plan-card:hover { border-color: var(--accent); background: #f2f7fd; }
.plan-card:has(input:checked) { border-color: var(--accent); background: #e4effa; color: var(--accent-dark); }
.plan-card input { accent-color: var(--accent); }

.deduct-wrap { padding: 2px 0; }
.deduct-prompt { font-size: 13.5px; margin-left: 4px; }
.deduct-amounts { margin-top: 2px; }
.help-text { font-size: 12px; color: var(--muted); margin: 6px 0 0; font-style: italic; }

/* ---------- Notice box (monthly payment) ---------- */
.notice-box {
  margin: 10px 14px 4px;
  background: var(--soft);
  border: 1px solid #c8d2dd;
  border-radius: 4px;
  padding: 10px 14px;
  font-size: 13px;
}
.notice-title { font-weight: 700; margin: 0 0 4px; color: var(--accent-dark); }
.notice-box ul { margin: 4px 0; padding-left: 18px; }
.notice-banks { font-weight: 700; margin: 6px 0 0; }

/* ---------- Beneficiary ---------- */
.benef-note { font-size: 12.5px; color: var(--muted); margin: 4px 0 2px; font-style: italic; }

/* ---------- Health questions ---------- */
.health-list { margin-top: 4px; }
.hq {
  padding: 8px 14px 4px;
  border-bottom: 1px dotted #d7dce3;
}
.hq:last-child { border-bottom: 0; }
.hq-text { margin: 0 0 2px; font-size: 13.5px; color: #262d3a; }
.hq-head {
  margin: 10px 14px 2px;
  font-weight: 700;
  font-size: 13px;
  color: var(--accent-dark);
  border-left: 3px solid var(--accent);
  padding-left: 8px;
}
.hq-head + .hq-head { margin-top: 4px; }

/* ---------- AML ---------- */
.static-note { margin: 10px 14px 2px; font-size: 13.5px; }
.static-note.strong { font-weight: 700; color: var(--accent-dark); }
.inline-label { font-size: 13.5px; margin-left: 6px; }
.aml-list { margin-top: 2px; }
.aml-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px dotted #d7dce3;
  flex-wrap: wrap;
}
.aml-q { flex: 1 1 300px; font-size: 13.5px; }

/* ---------- Declarations / notices ---------- */
.decl-list { margin: 10px 14px 2px; padding-left: 20px; font-size: 13px; color: #2c3440; }
.decl-list li { margin: 7px 0; text-align: justify; }
.oic-list { margin: 2px 14px 6px; padding-left: 30px; font-size: 12.5px; color: #3a4350; }
.oic-list li { margin: 4px 0; }

/* ---------- Consent ---------- */
.consent-field {
  display: flex; align-items: flex-start; gap: 10px;
  margin: 10px 14px 2px;
  padding: 10px 12px;
  background: var(--soft);
  border: 1px solid #d3dae2;
  border-radius: 4px;
}
.checkbox { display: inline-flex; align-items: center; margin-top: 2px; }
.consent-label { font-size: 13px; }
.d6-note { margin: 10px 14px 2px; font-size: 12px; color: var(--muted); font-style: italic; }

/* ---------- Signature ---------- */
.sig-date { max-width: 320px; }
.sig-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 6px 14px 4px; }
@media (max-width: 860px) { .sig-grid { grid-template-columns: 1fr; } }
.sig-canvas-wrap { position: relative; }
.sig-canvas-wrap canvas {
  display: block;
  width: 100%;
  height: 130px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  touch-action: none;
  cursor: crosshair;
}
.sig-name {
  margin-top: 6px;
  font-size: 13px;
  border-style: dashed;
  color: var(--muted);
}
.sig-clear {
  position: absolute;
  top: 6px; right: 6px;
  background: rgba(255, 255, 255, .92);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 3px 9px;
  font-size: 11.5px;
  cursor: pointer;
  color: var(--muted);
}
.sig-clear:hover { color: var(--err); border-color: var(--err); }
.sig-caption { font-size: 12px; color: var(--muted); margin: 5px 0 0; font-weight: 600; }

/* ---------- Foreigner docs (red) ---------- */
.docs-box {
  margin: 12px 14px 4px;
  border: 1.5px solid var(--red);
  background: #fdf0f4;
  border-radius: 4px;
  padding: 10px 14px;
}
.docs-title { color: var(--red); font-weight: 700; margin: 0 0 6px; font-size: 13.5px; }
.docs-list { margin: 0; padding-left: 18px; font-size: 12.8px; color: #5c1530; }
.docs-list li { margin: 3px 0; }

/* ---------- Validation marks ---------- */
.invalid input, .invalid textarea {
  background: #fdecea !important;
  border-color: #d33 !important;
  box-shadow: 0 0 0 1px #d33 !important;
}
.invalid .radio, .invalid label { color: #b71c1c; }
.field.invalid, .hq.invalid, .consent-field.invalid {
  background: #fdf1f0;
  border-radius: 4px;
  outline: 1.5px solid #d33;
  outline-offset: 2px;
}
.hq.invalid { margin: 0; }
.hq.invalid .radio-row { background: #fdf1f0; }

/* ---------- Honeypot ---------- */
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }

/* ---------- Actions ---------- */
.actions {
  display: flex; flex-wrap: wrap; gap: 10px;
  margin: 16px 14px 4px;
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 11px 18px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.btn:hover { background: var(--soft); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-secondary { background: #fff; }
.btn.hidden { display: none; }
.send-note { margin: 10px 14px 2px; font-size: 12.5px; color: var(--muted); }

/* ---------- Status ---------- */
.status {
  display: none;
  margin: 14px; padding: 11px 14px; border-radius: var(--radius);
  font-size: 13.5px; border: 1px solid;
}
.status.ok { display: block; background: #e8f5e9; border-color: var(--ok); color: var(--ok); }
.status.err { display: block; background: #fdecea; border-color: var(--err); color: var(--err); }
.status.info { display: block; background: #e3f0fa; border-color: var(--accent); color: var(--accent-dark); }
.status.warn { display: block; background: var(--warn-bg); border-color: var(--warn-border); color: #7a6200; }

/* ---------- Footer ---------- */
.footer {
  max-width: 1040px;
  margin: 0 auto 40px;
  padding: 0 34px;
  font-size: 12.5px;
  color: var(--muted);
}
.collapsible { border: 1px solid var(--line); border-radius: 4px; background: #fff; margin: 10px 0; padding: 8px 12px; }
.collapsible summary { cursor: pointer; font-weight: 700; color: var(--accent-dark); }
.collapsible p { margin: 8px 0 2px; text-align: justify; }
.footer-note { margin: 12px 0 4px; }
.footer-brand { font-weight: 700; color: var(--accent-dark); margin-top: 8px; }

/* ---------- Print ---------- */
@media print {
  body { background: #fff; }
  .topbar, .actions, .alert, .no-print { display: none !important; }
  .container { box-shadow: none; margin: 0; max-width: none; padding: 6px; }
  .form-section { break-inside: avoid; }
}

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .container { padding: 14px 12px 30px; margin: 8px auto 40px; }
  .footer { padding: 0 14px; }
  .btn { min-height: 44px; }
}
