/* ==========================================================================
   QAYFIN — Financial & Accounting Services
   Palette: Deep Teal #2F5D6B · Midnight Teal #1B3A44 · Signature Gold #C9A227 · White · Mist Grey
   Bilingual EN / AR. Logical properties throughout — one sheet serves LTR+RTL.
   ========================================================================== */

/* --- 1. VARIABLES ------------------------------------------------------- */
:root {
  /* Primary palette — Brand Guidelines, section 8 */
  --brand:      #2F5D6B;   /* Deep Teal — primary */
  --brand-deep: #1B3A44;   /* Midnight Teal — nav, footer, dark bands */
  --gold:       #C9A227;   /* Signature Gold — accent only, never body text on white */
  --white:      #FFFFFF;   /* Pure White */
  --mist-grey:  #F4F6F7;   /* Mist Grey — section backgrounds */
  --graphite:   #4A4A4A;   /* Graphite — body text */

  --rule:      #DDE3EB;
  --brand-tint:#E8EDF4;
  --gold-tint: #FAF3DD;
  --ok:        #2E6B3E;
  --err:       #B03030;

  --font-latin: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-arabic: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, Arial, sans-serif;

  --max: 1180px;
  --gut: clamp(1.25rem, 4vw, 2.5rem);
  --sect: clamp(3.5rem, 8vw, 6rem);
  --radius: 4px;
  --ease: cubic-bezier(.22,.61,.36,1);
}

*, *::before, *::after { box-sizing: border-box; }

/* --- 2. RESET ----------------------------------------------------------- */
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration:.01ms !important; transition-duration:.01ms !important; }
}

body {
  margin: 0;
  font-family: var(--font-latin);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--graphite);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}
html[lang="ar"] body { font-family: var(--font-arabic); font-size: 1.0625rem; line-height: 1.75; }

img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: 3px; }
h1,h2,h3,h4 { color: var(--brand); margin: 0 0 .6em; font-weight: 600; line-height: 1.25; }
p { margin: 0 0 1em; }
ul { margin: 0; padding: 0; list-style: none; }

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

/* --- 3. LAYOUT ---------------------------------------------------------- */
.wrap { max-width: var(--max); margin-inline: auto; padding-inline: var(--gut); }
.section { padding-block: var(--sect); }
.section--tint { background: var(--mist-grey); }
.section--dark { background: var(--brand-deep); color: rgba(255,255,255,.86); }
.section--dark h2, .section--dark h3 { color: var(--white); }

.skip {
  position: absolute; inset-block-start: -100px; inset-inline-start: 1rem;
  background: var(--gold); color: var(--brand-deep); padding: .6rem 1rem;
  font-weight: 600; z-index: 200; border-radius: 0 0 var(--radius) var(--radius);
  transition: inset-block-start .15s var(--ease);
}
.skip:focus { inset-block-start: 0; }

.eyebrow {
  font-size: .75rem; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: var(--gold); margin: 0 0 .75rem;
}
html[lang="ar"] .eyebrow { text-transform: none; letter-spacing: 0; font-size: .85rem; }

.lead { font-size: clamp(1rem,2.2vw,1.125rem); max-width: 62ch; }
.rule-gold { inline-size: 56px; block-size: 2px; background: var(--gold); border: 0; margin: 0 0 1.5rem; }
.section-head { max-width: 68ch; margin-block-end: 2.5rem; }
.section-head h2 { font-size: clamp(1.55rem,3.6vw,2rem); }

/* --- 4. HEADER ---------------------------------------------------------- */
.hdr {
  position: sticky; inset-block-start: 0; z-index: 100;
  background: rgba(255,255,255,.96); backdrop-filter: blur(8px);
  border-block-end: 1px solid var(--rule);
}
.hdr__in { display: flex; align-items: center; gap: 1rem; min-block-size: 68px; }
.brand { display: flex; align-items: baseline; gap: .5rem; text-decoration: none; margin-inline-end: auto; }
.brand__mark {
  font-family: var(--font-latin); font-weight: 700; font-size: 1.32rem;
  letter-spacing: -.02em; color: var(--brand);
}

