/* =========================================================
   FINAXIL — UAE E-Invoicing learning/offering page
   Reuses tokens, nav, footer, buttons from styles.css
   ========================================================= */

.ei-main { padding-top: clamp(96px, 12vw, 132px); }
.icon { width: 1em; height: 1em; display: inline-block; }

/* ---------- shared "term" trigger (the dictionary clicker) ---------- */
.term {
  font: inherit; background: none; border: none; padding: 0; margin: 0; cursor: pointer;
  color: var(--accent); text-decoration: none;
  background-image: linear-gradient(to right, var(--brass) 50%, transparent 0);
  background-size: 4px 1px; background-repeat: repeat-x; background-position: 0 1.16em;
  transition: color 0.25s var(--ease);
}
.term:hover, .term.is-active { color: var(--brass); }

/* ---------- hero ---------- */
.ei-hero { padding-block: clamp(28px, 4vw, 56px) clamp(56px, 6vw, 88px); }
.ei-hero__grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: clamp(32px, 5vw, 72px); align-items: center; }
.ei-hero__title {
  font-family: var(--display); font-weight: 800; letter-spacing: -0.03em; line-height: 0.98;
  font-size: clamp(40px, 5.4vw, 72px); margin: 0 0 22px;
}
.ei-hero__title em { font-style: normal; color: var(--accent); }
.ei-hero__sub { font-size: clamp(16px, 1.2vw, 19px); color: var(--ink-soft); max-width: 46ch; margin: 0 0 30px; }
.ei-hero__cta { display: flex; gap: 14px; flex-wrap: wrap; }
.ei-hero__art { border-radius: 2px; overflow: hidden; }
.ei-hero__art img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 16/10; }

/* ---------- quick facts strip ---------- */
.ei-facts { background: var(--char-2); padding-block: 2px; }
.ei-facts__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--hairline-d); }
.ei-fact {
  background: var(--char-2); border: none; cursor: pointer; text-align: left;
  display: flex; flex-direction: column; gap: 8px; padding: clamp(20px, 2.6vw, 32px) clamp(18px, 2.6vw, 30px);
  color: var(--light); transition: background 0.3s var(--ease);
  background-image: none;
}
.ei-fact:hover { background: #1f1f27; }
.ei-fact__icon { color: var(--teal); width: 26px; height: 26px; }
.ei-fact__icon .icon { width: 100%; height: 100%; }
.ei-fact__label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--light-soft); }
.ei-fact__value { font-family: var(--display); font-weight: 700; font-size: clamp(18px, 1.7vw, 22px); }

/* ---------- section rhythm ---------- */
.ei-flow, .ei-timeline-section, .ei-who, .ei-scope, .ei-roadmap, .ei-glossary { padding-block: clamp(64px, 8vw, 116px); }
.ei-flow { border-bottom: 1px solid var(--hairline); }
.ei-timeline-section { border-bottom: 1px solid var(--hairline); }
.ei-who { border-bottom: 1px solid var(--hairline); }
.ei-scope { border-bottom: 1px solid var(--hairline); background: var(--paper-2); }
.ei-lede { font-size: clamp(15px, 1.05vw, 17px); color: var(--ink-soft); max-width: 56ch; margin: 0; }
.ei-caption { font-size: 14.5px; color: var(--ink-soft); margin-top: 22px; max-width: 70ch; }

