/* ============================================================
   UAE Tax Calculator — design system
   Palette: paper #F6F7F4 · ink #0E2A2B · teal #0F4C4E
            gold #B98A2F · band0 #CFE0DD · line #DCE0D9
   Type:    Bricolage Grotesque (display) · IBM Plex Sans (body)
            IBM Plex Mono (figures) · IBM Plex Sans Arabic (AR)
   ============================================================ */

:root {
  --paper: #F6F7F4;
  --ink: #0E2A2B;
  --teal: #0F4C4E;
  --teal-soft: #CFE0DD;
  --gold: #B98A2F;
  --gold-soft: #F0E5CE;
  --line: #DCE0D9;
  --muted: #5C6B66;
  --danger: #A4442C;
  --radius: 14px;
  --font-display: "Bricolage Grotesque", "IBM Plex Sans", sans-serif;
  --font-body: "IBM Plex Sans", "IBM Plex Sans Arabic", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --maxw: 1080px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

[dir="rtl"] body, body[dir="rtl"] { font-family: "IBM Plex Sans Arabic", var(--font-body); }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.brand {
  font-family: var(--font-display);
  font-weight: 700; font-size: 1.05rem; letter-spacing: -0.01em;
  color: var(--ink); text-decoration: none;
  display: flex; align-items: center; gap: 10px;
}
.brand .mark {
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--teal); color: #fff;
  display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 13px; font-weight: 600;
}
.nav { display: flex; gap: 22px; align-items: center; }
.nav a {
  color: var(--muted); text-decoration: none; font-size: 0.92rem;
  transition: color .15s;
}
.nav a:hover, .nav a:focus-visible { color: var(--ink); }
.nav a.active { color: var(--teal); font-weight: 600; }
.lang-toggle {
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 5px 14px; font-family: var(--font-mono); font-size: 0.8rem;
  cursor: pointer; color: var(--ink); transition: border-color .15s;
}
.lang-toggle:hover { border-color: var(--teal); }

@media (max-width: 700px) {
  .site-header .wrap { height: auto; flex-wrap: wrap; padding-block: 10px; row-gap: 4px; }
  .brand { flex-shrink: 0; order: 1; }
  .lang-selector { order: 2; margin-left: auto; }
  .nav {
    order: 3; min-width: 0;
    flex: 1 1 100%; overflow-x: auto; gap: 18px; padding-bottom: 6px;
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { white-space: nowrap; font-size: 0.85rem; }
  .lang-selector { flex-shrink: 0; }
  .lang-name { display: none; }
  .hero { padding-top: 44px; }
}

/* ---------- hero ---------- */
.hero { padding: 72px 0 24px; position: relative; overflow: hidden; }
.hero-pattern {
  position: absolute; inset-block: 0; inset-inline-end: -60px;
  width: min(46vw, 620px); pointer-events: none; opacity: 0.5;
  -webkit-mask-image: linear-gradient(to left, #000 55%, transparent);
  mask-image: linear-gradient(to left, #000 55%, transparent);
}
[dir="rtl"] .hero-pattern {
  -webkit-mask-image: linear-gradient(to right, #000 55%, transparent);
  mask-image: linear-gradient(to right, #000 55%, transparent);
}
.hero .wrap { position: relative; z-index: 1; }
@media (max-width: 860px) { .hero-pattern { display: none; } }
.eyebrow {
  font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--gold);
  display: flex; align-items: center; gap: 10px;
}
.eyebrow::before { content: ""; width: 26px; height: 1px; background: var(--gold); }
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5.4vw, 3.6rem);
  line-height: 1.06; letter-spacing: -0.025em; font-weight: 700;
  margin: 18px 0 14px; max-width: 17ch;
}
.hero h1 .nine { color: var(--teal); }
.hero .lede { color: var(--muted); max-width: 58ch; font-size: 1.06rem; }

/* ---------- calculator card ---------- */
.calc-card {
  margin: 44px 0 0; background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 24px 60px -36px rgba(14, 42, 43, 0.35);
  overflow: hidden;
}
.calc-grid { display: grid; grid-template-columns: 1fr 1fr; }
@media (max-width: 860px) { .calc-grid { grid-template-columns: 1fr; } }

.calc-inputs { padding: 36px; border-inline-end: 1px solid var(--line); }
@media (max-width: 860px) { .calc-inputs { border-inline-end: none; border-bottom: 1px solid var(--line); } }

.field { margin-bottom: 22px; }
.field label {
  display: block; font-size: 0.88rem; font-weight: 600; margin-bottom: 8px;
}
.field .hint { font-size: 0.8rem; color: var(--muted); font-weight: 400; margin-top: 6px; }
.money-input {
  display: flex; align-items: center; gap: 10px;
  border: 1.5px solid var(--line); border-radius: 10px; padding: 12px 16px;
  background: var(--paper); transition: border-color .15s, box-shadow .15s;
}
.money-input:focus-within {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--teal) 12%, transparent);
}
.money-input .cur { font-family: var(--font-mono); font-size: 0.85rem; color: var(--muted); }
.money-input input {
  border: 0; outline: 0; background: transparent; width: 100%;
  font-family: var(--font-mono); font-size: 1.35rem; color: var(--ink);
}

