/* NCDC Libya Port Health - traveller form */
@import url('/css/fonts.css');

:root {
  --brand: #8b1a1a; --brand-dk: #5e0f0f; --gold: #c9a84c; --gold-lt: #ead39a;
  --bg: #f7f3ee; --card: #fff; --ink: #1d1b19; --ink-2: #4a4540; --muted: #7a736b; --line: #e3dbd0; --line-2: #cfc4b6;
  --ok: #1b7a3d; --warn: #b7791f; --hi: #c2410c; --danger: #b91c1c; --focus: rgba(139, 26, 26, .18);
  --r: 12px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: 'Tajawal', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif; background: var(--bg); color: var(--ink); font-size: 16px; line-height: 1.55; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }

/* header */
.hdr { background: linear-gradient(135deg, var(--brand-dk), var(--brand) 65%, #a32424); color: #fff; }
.hdr-in { max-width: 860px; margin: 0 auto; padding: 18px 18px 12px; display: flex; gap: 14px; align-items: center; }
.logo { width: 68px; height: 68px; border-radius: 12px; background: #fff; object-fit: contain; padding: 4px; flex-shrink: 0; box-shadow: 0 3px 12px rgba(0,0,0,.25); }
.org { color: var(--gold-lt); font-weight: 700; font-size: .9rem; }
.hdr h1 { margin: 2px 0; font-size: clamp(1.2rem, 4.5vw, 1.6rem); font-weight: 800; line-height: 1.25; }
.unit { font-size: .85rem; opacity: .85; }
.langs { max-width: 860px; margin: 0 auto; padding: 0 18px 14px; display: flex; gap: 8px; flex-wrap: wrap; }
.langs button { background: transparent; border: 1px solid rgba(255,255,255,.45); color: #fff; border-radius: 999px; padding: 6px 16px; cursor: pointer; min-height: 38px; }
.langs button.on { background: var(--gold); border-color: var(--gold); color: var(--brand-dk); font-weight: 700; }

main { max-width: 860px; margin: 0 auto; padding: 18px 14px 40px; }
.loading { text-align: center; padding: 60px 0; color: var(--muted); }
.assisted { background: #fff7e0; border: 1px solid var(--gold); color: #6b4e00; padding: 10px 14px; border-radius: var(--r); margin-bottom: 12px; font-weight: 700; }

/* mode switch */
.mode { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; background: #fff; padding: 6px; border-radius: 14px; border: 1px solid var(--line); }
.mode button { border: 0; background: transparent; padding: 12px 8px; border-radius: 10px; font-weight: 700; color: var(--muted); cursor: pointer; min-height: 52px; }
.mode button.on { background: var(--brand); color: #fff; box-shadow: 0 2px 10px rgba(139,26,26,.3); }
.mode .ico { display: inline-block; margin-inline-end: 4px; }
.intro { color: var(--ink-2); margin: 14px 2px 10px; }
.progress { height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; position: sticky; top: 0; z-index: 5; margin-bottom: 14px; }
.progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--gold), var(--brand)); transition: width .3s; }

/* cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 16px; margin-bottom: 14px; box-shadow: 0 1px 6px rgba(0,0,0,.03); }
.card h2 { margin: 0 0 14px; font-size: 1.1rem; display: flex; gap: 10px; align-items: center; color: var(--brand-dk); }
.num { width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: .95rem; flex-shrink: 0; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.grid .full { grid-column: 1 / -1; }
@media (max-width: 620px) { .grid { grid-template-columns: 1fr; } }
.muted { color: var(--muted); font-size: .92rem; margin: 0 0 12px; }
.center { text-align: center; }

/* fields */
.fld { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.fld > label { font-weight: 700; font-size: .95rem; color: var(--ink-2); }
.fld small { color: var(--muted); font-size: .82rem; }
.req { color: var(--danger); font-style: normal; }
input[type=text], input[type=tel], input[type=email], input[type=date], input[type=number], select {
  width: 100%; min-height: 48px; padding: 10px 12px; border: 1.5px solid var(--line-2); border-radius: 10px; background: #fff; transition: border-color .15s, box-shadow .15s;
}
select { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23777' stroke-width='1.6' fill='none'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }
[dir=rtl] select { background-position: left 12px center; padding-right: 12px; padding-left: 34px; }
input:focus, select:focus, button:focus-visible { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--focus); }
input[dir=ltr] { text-align: left; }
[dir=rtl] input[dir=ltr]::placeholder { text-align: right; }
.dob { display: grid; grid-template-columns: 1fr 1.4fr 1.1fr; gap: 6px; }
.sign { font-style: italic; font-size: 1.1rem; }

/* segmented yes/no */
.seg { display: flex; gap: 8px; flex-wrap: wrap; }
.seg button { flex: 1 1 0; min-width: 84px; min-height: 48px; border: 1.5px solid var(--line-2); background: #fff; border-radius: 10px; cursor: pointer; font-weight: 700; color: var(--ink-2); }
.seg button.on { border-color: var(--brand); background: #fbeeee; color: var(--brand); }
.fld.q { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 10px; background: #fdfbf8; }
.fld.q > label { font-weight: 600; color: var(--ink); line-height: 1.5; }

/* symptoms */
.symgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.chip { display: flex; align-items: center; gap: 8px; border: 1.5px solid var(--line-2); border-radius: 10px; padding: 10px 12px; cursor: pointer; background: #fff; min-height: 48px; font-weight: 500; }
.chip input { width: 20px; height: 20px; accent-color: var(--brand); flex-shrink: 0; }
.chip:has(input:checked) { border-color: var(--brand); background: #fbeeee; }
.chip.none { grid-column: 1 / -1; justify-content: center; font-weight: 700; }
.chip.none:has(input:checked) { border-color: var(--ok); background: #eaf6ee; color: var(--ok); }

/* countries */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips:empty { display: none; }
.cchip { background: #f3ece2; border: 1px solid var(--line-2); border-radius: 999px; padding: 4px 6px 4px 12px; display: inline-flex; align-items: center; gap: 4px; font-weight: 600; }
[dir=rtl] .cchip { padding: 4px 12px 4px 6px; }
.cchip button { border: 0; background: #e2d6c6; border-radius: 50%; width: 26px; height: 26px; cursor: pointer; line-height: 1; font-size: 1.1rem; }

/* dependants */
.dep { border: 1.5px dashed var(--line-2); border-radius: var(--r); padding: 14px; margin-bottom: 12px; background: #fdfbf8; }
.dep .symgrid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.dep-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; color: var(--brand-dk); }

/* privacy & declaration */
.privacy { background: #f6f1ea; border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; font-size: .92rem; color: var(--ink-2); }
.privacy summary { cursor: pointer; font-weight: 700; color: var(--brand-dk); }
.check { display: flex !important; gap: 10px; align-items: flex-start; font-weight: 500 !important; color: var(--ink) !important; cursor: pointer; }
.check input { width: 22px; height: 22px; margin-top: 2px; accent-color: var(--brand); flex-shrink: 0; }

/* errors */
.fld.err input, .fld.err select, .fld.err .seg button, .fld.err .chip { border-color: var(--danger); }
.fld.err.q { border-color: var(--danger); background: #fff5f5; }
em.msg { color: var(--danger); font-style: normal; font-size: .85rem; font-weight: 600; }
.errbox { background: #fff1f1; border: 1px solid #f3b4b4; color: var(--danger); padding: 12px 14px; border-radius: 10px; margin-bottom: 12px; font-weight: 700; }

/* buttons */
.btn { border: 0; border-radius: 10px; padding: 12px 20px; font-weight: 700; cursor: pointer; min-height: 48px; }
.btn.primary { background: linear-gradient(135deg, var(--brand), var(--brand-dk)); color: #fff; box-shadow: 0 4px 16px rgba(139,26,26,.3); }
.btn.primary:disabled { opacity: .6; cursor: wait; }
.btn.ghost { background: #fff; border: 1.5px solid var(--line-2); color: var(--brand-dk); }
.btn.big { width: 100%; font-size: 1.1rem; min-height: 58px; }
.link { background: none; border: 0; color: var(--brand); text-decoration: underline; cursor: pointer; padding: 8px; font-weight: 600; }
.link.danger { color: var(--danger); }

/* confirmation */
.conf { background: #fff; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); box-shadow: 0 6px 30px rgba(0,0,0,.08); }
.conf-band { display: flex; gap: 14px; align-items: center; padding: 20px 18px; color: #fff; }
.conf-band h2 { margin: 2px 0 0; font-size: 1.3rem; line-height: 1.3; }
.conf-kicker { font-size: .88rem; opacity: .9; }
.conf-ico { width: 52px; height: 52px; border-radius: 50%; background: rgba(255,255,255,.22); display: inline-flex; align-items: center; justify-content: center; font-size: 1.7rem; font-weight: 800; flex-shrink: 0; }
.lvl-green .conf-band { background: var(--ok); } .lvl-amber .conf-band { background: var(--warn); }
.lvl-orange .conf-band { background: var(--hi); } .lvl-red .conf-band { background: var(--danger); }
.conf-desc { padding: 0 18px; font-size: 1.02rem; margin: 16px 0 6px; }
.conf-qr { text-align: center; padding: 10px 18px; }
.conf-qr canvas { width: 240px; height: 240px; image-rendering: pixelated; border: 1px solid var(--line); border-radius: 8px; }
.conf-ref { margin-top: 8px; }
.conf-ref span { display: block; color: var(--muted); font-size: .9rem; }
.conf-ref strong { font-size: 2rem; letter-spacing: 2px; font-family: 'Tajawal', ui-monospace, monospace; }
.badge { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: .85rem; font-weight: 700; }
.badge.sent { background: #eaf6ee; color: var(--ok); } .badge.pending { background: #fff4dd; color: #8a5a00; }
.conf-lines { margin: 8px 18px 0; padding: 12px 18px; background: #f8f4ee; border-radius: 10px; }
.conf-lines li { margin: 6px 0; }
.conf-hot { text-align: center; font-weight: 700; margin: 14px 0 0; }
.conf-hot a { color: var(--brand); font-size: 1.3rem; }
.conf-actions { display: flex; gap: 8px; flex-wrap: wrap; padding: 18px; justify-content: center; }
.conf-actions .btn { flex: 1 1 160px; }

.ftr { text-align: center; color: var(--muted); font-size: .82rem; padding: 18px; border-top: 1px solid var(--line); }

@media print {
  .hdr .langs, .ftr, .no-print, #form { display: none !important; }
  body { background: #fff; }
  .conf { box-shadow: none; border: 0; }
  .conf-band { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