.nav { display: flex; gap: 1.45rem; align-items: center; }
.nav a {
  font-size: .875rem; font-weight: 500; color: var(--graphite);
  text-decoration: none; padding-block: .4rem; position: relative;
}
.nav a::after {
  content: ""; position: absolute; inset-block-end: 0; inset-inline-start: 0;
  inline-size: 0; block-size: 2px; background: var(--gold); transition: inline-size .2s var(--ease);
}
.nav a:hover::after, .nav a:focus-visible::after { inline-size: 100%; }

.lang {
  border: 1px solid var(--rule); background: var(--white); color: var(--brand);
  font: 600 .8rem/1 var(--font-latin); padding: .55rem .8rem; border-radius: var(--radius);
  cursor: pointer; white-space: nowrap; transition: all .18s var(--ease);
}
.lang:hover { border-color: var(--gold); background: var(--gold-tint); }

.burger {
  display: none; background: none; border: 1px solid var(--rule);
  border-radius: var(--radius); padding: .5rem .6rem; cursor: pointer;
}
.burger span { display: block; inline-size: 20px; block-size: 2px; background: var(--brand); margin: 4px 0; }

/* --- 5. BUTTONS --------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font: 600 .9rem/1 var(--font-latin); padding: .95rem 1.6rem;
  border-radius: var(--radius); text-decoration: none; cursor: pointer;
  border: 1px solid transparent; transition: all .2s var(--ease);
}
html[lang="ar"] .btn { font-family: var(--font-arabic); }
.btn--gold { background: var(--gold); color: var(--brand-deep); }
.btn--gold:hover { background: #b8931f; transform: translateY(-1px); }
.btn--ghost { background: transparent; color: var(--white); border-color: rgba(255,255,255,.4); }
.btn--ghost:hover { border-color: var(--gold); color: var(--gold); }
.btn--brand { background: var(--brand); color: var(--white); }
.btn--brand:hover { background: var(--brand-deep); }
.btn--out { background: transparent; color: var(--brand); border-color: var(--rule); }
.btn--out:hover { border-color: var(--gold); background: var(--gold-tint); }
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; }

/* --- 6. HERO ------------------------------------------------------------ */
.hero {
  background: var(--brand-deep); color: rgba(255,255,255,.85);
  padding-block: clamp(4rem,11vw,7.5rem); position: relative; overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; inset-block-start: 0; inset-inline-end: 0;
  inline-size: 180px; block-size: 4px; background: var(--gold);
}
.hero h1 {
  color: var(--white); font-size: clamp(1.9rem,5.2vw,2.9rem);
  line-height: 1.15; letter-spacing: -.02em; max-width: 20ch;
}
.hero h1 .accent { color: var(--gold); }
.hero p { max-width: 58ch; font-size: clamp(1rem,2.3vw,1.14rem); }
.hero__cta { display: flex; flex-wrap: wrap; gap: .9rem; margin-block-start: 2rem; }
.hero__strip {
  margin-block-start: 3.25rem; padding-block-start: 1.75rem;
  border-block-start: 1px solid rgba(255,255,255,.16);
  display: flex; flex-wrap: wrap; gap: 2.25rem;
}
.hero__strip div { font-size: .82rem; color: rgba(255,255,255,.62); }
.hero__strip strong { display: block; color: var(--white); font-size: 1.05rem; font-weight: 600; margin-block-end: .15rem; }

/* --- 7. CARDS / GRIDS --------------------------------------------------- */
.grid { display: grid; gap: 1.25rem; }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(290px,1fr)); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(330px,1fr)); }