.switch-row {
  display: flex; align-items: flex-start; gap: 12px; padding: 13px 14px;
  border: 1px solid var(--line); border-radius: 10px; margin-bottom: 12px;
  cursor: pointer; transition: border-color .15s, background .15s;
}
.switch-row:hover { border-color: var(--teal); }
.switch-row input { accent-color: var(--teal); margin-top: 4px; width: 16px; height: 16px; flex: none; }
.switch-row .sw-label { font-size: 0.9rem; font-weight: 600; }
.switch-row .sw-sub { font-size: 0.8rem; color: var(--muted); }

.calc-result { padding: 36px; background: linear-gradient(180deg, #fff 0%, #F4F6F2 100%); }
.result-label {
  font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--muted);
}
.result-figure {
  font-family: var(--font-mono); font-weight: 600;
  font-size: clamp(2.4rem, 6vw, 3.4rem); letter-spacing: -0.02em;
  color: var(--teal); margin: 6px 0 2px; font-variant-numeric: tabular-nums;
}
.result-figure .cur { font-size: 0.45em; color: var(--muted); font-weight: 500; }
.result-note { font-size: 0.85rem; color: var(--muted); min-height: 3.2em; }
.result-note strong { color: var(--gold); }

.breakdown { margin-top: 22px; border-top: 1px dashed var(--line); padding-top: 18px; }
.bk-row {
  display: flex; justify-content: space-between; gap: 12px;
  font-size: 0.9rem; padding: 5px 0; color: var(--muted);
}
.bk-row strong { color: var(--ink); font-family: var(--font-mono); font-weight: 500; }

/* ---------- the 375K line (signature) ---------- */
.threshold-viz { padding: 0 36px 34px; }
.tv-bar {
  position: relative; height: 46px; border-radius: 10px; overflow: hidden;
  background: repeating-linear-gradient(-45deg, #EAEEE8 0 8px, #F2F5F0 8px 16px);
  border: 1px solid var(--line);
}
.tv-zero, .tv-nine {
  position: absolute; inset-block: 0; transition: width .55s cubic-bezier(.22,.9,.35,1);
}
.tv-zero { inset-inline-start: 0; background: var(--teal-soft); }
.tv-nine { background: var(--teal); }
.tv-tick {
  position: absolute; inset-block: -6px; width: 2.5px; background: var(--gold);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 22%, transparent);
  z-index: 2;
}
.tv-legend {
  display: flex; justify-content: space-between; margin-top: 10px;
  font-family: var(--font-mono); font-size: 0.74rem; color: var(--muted);
}
.tv-legend .gold { color: var(--gold); font-weight: 600; }

/* ---------- sections ---------- */
section.band { padding: 84px 0; }
section.band.tinted { background: #EFF2ED; border-block: 1px solid var(--line); }
.sec-head { max-width: 640px; margin-bottom: 44px; }
.sec-head h2 {
  font-family: var(--font-display); font-size: clamp(1.6rem, 3.4vw, 2.3rem);
  letter-spacing: -0.02em; line-height: 1.15; margin: 14px 0 10px;
}
.sec-head p { color: var(--muted); }

.rule-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 860px) { .rule-cards { grid-template-columns: 1fr; } }
.rule-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px;
}
.rule-card .rate {
  font-family: var(--font-mono); font-size: 2rem; font-weight: 600; color: var(--teal);
}
.rule-card.gold .rate { color: var(--gold); }
.rule-card h3 { font-size: 1.02rem; margin: 8px 0 6px; font-family: var(--font-display); }
.rule-card p { font-size: 0.9rem; color: var(--muted); }