/* ---------- flowchart (5-corner model) ---------- */
.flowchart { display: flex; align-items: stretch; gap: 0; flex-wrap: wrap; margin-top: clamp(20px, 3vw, 36px); }
.flowchart__node {
  flex: 1 1 150px; min-width: 130px; background: var(--paper-2); border: 1px solid var(--hairline);
  padding: 22px 16px; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center;
  font: inherit; color: var(--ink); cursor: default; background-image: none;
}
.flowchart__node--btn { cursor: pointer; transition: border-color 0.3s var(--ease), transform 0.3s var(--ease); }
.flowchart__node--btn:hover { border-color: var(--accent); transform: translateY(-3px); }
.flowchart__node--dark { background: var(--char-2); color: #fff; border-color: var(--char-2); }
.flowchart__icon { width: 30px; height: 30px; color: var(--accent); }
.flowchart__node--dark .flowchart__icon { color: var(--teal); }
.flowchart__icon .icon { width: 100%; height: 100%; }
.flowchart__label { font-size: 13.5px; line-height: 1.3; font-weight: 500; }
.flowchart__arrow { flex: 0 0 auto; display: flex; align-items: center; justify-content: center; width: 28px; color: var(--brass); font-size: 18px; }

.ei-flow__art { margin-top: clamp(40px, 5vw, 64px); max-width: 620px; }
.ei-flow__art img { width: 100%; border: 1px solid var(--hairline); }
.ei-flow__art figcaption { font-size: 13.5px; color: var(--ink-soft); margin-top: 12px; max-width: 52ch; }

/* ---------- key dates timeline ---------- */
.timeline { position: relative; margin-top: clamp(56px, 7vw, 88px); padding-bottom: clamp(96px, 10vw, 130px); }
.timeline__rail { position: absolute; left: 0; right: 0; top: 6px; height: 2px; background: var(--hairline-d, var(--hairline)); background: var(--ink); opacity: 0.15; }
.timeline__point {
  position: absolute; top: 0; left: var(--pos); transform: translateX(-50%);
  background: none; border: none; cursor: pointer; padding: 0; display: flex; flex-direction: column; align-items: center; gap: 10px;
  width: 150px; background-image: none; color: var(--ink); font: inherit;
}
.timeline__dot { width: 13px; height: 13px; border-radius: 50%; background: var(--accent); border: 3px solid var(--paper); box-shadow: 0 0 0 1px var(--accent); transition: transform 0.25s var(--ease); }
.timeline__dot--brass { background: var(--brass); box-shadow: 0 0 0 1px var(--brass); }
.timeline__point:hover .timeline__dot { transform: scale(1.25); }
.timeline__date { font-family: var(--mono); font-size: 12px; letter-spacing: 0.04em; font-weight: 500; margin-top: 8px; }
.timeline__what { font-size: 13px; color: var(--ink-soft); line-height: 1.3; }

/* ---------- who's affected ---------- */
.who-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--hairline); border-top: 2px solid var(--ink); margin-top: clamp(36px, 4vw, 56px); }
.who-card { background: var(--paper); padding: 30px 26px 34px; display: flex; flex-direction: column; gap: 10px; }
.who-card__icon { width: 32px; height: 32px; color: var(--accent); margin-bottom: 4px; }
.who-card__icon .icon { width: 100%; height: 100%; }
.who-card__tag { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--brass); margin: 0; }
.who-card__title { font-family: var(--display); font-weight: 700; font-size: 21px; margin: 0 0 6px; }
.who-card__list { display: flex; flex-direction: column; gap: 6px; font-size: 14.5px; color: var(--ink-soft); }
.who-card__list b { color: var(--ink); font-weight: 600; }

/* ---------- scope ---------- */
.scope-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--hairline); border: 1px solid var(--hairline); margin-top: clamp(36px, 4vw, 56px); }
.scope-col { background: var(--paper-2); padding: 28px 28px 32px; }
.scope-col__head { font-family: var(--display); font-weight: 700; font-size: 17px; display: flex; align-items: center; gap: 10px; margin: 0 0 18px; }
.scope-col--in .scope-col__head { color: var(--accent); }
.scope-col--out .scope-col__head { color: var(--ink-soft); }
.scope-col .icon { width: 18px; height: 18px; }
.scope-col ul { display: flex; flex-direction: column; gap: 12px; font-size: 14.5px; line-height: 1.45; }
.scope-col li { color: var(--ink-soft); }
.scope-col--in li { color: var(--ink); }

/* ---------- roadmap ---------- */
.roadmap { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: clamp(32px, 5vw, 64px); align-items: center; margin-top: clamp(36px, 4vw, 56px); }
.roadmap__art { width: 100%; border: 1px solid var(--hairline); }
.roadmap__steps { display: flex; flex-direction: column; gap: 26px; counter-reset: none; }
.roadmap__step { display: flex; gap: 18px; align-items: flex-start; }
.roadmap__icon { flex: none; width: 38px; height: 38px; border-radius: 50%; background: var(--char-2); color: var(--teal); display: grid; place-items: center; }
.roadmap__icon .icon { width: 18px; height: 18px; }
.roadmap__step h3 { font-family: var(--display); font-weight: 700; font-size: 17px; margin: 0 0 4px; }
.roadmap__step p { font-size: 14.5px; color: var(--ink-soft); margin: 0; max-width: 48ch; }
.roadmap__cta {
  margin-top: clamp(44px, 5vw, 68px); padding-top: clamp(32px, 4vw, 48px); border-top: 1px solid var(--hairline);
  display: flex; align-items: center; justify-content: space-between; gap: 28px; flex-wrap: wrap;
}
.roadmap__cta p { max-width: 56ch; color: var(--ink-soft); margin: 0; font-size: 15px; }