.card {
  background: var(--white); border: 1px solid var(--rule);
  border-radius: var(--radius); padding: 1.75rem;
  position: relative; transition: all .22s var(--ease);
}
.card::before {
  content: ""; position: absolute; inset-block-start: -1px; inset-inline-start: -1px;
  inline-size: 0; block-size: 3px; background: var(--gold); transition: inline-size .28s var(--ease);
}
.card:hover { border-color: #C3CFD3; box-shadow: 0 6px 22px rgba(27,58,68,.07); }
.card:hover::before { inline-size: 64px; }
.card__ico { color: var(--brand); margin-block-end: 1rem; }
.card h3 { font-size: 1.05rem; margin-block-end: .5rem; }
.card p { font-size: .92rem; margin: 0; }

/* --- 8. INDUSTRIES ------------------------------------------------------ */
.tags { display: flex; flex-wrap: wrap; gap: .6rem; }
.tag {
  border: 1px solid var(--rule); background: var(--white); color: var(--brand);
  padding: .6rem 1.1rem; border-radius: 999px; font-size: .875rem; font-weight: 500;
  transition: all .18s var(--ease);
}
.tag:hover { border-color: var(--gold); background: var(--gold-tint); }

/* --- 9. WHY ------------------------------------------------------------- */
.why { display: grid; gap: 0; grid-template-columns: repeat(auto-fit,minmax(280px,1fr)); }
.why__i { padding: 1.75rem; border-block-start: 2px solid var(--gold); background: rgba(255,255,255,.03); }
.why__i h3 { font-size: 1.02rem; }
.why__i p { font-size: .92rem; margin: 0; color: rgba(255,255,255,.78); }

/* --- 10. STEPS ---------------------------------------------------------- */
.steps { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit,minmax(180px,1fr)); position: relative; }
.step { position: relative; padding-block-start: 2.6rem; }
.step__n {
  position: absolute; inset-block-start: 0; inset-inline-start: 0;
  inline-size: 34px; block-size: 34px; border-radius: 50%;
  border: 2px solid var(--gold); color: var(--brand);
  display: grid; place-items: center; font-weight: 700; font-size: .82rem; background: var(--white);
}
.step h3 { font-size: .98rem; margin-block-end: .35rem; }
.step p { font-size: .875rem; margin: 0; }
.steps::before {
  content: ""; position: absolute; inset-block-start: 17px; inset-inline: 17px;
  block-size: 1px; background: var(--rule); z-index: -1;
}
@media (max-width: 780px) { .steps::before { display: none; } }

/* --- 12. FORM ----------------------------------------------------------- */
.form { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fit,minmax(240px,1fr)); }
.field { display: flex; flex-direction: column; gap: .4rem; }
.field--full { grid-column: 1 / -1; }
.field label { font-size: .82rem; font-weight: 600; color: var(--brand); }
.field .req { color: var(--err); }
.field input, .field select, .field textarea {
  font: inherit; font-size: .92rem; color: var(--graphite);
  padding: .8rem .9rem; border: 1px solid var(--rule); border-radius: var(--radius);
  background: var(--white); inline-size: 100%; transition: border-color .18s var(--ease);
}
.field textarea { min-block-size: 130px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brand); }
.field input[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-color: var(--err); }
.field .err { font-size: .78rem; color: var(--err); min-block-size: 1em; }

.checks { display: flex; flex-wrap: wrap; gap: .55rem; }
.check {
  display: inline-flex; align-items: center; gap: .45rem; cursor: pointer;
  border: 1px solid var(--rule); border-radius: 999px; padding: .5rem .9rem; font-size: .84rem;
}
.check:hover { border-color: var(--gold); }
.check input { inline-size: auto; accent-color: var(--brand); }

.consent { display: flex; gap: .6rem; align-items: flex-start; font-size: .84rem; }
.consent input { inline-size: auto; margin-block-start: .25rem; accent-color: var(--brand); }

.hp { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); }