/* tool cards */
.tool-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 860px) { .tool-cards { grid-template-columns: 1fr; } }
.tool-card {
  display: block; text-decoration: none; color: inherit;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px; transition: transform .2s, box-shadow .2s, border-color .2s;
}
.tool-card:hover, .tool-card:focus-visible {
  transform: translateY(-3px); border-color: var(--teal);
  box-shadow: 0 18px 40px -28px rgba(15, 76, 78, 0.5);
}
.tool-card .tc-icon {
  font-family: var(--font-mono); color: var(--gold); font-size: 0.8rem;
  letter-spacing: 0.1em; text-transform: uppercase;
  display: flex; align-items: center; gap: 10px;
}
.tool-card .tc-icon svg { width: 26px; height: 26px; stroke: var(--teal); flex: none; }
.tool-card h3 { font-family: var(--font-display); font-size: 1.12rem; margin: 10px 0 6px; }
.tool-card p { font-size: 0.88rem; color: var(--muted); }
.tool-card .go {
  margin-top: 14px; font-size: 0.85rem; color: var(--teal); font-weight: 600;
  display: inline-block;
}

/* FAQ */
.faq { max-width: 760px; }
.faq details {
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 0 22px; margin-bottom: 10px;
}
.faq summary {
  cursor: pointer; font-weight: 600; font-size: 0.98rem; padding: 18px 0;
  list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 14px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; font-family: var(--font-mono); color: var(--gold);
  font-size: 1.15rem; transition: transform .2s; flex: none;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--muted); font-size: 0.92rem; padding-bottom: 18px; }