/* ---------- penalty callout ---------- */
.ei-penalty { padding-block: clamp(8px, 1vw, 16px) clamp(56px, 7vw, 96px); }
.ei-penalty__inner {
  background: var(--char-2); color: var(--light); border-left: 4px solid var(--brass);
  display: flex; gap: 22px; align-items: flex-start; padding: clamp(26px, 3vw, 38px) clamp(26px, 3vw, 42px);
}
.ei-penalty__icon { flex: none; width: 30px; height: 30px; color: var(--brass); }
.ei-penalty__icon .icon { width: 100%; height: 100%; }
.ei-penalty__head { font-family: var(--display); font-weight: 700; font-size: 18px; margin: 0 0 8px; }
.ei-penalty__inner p:last-child { color: var(--light-soft); font-size: 15px; line-height: 1.55; margin: 0; }
.ei-penalty .term { color: var(--teal); background-image: linear-gradient(to right, var(--teal) 50%, transparent 0); }

/* ---------- glossary chips ---------- */
.chips { display: flex; gap: 12px; flex-wrap: wrap; margin-top: clamp(28px, 3vw, 40px); }
.chip {
  font-family: var(--mono); font-size: 13px; letter-spacing: 0.02em; font-weight: 500;
  padding: 11px 20px; border: 1px solid var(--hairline); border-radius: 100px; background: var(--paper-2);
  color: var(--ink); background-image: none; transition: border-color 0.25s var(--ease), background 0.25s var(--ease);
}
.chip:hover { border-color: var(--accent); background: var(--paper); }

/* ---------- sources ---------- */
.ei-sources { padding-block: 0 clamp(60px, 7vw, 96px); }
.ei-sources__head { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--brass); margin: 0 0 10px; }
.ei-sources__body { font-size: 13.5px; line-height: 1.6; color: var(--ink-soft); max-width: 78ch; margin: 0; }

/* ---------- term popover (the dictionary) ---------- */
.term-pop {
  position: fixed; inset: 0; z-index: 1000; pointer-events: none; opacity: 0; transition: opacity 0.2s var(--ease);
}
.term-pop.is-open { pointer-events: auto; opacity: 1; }
.term-pop__card {
  position: absolute; width: min(360px, calc(100vw - 40px)); background: var(--char-2); color: var(--light);
  border: 1px solid var(--hairline-d); border-top: 3px solid var(--brass); padding: 22px 24px 24px;
  box-shadow: 0 30px 60px -20px rgba(0,0,0,0.45); transform: translateY(6px); transition: transform 0.25s var(--ease);
}
.term-pop.is-open .term-pop__card { transform: translateY(0); }
.term-pop__close { position: absolute; top: 10px; right: 12px; background: none; border: none; color: var(--light-soft); font-size: 22px; line-height: 1; cursor: pointer; font-family: var(--display); }
.term-pop__close:hover { color: #fff; }
.term-pop__title { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--teal); margin: 0 0 10px; padding-right: 20px; }
.term-pop__body { font-size: 14.5px; line-height: 1.55; color: var(--light-soft); margin: 0; }

/* backdrop layer to catch outside clicks (covers viewport, transparent) */
.term-pop::before { content: ""; position: absolute; inset: 0; }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .ei-hero__grid { grid-template-columns: 1fr; }
  .ei-hero__art { order: -1; }
  .ei-facts__grid { grid-template-columns: repeat(2, 1fr); }
  .flowchart { flex-direction: column; }
  .flowchart__arrow { transform: rotate(90deg); width: auto; height: 22px; }
  .who-grid { grid-template-columns: 1fr; }
  .scope-grid { grid-template-columns: 1fr; }
  .roadmap { grid-template-columns: 1fr; }
  .roadmap__art { order: -1; max-width: 480px; }
  .timeline__point { width: 110px; }
}
@media (max-width: 640px) {
  .ei-facts__grid { grid-template-columns: 1fr 1fr; }
  .timeline { overflow-x: auto; padding-bottom: 80px; }
  .timeline__rail { min-width: 760px; }
  .timeline__point { position: absolute; }
  .ei-penalty__inner { flex-direction: column; gap: 14px; }
  .roadmap__cta { flex-direction: column; align-items: flex-start; }
}