.alert { padding: 1rem 1.15rem; border-radius: var(--radius); font-size: .9rem; margin-block-start: 1rem; }
.alert--ok  { background: #E7F2EA; border: 1px solid #BBD9C4; color: var(--ok); }
.alert--err { background: #FBE9E7; border: 1px solid #EFC4BE; color: var(--err); }
.alert[hidden] { display: none; }

/* --- 13. CONTACT -------------------------------------------------------- */
.cinfo { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit,minmax(250px,1fr)); }
.cinfo__i { border-inline-start: 2px solid var(--gold); padding-inline-start: 1.1rem; }
.cinfo__i h3 { font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; color: var(--gold); }
html[lang="ar"] .cinfo__i h3 { text-transform: none; letter-spacing: 0; }
.cinfo__i p, .cinfo__i a { font-size: .92rem; color: var(--graphite); text-decoration: none; }
.cinfo__i a:hover { color: var(--brand); text-decoration: underline; }

/* --- 14. FOOTER --------------------------------------------------------- */
.ftr { background: var(--brand-deep); color: rgba(255,255,255,.62); padding-block: 3.5rem 1.75rem; font-size: .86rem; }
.ftr__g { display: grid; gap: 2rem; grid-template-columns: 1.4fr 1fr 1fr; }
@media (max-width: 760px) { .ftr__g { grid-template-columns: 1fr; } }
.ftr h4 { color: var(--white); font-size: .78rem; text-transform: uppercase; letter-spacing: .07em; margin-block-end: .9rem; }
html[lang="ar"] .ftr h4 { text-transform: none; letter-spacing: 0; }
.ftr a { color: rgba(255,255,255,.72); text-decoration: none; }
.ftr a:hover { color: var(--gold); }
.ftr__brand .brand__mark { color: var(--white); }
.ftr__tag { color: var(--gold); font-size: .84rem; margin-block-start: .5rem; }
.ftr__ar { font-family: var(--font-arabic); color: rgba(255,255,255,.5); font-size: .8rem; }
.ftr__bot {
  margin-block-start: 2.5rem; padding-block-start: 1.25rem;
  border-block-start: 1px solid rgba(255,255,255,.12);
  display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; font-size: .78rem;
}
.ftr li { margin-block-end: .45rem; }

/* --- 15. MISC ----------------------------------------------------------- */
.legal { max-width: 78ch; }
.legal h2 { font-size: 1.25rem; margin-block-start: 2rem; }
.legal h1 { font-size: clamp(1.6rem,4vw,2.1rem); }
.note { font-size: .8rem; color: #6C7C84; }
.reveal { opacity: 0; transform: translateY(8px); transition: opacity .5s var(--ease), transform .5s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }

/* --- 16. RESPONSIVE ----------------------------------------------------- */
@media (max-width: 900px) {
  .burger { display: block; }
  .nav {
    position: fixed; inset-block-start: 68px; inset-inline: 0;
    background: var(--white); flex-direction: column; align-items: stretch;
    gap: 0; padding: .5rem var(--gut) 1.5rem; border-block-end: 1px solid var(--rule);
    box-shadow: 0 12px 24px rgba(27,58,68,.09); display: none;
  }
  .nav[data-open="true"] { display: flex; }
  .nav a { padding-block: .85rem; border-block-end: 1px solid var(--mist-grey); }
  .nav a::after { display: none; }
}
@media (min-width: 901px) { .nav { display: flex !important; } }

@media print {
  .hdr, .burger, .lang, .hero__cta, form, .ftr__bot { display: none !important; }
  body { color: #000; }
  .section { padding-block: 1.5rem; }
}


/* --- 17. CALL TO ACTION BAND -------------------------------------------- */
.cta {
  background: var(--brand-deep);
  color: var(--white);
  padding-block: clamp(3rem, 6vw, 4.5rem);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.cta::before {
  content: "";
  position: absolute;
  inset-block-start: 0;
  inset-inline: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.cta h2 {
  color: var(--white);
  font-size: clamp(1.5rem, 3.6vw, 2.15rem);
  margin: 0 0 .75rem;
  letter-spacing: -.02em;
}
.cta p {
  color: #C6D2E0;
  max-width: 56ch;
  margin: 0 auto 1.75rem;
}
.cta__row {
  display: flex;
  gap: .85rem;
  justify-content: center;
  flex-wrap: wrap;
}
.cta .btn--gold { background: var(--gold); color: var(--brand-deep); border-color: var(--gold); }
.cta .btn--gold:hover { background: #E4C255; border-color: #E4C255; }
.cta .btn--ghost { border-color: rgba(255,255,255,.45); color: var(--white); }
.cta .btn--ghost:hover { background: rgba(255,255,255,.1); border-color: var(--white); }