/* lead CTA */
.lead-cta {
  background: var(--teal); color: #fff; border-radius: 20px;
  padding: 48px; display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px;
  align-items: center;
}
@media (max-width: 860px) { .lead-cta { grid-template-columns: 1fr; padding: 32px; } }
.lead-cta h2 {
  font-family: var(--font-display); font-size: clamp(1.5rem, 3vw, 2rem);
  letter-spacing: -0.02em; line-height: 1.2; margin-bottom: 10px;
}
.lead-cta p { color: #CFE0DD; font-size: 0.95rem; }
.lead-form { display: grid; gap: 10px; }
.lead-form input, .lead-form select {
  border: 1px solid rgba(255,255,255,0.25); background: rgba(255,255,255,0.08);
  border-radius: 10px; padding: 12px 14px; color: #fff; font-size: 0.95rem;
  font-family: var(--font-body); outline: none; transition: border-color .15s;
}
.lead-form input::placeholder { color: #9FBDB9; }
.lead-form input:focus, .lead-form select:focus { border-color: var(--gold); }
.lead-form select { color: #CFE0DD; }
.lead-form button {
  background: var(--gold); color: #201500; font-weight: 700; border: 0;
  border-radius: 10px; padding: 13px; font-size: 0.98rem; cursor: pointer;
  font-family: var(--font-body); transition: filter .15s;
}
.lead-form button:hover { filter: brightness(1.08); }
.lead-form .form-note { font-size: 0.75rem; color: #9FBDB9; }
.lead-form .sent { color: var(--gold-soft); font-weight: 600; }

/* ---------- article / guide pages ---------- */
.article { max-width: 720px; padding: 64px 0 80px; }
.article h1 {
  font-family: var(--font-display); font-size: clamp(1.9rem, 4vw, 2.6rem);
  letter-spacing: -0.02em; line-height: 1.12; margin: 16px 0 18px;
}
.article h2 {
  font-family: var(--font-display); font-size: 1.4rem; margin: 40px 0 12px;
  letter-spacing: -0.01em;
}
.article p, .article li { color: #3C4A46; margin-bottom: 14px; }
.article ul, .article ol { padding-inline-start: 22px; margin-bottom: 14px; }
.article table {
  width: 100%; border-collapse: collapse; margin: 18px 0; font-size: 0.92rem;
}
.article th, .article td {
  text-align: start; padding: 10px 12px; border: 1px solid var(--line);
}
.article th { background: #EFF2ED; font-family: var(--font-mono); font-size: 0.8rem; }
.article .callout {
  border-inline-start: 3px solid var(--gold); background: var(--gold-soft);
  padding: 16px 20px; border-radius: 0 10px 10px 0; margin: 18px 0;
  font-size: 0.93rem;
}

/* ---------- news ---------- */
.news-list { max-width: 760px; }
.news-item {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 28px; margin-bottom: 16px;
}
.news-item .nw-date {
  font-family: var(--font-mono); font-size: 0.76rem; color: var(--gold);
  letter-spacing: 0.1em; text-transform: uppercase;
}
.news-item h3 { font-family: var(--font-display); font-size: 1.15rem; margin: 8px 0 8px; letter-spacing: -0.01em; }
.news-item p { font-size: 0.93rem; color: var(--muted); margin-bottom: 10px; }
.news-item .nw-src { font-size: 0.82rem; }
.news-item .nw-src a { color: var(--teal); font-weight: 600; text-decoration: none; }
.news-item .nw-src a:hover { text-decoration: underline; }
.news-item.pinned { border-inline-start: 3px solid var(--gold); }

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--line); padding: 44px 0 60px; margin-top: 40px;
  font-size: 0.85rem; color: var(--muted);
}
.foot-grid { display: flex; justify-content: space-between; gap: 30px; flex-wrap: wrap; }
.site-footer a { color: var(--muted); text-decoration: none; margin-inline-end: 18px; }
.site-footer a:hover { color: var(--ink); }
.disclaimer { margin-top: 18px; font-size: 0.78rem; max-width: 70ch; }

/* ---------- result actions ---------- */
.result-actions { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.action-btn {
  border: 0; border-radius: 10px; padding: 11px 18px; cursor: pointer;
  font-family: var(--font-body); font-size: 0.88rem; font-weight: 600;
  background: var(--teal); color: #fff; transition: filter .15s;
}
.action-btn:hover { filter: brightness(1.12); }
.action-btn.ghost {
  background: transparent; color: var(--teal); border: 1.5px solid var(--teal);
}
.action-btn.ghost:hover { background: color-mix(in srgb, var(--teal) 8%, transparent); }

/* ---------- deadline finder ---------- */
.deadline-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  display: grid; grid-template-columns: 1fr 1fr; overflow: hidden;
  box-shadow: 0 24px 60px -40px rgba(14,42,43,0.3);
}
@media (max-width: 700px) { .deadline-card { grid-template-columns: 1fr; } }
.dl-inputs { padding: 32px; border-inline-end: 1px solid var(--line); }
@media (max-width: 700px) { .dl-inputs { border-inline-end: none; border-bottom: 1px solid var(--line); } }
.dl-inputs label { font-weight: 600; font-size: 0.92rem; display: block; margin-bottom: 12px; }
.dl-selects { display: flex; gap: 10px; }
.dl-selects select {
  flex: 1; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 10px;
  background: var(--paper); font-family: var(--font-body); font-size: 1rem; color: var(--ink);
}
.dl-selects select:focus { border-color: var(--teal); outline: none; }
.dl-result { padding: 32px; background: linear-gradient(180deg,#fff, #F4F6F2); }
.dl-date {
  font-family: var(--font-mono); font-size: clamp(1.5rem, 3.4vw, 2.1rem);
  font-weight: 600; color: var(--teal); margin: 4px 0;
}
.dl-count { font-size: 0.88rem; color: var(--gold); font-family: var(--font-mono); }
.mono { font-family: var(--font-mono); }

/* ---------- section tabs (sub-nav within Business / Individuals) ---------- */
.section-tabs { border-bottom: 1px solid var(--line); background: #EFF2ED; }
.section-tabs .wrap { display: flex; gap: 4px; overflow-x: auto; padding-block: 10px; scrollbar-width: none; }
.section-tabs .wrap::-webkit-scrollbar { display: none; }
.section-tabs a {
  white-space: nowrap; font-size: 0.85rem; font-weight: 600; color: var(--muted);
  text-decoration: none; padding: 7px 14px; border-radius: 999px; transition: all .15s;
}
.section-tabs a:hover { color: var(--ink); background: #fff; }
.section-tabs a.active { color: #fff; background: var(--teal); }
.section-tabs .st-label {
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.08em;
  color: var(--gold); text-transform: uppercase; align-self: center; padding-inline-end: 6px; flex: none;
}

/* ---------- ad slot (Google Ads placeholders) ---------- */
.ad-slot {
  max-width: 760px; margin: 30px auto; padding: 18px; text-align: center;
  border: 1px dashed var(--line); border-radius: 12px; background: #F1F3EF;
}
.ad-slot .ad-label {
  font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--muted); display: block; margin-bottom: 8px;
}
.ad-slot.ad-wide { min-height: 90px; display: flex; flex-direction: column; align-items: center; justify-content: center; }

/* ---------- hub cards (For Business / For Individuals) ---------- */
.hub-hero { padding: 76px 0 40px; }
.hub-cats { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 22px; margin-top: 10px; }
@media (max-width: 1100px) { .hub-cats { grid-template-columns: 1fr 1fr; } }
@media (max-width: 780px) { .hub-cats { grid-template-columns: 1fr; } }
.hub-card {
  background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 34px;
  text-decoration: none; color: inherit; display: block; transition: transform .2s, box-shadow .2s;
}
.hub-card:hover { transform: translateY(-4px); box-shadow: 0 24px 50px -32px rgba(14,42,43,0.45); }
.hub-card .hc-emoji-mark {
  width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center;
  background: var(--teal); color: #fff; font-family: var(--font-mono); font-size: 1.1rem; font-weight: 700; margin-bottom: 16px;
}
.hub-card h3 { font-family: var(--font-display); font-size: 1.4rem; margin-bottom: 8px; letter-spacing: -0.01em; }
.hub-card p { color: var(--muted); font-size: 0.95rem; margin-bottom: 16px; }
.hub-card ul { list-style: none; }
.hub-card li {
  font-size: 0.88rem; padding: 7px 0; border-top: 1px dashed var(--line); color: var(--ink);
}
.hub-card li:first-child { border-top: 0; }

/* ---------- timeline ---------- */
.timeline { position: relative; max-width: 760px; padding-inline-start: 28px; }
.timeline::before {
  content: ""; position: absolute; inset-inline-start: 5px; top: 6px; bottom: 6px;
  width: 2px; background: var(--line);
}
.tl-item { position: relative; padding-bottom: 34px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: ""; position: absolute; inset-inline-start: -28px; top: 4px;
  width: 12px; height: 12px; border-radius: 50%; background: var(--teal); border: 3px solid var(--paper);
  box-shadow: 0 0 0 2px var(--teal);
}
.tl-item.tl-future::before { background: var(--gold); box-shadow: 0 0 0 2px var(--gold); }
.tl-date {
  font-family: var(--font-mono); font-size: 0.78rem; color: var(--gold); font-weight: 600;
  letter-spacing: 0.04em; text-transform: uppercase;
}
.tl-item h3 { font-family: var(--font-display); font-size: 1.08rem; margin: 4px 0 6px; }
.tl-item p { color: var(--muted); font-size: 0.9rem; }
.tl-item .tl-src { font-size: 0.8rem; margin-top: 6px; }
.tl-item .tl-src a { color: var(--teal); font-weight: 600; text-decoration: none; }

/* ---------- checklist (VAT filing help) ---------- */
.checklist { max-width: 760px; }
.checklist label {
  display: flex; align-items: flex-start; gap: 12px; padding: 13px 16px;
  border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px; background: #fff;
  cursor: pointer; transition: border-color .15s;
}
.checklist label:has(input:checked) { border-color: var(--teal); background: color-mix(in srgb, var(--teal) 5%, #fff); }
.checklist input { margin-top: 3px; accent-color: var(--teal); width: 16px; height: 16px; flex: none; }
.checklist .cl-title { font-weight: 600; font-size: 0.92rem; }
.checklist .cl-sub { font-size: 0.82rem; color: var(--muted); margin-top: 2px; }
.cl-progress { font-family: var(--font-mono); font-size: 0.85rem; color: var(--teal); margin-bottom: 14px; }

/* ---------- hijri converter ---------- */
.hijri-today {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 30px; text-align: center; max-width: 480px;
}
.hijri-today .hg-label { font-family: var(--font-mono); font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.hijri-today .hg-date { font-family: var(--font-display); font-size: 1.5rem; color: var(--teal); margin: 6px 0 18px; }
.hijri-conv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 22px; }
@media (max-width: 640px) { .hijri-conv-grid { grid-template-columns: 1fr; } }
.hijri-conv-grid select, .hijri-conv-grid input {
  width: 100%; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 8px;
  font-family: var(--font-body); font-size: 0.92rem; background: var(--paper);
}

/* ---------- estimate (P&L upload) ---------- */
.est-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
@media (max-width: 860px) { .est-grid { grid-template-columns: 1fr; } }
.dropzone {
  border: 2px dashed var(--teal); border-radius: var(--radius); background: #fff;
  padding: 44px 24px; text-align: center; cursor: pointer;
  transition: background .15s, border-color .15s;
}
.dropzone:hover, .dropzone.drag { background: color-mix(in srgb, var(--teal) 6%, #fff); }
.dropzone svg { width: 40px; height: 40px; stroke: var(--gold); margin-bottom: 10px; }
.dropzone p { color: var(--muted); font-size: 0.95rem; }
.dropzone p strong { color: var(--ink); }
.est-format { margin-top: 16px; font-size: 0.85rem; color: var(--muted); }
.est-format ol { padding-inline-start: 20px; margin-top: 6px; }
.est-format li { margin-bottom: 6px; }
.est-error { display: none; margin-top: 12px; padding: 12px 16px; border-radius: 10px;
  background: #F6E9E3; color: var(--danger); font-size: 0.88rem; }
.est-result { border: 1px solid var(--line); border-radius: var(--radius); }
.est-rows { margin-top: 26px; overflow-x: auto; }
.est-rows table { width: 100%; border-collapse: collapse; font-size: 0.85rem; background: #fff; }
.est-rows th, .est-rows td { text-align: start; padding: 8px 12px; border: 1px solid var(--line); }
.est-rows th { background: #EFF2ED; font-family: var(--font-mono); font-size: 0.72rem; }
.est-rows td.num { font-family: var(--font-mono); text-align: end; }
.est-rows .flag { color: var(--gold); font-size: 0.75rem; font-family: var(--font-mono); }

/* ---------- contract analyzer ---------- */
.ca-input {
  width: 100%; min-height: 260px; padding: 20px; border: 1.5px solid var(--line);
  border-radius: 12px; background: #fff; font-family: var(--font-body); font-size: 0.95rem;
  line-height: 1.6; resize: vertical;
}
.ca-input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 4px color-mix(in srgb, var(--teal) 12%, transparent); }
.ca-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 14px; flex-wrap: wrap; }
.ca-file-label {
  font-size: 0.85rem; color: var(--teal); font-weight: 600; cursor: pointer;
  border: 1.5px dashed var(--teal); padding: 9px 16px; border-radius: 999px;
}
.ca-counts { display: flex; gap: 10px; margin: 20px 0; flex-wrap: wrap; }
.ca-count { font-family: var(--font-mono); font-size: 0.82rem; padding: 7px 14px; border-radius: 999px; font-weight: 600; }
.ca-count.ca-red { background: #F6E9E3; color: var(--danger); }
.ca-count.ca-amber { background: var(--gold-soft); color: #8A6414; }
.ca-count.ca-green { background: #E7F0EC; color: var(--teal); }
.ca-section { margin-bottom: 22px; border-radius: 14px; padding: 22px 26px; }
.ca-section h3 { font-family: var(--font-display); font-size: 1.05rem; margin-bottom: 12px; }
.ca-section ul { padding-inline-start: 20px; }
.ca-section li { font-size: 0.92rem; margin-bottom: 10px; line-height: 1.55; }
.ca-section.ca-red { background: #FBF1EE; border: 1px solid #EAC8BC; }
.ca-section.ca-amber { background: #FBF6E9; border: 1px solid #EBDCA0; }
.ca-section.ca-green { background: #EEF4F1; border: 1px solid #C9DFD5; }

/* ---------- gov directory ---------- */
.gov-list { display: grid; gap: 14px; }
.gov-item {
  background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 22px 26px;
  display: grid; grid-template-columns: auto 1fr auto; gap: 20px; align-items: center;
}
@media (max-width: 700px) { .gov-item { grid-template-columns: 1fr; text-align: start; } }
.gov-item .gov-mark {
  width: 44px; height: 44px; border-radius: 10px; background: var(--teal-soft); color: var(--teal);
  display: grid; place-items: center; font-family: var(--font-mono); font-weight: 700; font-size: 0.78rem;
}
.gov-item h3 { font-family: var(--font-display); font-size: 1.05rem; margin-bottom: 2px; }
.gov-item p { font-size: 0.86rem; color: var(--muted); }
.gov-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.gov-actions a {
  font-size: 0.82rem; font-weight: 600; color: var(--teal); text-decoration: none;
  border: 1px solid var(--line); padding: 7px 13px; border-radius: 999px; white-space: nowrap;
}
.gov-actions a:hover { border-color: var(--teal); background: color-mix(in srgb, var(--teal) 6%, #fff); }

/* ---------- ask / KB search ---------- */
.ask-box { max-width: 760px; }
.ask-input-wrap {
  display: flex; align-items: center; gap: 12px; background: #fff;
  border: 1.5px solid var(--line); border-radius: 14px; padding: 16px 20px;
  box-shadow: 0 20px 50px -36px rgba(14,42,43,0.4);
  transition: border-color .15s, box-shadow .15s;
}
.ask-input-wrap:focus-within { border-color: var(--teal); box-shadow: 0 0 0 4px color-mix(in srgb, var(--teal) 12%, transparent); }
.ask-input-wrap svg { width: 22px; height: 22px; stroke: var(--gold); flex: none; }
.ask-input-wrap input {
  border: 0; outline: 0; width: 100%; font-family: var(--font-body);
  font-size: 1.05rem; color: var(--ink); background: transparent;
}
.ask-results { margin-top: 22px; }
.ask-results details {
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 0 22px; margin-bottom: 10px;
}
.ask-results summary {
  cursor: pointer; font-weight: 600; font-size: 0.98rem; padding: 16px 0;
  list-style: none; display: flex; justify-content: space-between; gap: 14px;
}
.ask-results summary::-webkit-details-marker { display: none; }
.ask-results summary::after { content: "+"; font-family: var(--font-mono); color: var(--gold); flex: none; }
.ask-results details[open] summary::after { transform: rotate(45deg); }
.ask-results details p { color: #3C4A46; font-size: 0.93rem; padding-bottom: 18px; }
.kb-more { display: block; margin-top: 8px; color: var(--teal); font-weight: 600; text-decoration: none; font-size: 0.88rem; }
.kb-more:hover { text-decoration: underline; }
.ask-empty {
  display: none; margin-top: 22px; padding: 22px; border: 1px dashed var(--gold);
  border-radius: 12px; background: var(--gold-soft); font-size: 0.95rem;
}

/* ---------- QFZP quiz ---------- */
.quiz-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 32px; max-width: 760px;
}
.qz-q { padding: 16px 0; border-bottom: 1px dashed var(--line); }
.qz-q:last-of-type { border-bottom: 0; }
.qz-q p { font-weight: 600; font-size: 0.95rem; margin-bottom: 10px; }
.qz-q .qz-sub { font-weight: 400; color: var(--muted); font-size: 0.82rem; margin-top: 2px; }
.qz-opts { display: flex; gap: 10px; }
.qz-opts label {
  flex: 1; text-align: center; padding: 10px; border: 1.5px solid var(--line);
  border-radius: 10px; cursor: pointer; font-size: 0.9rem; transition: all .15s;
}
.qz-opts input { position: absolute; opacity: 0; }
.qz-opts label:has(input:checked) {
  border-color: var(--teal); background: color-mix(in srgb, var(--teal) 8%, #fff);
  font-weight: 600;
}
.qz-opts label:has(input:focus-visible) { outline: 2px solid var(--gold); }
.qz-verdict {
  font-family: var(--font-display); font-size: 1.25rem; margin-top: 22px;
  padding: 18px 22px; border-radius: 12px; background: var(--paper);
  border: 1px solid var(--line);
}
.qz-verdict.pass { background: #E7F0EC; border-color: var(--teal); color: var(--teal); }
.qz-verdict.fail { background: #F6E9E3; border-color: var(--danger); color: var(--danger); }
.qz-why { margin-top: 14px; font-size: 0.92rem; color: var(--muted); }
.qz-why ul { padding-inline-start: 20px; }
.qz-why li { margin-bottom: 8px; }

/* ---------- print (PDF estimate) ---------- */
@media print {
  .site-header, .nav, .threshold-viz, .band, .site-footer, .result-actions, .lang-toggle { display: none !important; }
  .hero { padding: 0; }
  .hero h1 { font-size: 1.6rem; }
  .calc-card { box-shadow: none; border: 1.5px solid #000; }
  body::after {
    content: "Estimate generated by GulfTax — gulftax.ae · Based on Federal Decree-Law No. 47 of 2022. Not tax advice.";
    display: block; margin-top: 18px; font-size: 11px; color: #444;
  }
}

/* ---------- motion ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s ease, transform .7s cubic-bezier(.22,.9,.35,1); }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .08s; } .reveal.d2 { transition-delay: .16s; } .reveal.d3 { transition-delay: .24s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .tv-zero, .tv-nine { transition: none; }
}

:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ========== Active Navigation States ========== */
.nav a.active, .section-tabs a.active {
  color: var(--teal);
  font-weight: 600;
  border-bottom: 3px solid var(--teal);
  padding-bottom: 2px;
}

.section-tabs a.active {
  background: var(--teal);
  color: #fff;
  border-radius: 8px;
  padding: 8px 14px;
  border-bottom: none;
}

a.home-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-decoration: none;
  color: var(--ink);
  font-size: 0.9rem;
  transition: all 0.15s;
  margin-right: 14px;
}

a.home-btn:hover {
  border-color: var(--teal);
  color: var(--teal);
}

a.home-btn.active {
  background: var(--teal);
  color: #fff;
  border-color: var(--teal);
}

/* ===== Language selector (shared, moved from index inline) ===== */
/* Language Selector */
.lang-selector {
  position: relative;
  display: inline-block;
}

.lang-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
  font-family: var(--font-body);
  font-weight: 500;
}

.lang-btn:hover, .lang-btn:focus-visible {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--teal) 10%, transparent);
}

.lang-btn .lang-flag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--teal);
  min-width: 24px;
  text-align: center;
}

.lang-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(14, 42, 43, 0.15);
  min-width: 180px;
  z-index: 1000;
  overflow: hidden;
}

.lang-selector:hover .lang-menu,
.lang-btn:focus-visible ~ .lang-menu {
  display: block;
}

.lang-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  text-decoration: none;
  color: var(--ink);
  transition: background 0.1s, color 0.1s;
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
}

.lang-option:last-child {
  border-bottom: none;
}

.lang-option:hover {
  background: var(--teal-soft);
  color: var(--teal);
}

.lang-option .lang-flag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--teal);
  min-width: 28px;
  text-align: center;
}

[dir="rtl"] .lang-menu {
  right: auto;
  left: 0;
}

@media (max-width: 700px) {
  .lang-name { display: none; }
  .lang-selector { margin-left: auto; }
  .lang-menu { min-width: 160px; }
}

/* ===== Breathing room (Aug 2026) — global + Arabic-specific ===== */

/* Both languages: slightly airier */
body { line-height: 1.7; }
.hub-cats { gap: 28px; }
.hub-card p { line-height: 1.65; margin-bottom: 18px; }
.hub-card li { padding: 9px 0; }
.section-tabs .wrap { gap: 8px; padding-block: 12px; }
.section-tabs a { padding: 8px 16px; }
.article p, .article li { line-height: 1.75; margin-bottom: 16px; }
.article h2 { margin: 44px 0 14px; }

/* Arabic: taller lines, no negative tracking (it crushes Arabic ligatures),
   roomier nav/tabs/cards. !important needed to beat inline heading styles. */
[dir="rtl"] body { font-size: 17.5px; line-height: 1.9; }
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3, [dir="rtl"] h4,
[dir="rtl"] .brand, [dir="rtl"] .hub-card h3, [dir="rtl"] .news-item h3 {
  letter-spacing: 0 !important;
}
[dir="rtl"] h1 { line-height: 1.4 !important; }
[dir="rtl"] h2 { line-height: 1.5 !important; }
[dir="rtl"] h3 { line-height: 1.55; }
[dir="rtl"] .eyebrow, [dir="rtl"] .st-label, [dir="rtl"] .ad-label,
[dir="rtl"] .hg-label { letter-spacing: 0; }
[dir="rtl"] p, [dir="rtl"] li { line-height: 1.9; }
[dir="rtl"] .lede { line-height: 2; }
[dir="rtl"] .hint { line-height: 1.8; }
[dir="rtl"] .nav { gap: 26px; }
[dir="rtl"] .section-tabs a { padding: 9px 18px; }
[dir="rtl"] .hub-card { padding: 36px; }
[dir="rtl"] .hub-card p { line-height: 1.85; }
[dir="rtl"] .hub-card li { padding: 11px 0; }
[dir="rtl"] .article p, [dir="rtl"] .article li { margin-bottom: 18px; line-height: 1.95; }
[dir="rtl"] .article h2 { margin-top: 48px; }
[dir="rtl"] .article th, [dir="rtl"] .article td { line-height: 1.75; padding-block: 12px; }
[dir="rtl"] .calc-card label { line-height: 1.7; }

/* Arabic: mono font has no Arabic glyphs — labels fell back to system
   monospace and rendered disjointed. Use the Arabic face for text labels
   (figures/digits keep the mono font). */
[dir="rtl"] .eyebrow, [dir="rtl"] .st-label, [dir="rtl"] .result-label,
[dir="rtl"] .ad-label, [dir="rtl"] .hg-label, [dir="rtl"] .article th,
[dir="rtl"] .tl-date, [dir="rtl"] .news-item time {
  font-family: "IBM Plex Sans Arabic", var(--font-body);
  letter-spacing: 0;
}

/* ===== Vertical rhythm (Aug 2026) — space between eyebrow/title/lede/content ===== */
.hero h1, .hub-hero h1 { margin: 24px 0 22px; }
.hero .lede, .hub-hero .lede { margin-bottom: 14px; }
.hub-cats { margin-top: 52px; }
.calc-card { margin-top: 56px; }
.sec-head { margin-bottom: 52px; }
.sec-head h2 { margin: 16px 0 14px; }
.article h1 { margin: 22px 0 26px; }
.article h2 { margin: 58px 0 18px; }
.article h3 { margin: 38px 0 14px; }
.article table { margin: 26px 0 30px; }
.hub-card .hc-emoji-mark { margin-bottom: 20px; }
.hub-card h3 { margin-bottom: 12px; }

/* Arabic: even more generous — dense script needs extra separation */
[dir="rtl"] .hero h1, [dir="rtl"] .hub-hero h1 { margin: 30px 0 28px; }
[dir="rtl"] .hero .lede, [dir="rtl"] .hub-hero .lede { margin-bottom: 18px; }
[dir="rtl"] .hub-cats { margin-top: 60px; }
[dir="rtl"] .calc-card { margin-top: 64px; }
[dir="rtl"] .sec-head { margin-bottom: 58px; }
[dir="rtl"] .sec-head h2 { margin: 18px 0 16px; }
[dir="rtl"] .article h1 { margin: 26px 0 30px; }
[dir="rtl"] .article h2 { margin: 66px 0 20px; }
[dir="rtl"] .article h3 { margin: 44px 0 16px; }
[dir="rtl"] .hub-card .hc-emoji-mark { margin-bottom: 22px; }
[dir="rtl"] .hub-card h3 { margin-bottom: 14px; }
