/* Kadwani forms: light, calm, Arabic-first. Tokens = the brand system (v2.1). */
@font-face { font-family: "Plex"; font-weight: 400; font-display: swap; src: url(fonts/ibm-plex-sans-arabic-arabic-400-normal.woff2) format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }
@font-face { font-family: "Plex"; font-weight: 500; font-display: swap; src: url(fonts/ibm-plex-sans-arabic-arabic-500-normal.woff2) format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }
@font-face { font-family: "Plex"; font-weight: 600; font-display: swap; src: url(fonts/ibm-plex-sans-arabic-arabic-600-normal.woff2) format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }
@font-face { font-family: "Plex"; font-weight: 700; font-display: swap; src: url(fonts/ibm-plex-sans-arabic-arabic-700-normal.woff2) format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }
@font-face { font-family: "Plex"; font-weight: 400; font-display: swap; src: url(fonts/ibm-plex-sans-arabic-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC; }
@font-face { font-family: "Plex"; font-weight: 500; font-display: swap; src: url(fonts/ibm-plex-sans-arabic-latin-500-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC; }
@font-face { font-family: "Plex"; font-weight: 600; font-display: swap; src: url(fonts/ibm-plex-sans-arabic-latin-600-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC; }
@font-face { font-family: "Plex"; font-weight: 700; font-display: swap; src: url(fonts/ibm-plex-sans-arabic-latin-700-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC; }
@font-face { font-family: "Markazi"; font-weight: 600; font-display: swap; src: url(fonts/markazi-text-arabic-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Markazi"; font-weight: 700; font-display: swap; src: url(fonts/markazi-text-arabic-700-normal.woff2) format("woff2"); }

:root {
  --surface: #FBF8F2; --raised: #FFFFFF; --sunken: #F4EEDF;
  --gold: #C5A663; --gold-strong: #B8975A; --gold-tint: #EFE4C6; --gold-text: #7A5F26;
  --ink: #1B2A47; --ink-muted: #5A6378; --line: #E6DCC4; --border: #CDBF9C;
  --success: #0F6B5E; --success-tint: #DDEFEA; --warning: #A2470A; --warning-tint: #FBEADB;
  --danger: #B3261E; --danger-tint: #FBE7E5;
  --r: 14px; --r-sm: 10px;
  --shadow: 0 1px 2px #1b2a470d, 0 8px 24px #1b2a470f;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --sans: "Plex", system-ui, sans-serif; --display: "Markazi", "Plex", serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }
body { margin: 0; background: var(--surface); color: var(--ink); font: 500 16px/1.7 var(--sans); }
button, input, select, textarea { font: inherit; color: inherit; }
.ltr { direction: ltr; text-align: left; }
.num { font-variant-numeric: tabular-nums; }

/* top bar: title at the start, logo at the end (like the PDF header) */
.bar { position: sticky; top: 0; z-index: 20; background: #fbf8f2e6; backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line); }
.bar__in { max-width: 860px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.bar__t { min-width: 0; }
.bar__k { display: block; font: 600 12px/1.4 var(--sans); color: var(--gold-text); }
.bar__h { display: block; font: 700 15px/1.5 var(--sans); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar__logo { height: 46px; width: auto; flex: none; }
.dev { display: inline-block; margin-inline-start: 6px; padding: 0 8px; border: 1px solid var(--warning); background: var(--warning-tint); color: var(--warning); font: 600 10.5px/1.6 var(--sans); border-radius: 999px; vertical-align: 1px; }
.progress { height: 3px; background: var(--line); }
.progress span { display: block; height: 100%; width: 0; background: var(--gold); transition: width .5s var(--ease); }

.wrap { max-width: 860px; margin: 0 auto; padding: 28px 20px 140px; }
.intro { padding: 12px 4px 20px; }
.intro h1 { margin: 0; font: 700 clamp(30px, 6vw, 42px)/1.25 var(--display); }
.intro p { margin: 8px 0 0; color: var(--ink-muted); font-size: 15.5px; }

/* sections = the PDF's numbered sections */
.sec { background: var(--raised); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 22px 20px 24px; margin-top: 18px; animation: rise .5s var(--ease) both; }
.sec__h { display: flex; align-items: baseline; gap: 12px; margin-bottom: 4px; }
.sec__no { flex: none; display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--gold-tint); color: var(--gold-text); font: 700 15px/1 var(--sans); transform: translateY(5px); transition: background .3s, color .3s; }
.sec.is-done .sec__no { background: var(--success-tint); color: var(--success); }
.sec__t { margin: 0; font: 700 26px/1.3 var(--display); }
.sec__hint { margin: 0 0 6px 42px; margin-inline: 42px 0; color: var(--ink-muted); font-size: 14px; }

.grid { display: grid; grid-template-columns: 1fr; gap: 16px 16px; margin-top: 16px; }
@media (min-width: 640px) { .grid { grid-template-columns: 1fr 1fr; } .f--full { grid-column: 1 / -1; } }
.f { min-width: 0; }
.f__l { display: flex; align-items: baseline; gap: 6px; margin-bottom: 6px; font: 600 14.5px/1.5 var(--sans); }
.f__req { color: var(--gold-text); }
.f__opt { color: var(--ink-muted); font-weight: 500; font-size: 12.5px; }
.f__h { margin: 6px 2px 0; font-size: 13px; color: var(--ink-muted); }
.f__e { margin: 6px 2px 0; font: 600 13px/1.5 var(--sans); color: var(--danger); display: none; }
.f.is-bad .f__e { display: block; }
.f.is-bad .in, .f.is-bad .phone, .f.is-bad .unit-in { border-color: var(--danger); background: #fffafa; }

.in { width: 100%; min-height: 50px; padding: 11px 14px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--raised); outline: none; transition: border-color .2s, box-shadow .2s; }
.in::placeholder { color: #9aa1b0; }
.in:focus, .phone:focus-within, .unit-in:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px #1b2a4714; }
textarea.in { min-height: 96px; resize: none; overflow: hidden; line-height: 1.8; field-sizing: content; }   /* grows with the text, no handle (like the website) */
select.in { appearance: none; padding-inline-end: 40px; background: var(--raised) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%235A6378' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat left 16px center; }
.unit-in { display: flex; align-items: center; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--raised); transition: border-color .2s, box-shadow .2s; }
.unit-in .in { border: 0; box-shadow: none !important; background: transparent; }
.unit-in__u { flex: none; padding-inline: 12px 16px; color: var(--ink-muted); font-weight: 600; font-size: 14px; white-space: nowrap; }
.words { margin: 6px 2px 0; font-size: 13px; color: var(--gold-text); font-weight: 600; min-height: 1em; }

/* phone, like the website: flag + code picker, hairline, then the number */
.phone { display: flex; align-items: stretch; min-height: 50px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--raised); transition: border-color .2s, box-shadow .2s; }
.phone__sep { width: 1px; margin: 12px 0; background: var(--line); flex: none; }
.phone__n, .phone__dial { min-width: 0; border: 0; outline: none; background: transparent; font-size: 17px; }
.phone__n { flex: 1; width: 0; padding: 0 16px; text-align: right; letter-spacing: .02em; }
.phone__dial { width: 76px; flex: none; text-align: center; }

/* country picker (phone code and nationality) */
.pick { display: flex; align-items: center; gap: 10px; cursor: pointer; text-align: start; }
.pick--bare { flex: none; border: 0; background: none; padding: 0 14px; font-weight: 700; border-radius: var(--r-sm); }
.pick--bare:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.pick.in { justify-content: flex-start; }
.pick__flag { font-size: 20px; line-height: 1; }
.pick__ph { color: #9aa1b0; }
.pick__chev { margin-inline-start: auto; color: var(--ink-muted); flex: none; }
.pick--bare .pick__chev { margin-inline-start: 2px; }
/* date window, like the ledger app's sheet */
.pick__cal { flex: none; margin-inline-start: auto; color: var(--gold-text); }
.sheet { position: fixed; inset: 0; z-index: 70; display: flex; align-items: flex-end; justify-content: center; }
.sheet__bg { position: absolute; inset: 0; background: #1b2a4766; animation: fade .2s both; }
.sheet__box { position: relative; width: 100%; max-height: 92dvh; display: flex; flex-direction: column; background: var(--surface); border-radius: 22px 22px 0 0; box-shadow: 0 -12px 40px #1b2a4733; outline: none; animation: up .32s var(--ease) both; }
@media (min-width: 768px) { .sheet { align-items: center; } .sheet__box { max-width: 460px; border-radius: 22px; animation: rise .3s var(--ease) both; } }
.sheet__h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.sheet__h h2 { margin: 0; font: 700 24px/1.3 var(--display); }
.sheet__x { width: 44px; height: 44px; border: 0; border-radius: 50%; background: none; font-size: 26px; line-height: 1; color: var(--ink-muted); cursor: pointer; }
.sheet__x:hover { background: var(--sunken); }
.sheet__b { overflow-y: auto; padding: 16px 20px max(20px, env(safe-area-inset-bottom)); }
.cal__h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cal__h p { margin: 0; font: 700 18px/1.4 var(--sans); }
.cal__nav { width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 50%; background: var(--raised); color: var(--ink); display: grid; place-items: center; cursor: pointer; }
.cal__nav:hover { border-color: var(--ink); }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.cal__w { padding: 4px 0; font: 700 12px/1.4 var(--sans); }
.cal__w.is-off { color: var(--ink-muted); }
.cal__d { width: 44px; height: 44px; margin: 0 auto; border: 0; border-radius: 50%; background: none; font: 500 16px/1 var(--sans); color: var(--ink); cursor: pointer; transition: background .15s; }
.cal__d:hover:not(:disabled):not(.is-pick) { background: var(--gold-tint); }
.cal__d.is-off { color: var(--ink-muted); }
.cal__d.is-out { color: #5a637866; }
.cal__d.is-today { font-weight: 700; color: var(--gold-text); box-shadow: inset 0 0 0 1px var(--gold); }
.cal__d.is-pick { background: var(--gold); color: var(--ink); font-weight: 700; }
.cal__d:disabled { opacity: .3; cursor: not-allowed; }
.cal__today { display: block; width: 100%; min-height: 44px; margin-top: 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--raised); font: 600 14px/1 var(--sans); color: var(--ink); cursor: pointer; }
@keyframes up { from { transform: translateY(100%); } }
.pop { position: fixed; z-index: 60; background: var(--raised); border: 1px solid var(--line); border-radius: var(--r); box-shadow: 0 18px 48px #1b2a4729; padding: 8px; animation: rise .2s var(--ease) both; }
.pop__q { min-height: 44px; }
.pop__l { list-style: none; margin: 6px 0 0; padding: 0; max-height: 260px; overflow: auto; }
.pop__l li { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 10px; border-radius: var(--r-sm); cursor: pointer; outline: none; }
.pop__l li:hover, .pop__l li:focus { background: var(--sunken); }
.pop__m { margin-inline-start: auto; color: var(--ink-muted); font-weight: 600; }
.pop__none { color: var(--ink-muted); cursor: default !important; }

/* documents: tick, then upload right under it */
.docs { display: grid; gap: 10px; }
.doc { border: 1px solid transparent; border-radius: var(--r-sm); transition: background .2s, border-color .2s; }
.doc .pill { width: 100%; border-radius: var(--r-sm); }
.doc.is-on { border-color: var(--line); background: #fffdf9; padding-bottom: 10px; }
.doc.is-on .pill { border-color: transparent; background: none; }
.up { padding: 0 14px; }
.up + .up { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.up__who { display: block; font: 600 14px/1.5 var(--sans); margin-bottom: 6px; }
.up__files { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; min-height: 36px; padding: 4px 6px 4px 12px; padding-inline: 12px 6px; border-radius: 999px; background: var(--success-tint); color: var(--success); font: 600 13px/1.4 var(--sans); }
.chip__n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 180px; }
.chip__s { color: #0f6b5eb3; font-weight: 500; }
.chip__x { width: 28px; height: 28px; border: 0; border-radius: 50%; background: #ffffffa6; color: var(--success); font-size: 18px; line-height: 1; cursor: pointer; }
.up__btn { position: relative; display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border: 1px dashed var(--border); border-radius: 999px; color: var(--ink); font: 600 14px/1 var(--sans); cursor: pointer; background: var(--raised); transition: border-color .2s; }
.up__btn:hover { border-color: var(--ink); }
.up__btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.up__btn:focus-within { outline: 2px solid var(--ink); outline-offset: 2px; }

/* choices: big calm pills */
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { position: relative; display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 10px 16px; border: 1px solid var(--border); border-radius: 999px; background: var(--raised); cursor: pointer; user-select: none; transition: border-color .2s, background .2s, transform .15s var(--ease); }
.pill:hover { border-color: var(--ink); }
.pill:active { transform: scale(.98); }
.pill input { position: absolute; opacity: 0; pointer-events: none; }
.pill__dot { flex: none; width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--border); display: grid; place-items: center; transition: all .2s; }
.pill--check .pill__dot { border-radius: 5px; }
.pill.is-on { border-color: var(--ink); background: #f7f4ec; }
.pill.is-on .pill__dot { border-color: var(--ink); background: var(--ink); box-shadow: inset 0 0 0 3px var(--raised); }
.pill--check.is-on .pill__dot { box-shadow: none; }
.pill--check.is-on .pill__dot::after { content: ""; width: 9px; height: 5px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: translateY(-1px) rotate(-45deg); }
.pill input:focus-visible + .pill__dot { outline: 2px solid var(--ink); outline-offset: 3px; }
.pills--stack { flex-direction: column; align-items: stretch; }
.pills--stack .pill { border-radius: var(--r-sm); }

/* "how many?" stepper */
.count { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; border-radius: var(--r-sm); background: var(--sunken); }
.count__q { font: 600 15px/1.5 var(--sans); }
.step { display: flex; align-items: center; gap: 4px; direction: ltr; }
.step button { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--border); background: var(--raised); font-size: 22px; line-height: 1; cursor: pointer; transition: transform .15s var(--ease), border-color .2s; }
.step button:hover:not(:disabled) { border-color: var(--ink); }
.step button:active:not(:disabled) { transform: scale(.92); }
.step button:disabled { opacity: .35; cursor: default; }
.step output { min-width: 44px; text-align: center; font: 700 22px/1 var(--sans); }

.items { display: grid; gap: 12px; margin-top: 12px; }
.item { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 14px 14px 16px; background: #fffdf9; animation: rise .4s var(--ease) both; }
.item__h { display: flex; align-items: center; gap: 10px; font: 700 15px/1.4 var(--sans); color: var(--gold-text); }
.item__h span { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 999px; background: var(--gold-tint); font-size: 13px; }
.item .grid { margin-top: 10px; }
.item--scalar { display: flex; gap: 12px; align-items: flex-start; padding: 0; border: 0; background: none; }
.item--scalar .item__h { padding-top: 13px; }
.item--scalar .f { flex: 1; }

/* computed summaries */
.calc { margin-top: 14px; padding: 12px 14px; border-radius: var(--r-sm); background: var(--sunken); font-size: 14px; }
.calc:empty { display: none; }
.calc b { font-weight: 700; }
.calc .ok { color: var(--success); font-weight: 600; }
.calc .warn { color: var(--warning); font-weight: 600; }
.calc table { width: 100%; border-collapse: collapse; }
.calc td { padding: 3px 0; }
.calc td:last-child { text-align: left; font-weight: 700; }
.note { margin: 12px 0 0; padding: 10px 14px; border-inline-start: 3px solid var(--gold); background: #fffbf0; font-size: 14px; color: var(--ink-muted); border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.reset { margin-top: 8px; border: 0; background: none; color: var(--gold-text); font: 600 13px/1.4 var(--sans); cursor: pointer; padding: 4px 2px; text-decoration: underline; text-underline-offset: 3px; }

/* bottom bar */
.dock { position: fixed; inset-inline: 0; bottom: 0; z-index: 20; background: #fbf8f2f0; backdrop-filter: saturate(1.4) blur(12px); border-top: 1px solid var(--line); padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); }
.dock__in { max-width: 860px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dock__s { font-size: 13.5px; color: var(--ink-muted); }
.dock__s b { color: var(--ink); }
.btn { min-height: 50px; padding: 0 26px; border: 0; border-radius: 999px; background: var(--gold); color: var(--ink); font: 700 16px/1 var(--sans); cursor: pointer; box-shadow: 0 1px 0 #ffffff80 inset, 0 2px 8px #b8975a40; transition: transform .15s var(--ease), background .2s; }
.btn:hover { background: var(--gold-strong); }
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .6; cursor: progress; }
.ghost { border: 0; background: none; color: var(--ink-muted); font: 600 13px/1 var(--sans); cursor: pointer; padding: 8px; }

/* result sheet */
.done { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 20px; background: #1b2a4733; animation: fade .3s both; }
.done__card { width: min(440px, 100%); background: var(--raised); border-radius: 20px; padding: 28px 24px 22px; text-align: center; box-shadow: 0 24px 60px #1b2a4733; animation: rise .45s var(--ease) both; }
.done__icon { width: 64px; height: 64px; margin: 0 auto 10px; border-radius: 50%; display: grid; place-items: center; background: var(--success-tint); color: var(--success); }
.done__card.is-err .done__icon { background: var(--warning-tint); color: var(--warning); }
.done h2 { margin: 0; font: 700 28px/1.3 var(--display); }
.done p { margin: 8px 0 18px; color: var(--ink-muted); }

/* home: the three forms */
.cards { display: grid; gap: 14px; margin-top: 18px; }
.card { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px; background: var(--raised); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); color: inherit; text-decoration: none; transition: transform .2s var(--ease), border-color .2s; animation: rise .5s var(--ease) both; }
.card:hover { transform: translateY(-2px); border-color: var(--gold); }
.card b { display: block; font: 700 24px/1.3 var(--display); }
.card span { color: var(--ink-muted); font-size: 14px; }
.card i { font-style: normal; font-size: 22px; color: var(--gold-text); }

@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
@keyframes fade { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } html { scroll-behavior: auto; } }
@media (max-width: 520px) { .bar__logo { height: 38px; } .sec { padding: 18px 14px 20px; } .sec__hint { margin-inline-start: 0; } .count { flex-direction: column; align-items: stretch; } .step { justify-content: center; } .dock__s { display: none; } .btn { flex: 1; } }
