/* ==========================================================================
   Financial Connect - Design System
   Brand palette drawn from the logo: deep navy, royal blue, teal, lime green
   ========================================================================== */

:root {
  /* Brand colors */
  --navy-950: #050D1A;
  --navy-900: #071426;
  --navy-800: #0B1F3A;
  --navy-700: #122B4E;
  --navy-600: #1A3A66;
  --blue: #1D5FA8;
  --blue-bright: #2D7DD2;
  --teal: #4FC4BC;
  --teal-light: #8ADCD6;
  --green: #A9C766;
  --green-light: #C6DD8F;
  --green-strong: #58752B;
  --danger: #C53F3F;
  --success: #2E9E6B;

  /* Light surfaces */
  --bg-light: #F4F7FB;
  --bg-light-2: #EAF0F7;
  --surface: #FFFFFF;
  --line: #DFE7F0;

  /* Text */
  --ink: #11243E;
  --body-text: #4A5B73;
  --muted: #607188;
  --on-dark: #E8EFF8;
  --on-dark-muted: #9FB2CC;

  /* Effects */
  --grad-accent: linear-gradient(120deg, var(--teal) 0%, var(--green) 100%);
  --grad-dark: linear-gradient(160deg, var(--navy-900) 0%, var(--navy-800) 55%, #0E2A52 100%);
  --shadow-sm: 0 1px 3px rgba(7, 20, 38, 0.08);
  --shadow-md: 0 8px 24px -8px rgba(7, 20, 38, 0.14);
  --shadow-lg: 0 24px 48px -16px rgba(7, 20, 38, 0.22);
  --ring: 0 0 0 3px rgba(79, 196, 188, 0.35);

  /* Type */
  --font-display: 'Sora', 'Inter', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-arabic: 'Tajawal', 'Inter', system-ui, sans-serif;

  /* Layout */
  --container: 72rem;
  --radius: 1rem;
  --radius-lg: 1.5rem;
  --header-h: 4.75rem;
  --site-chrome-h: 7.25rem;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --transition: 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

/* === Reset & base ====================================================== */
*, *::before, *::after { box-sizing: border-box; }

/* Components set their own display, which would otherwise defeat the
   hidden attribute (e.g. filtered .tool-card items). */
[hidden] { display: none !important; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--site-chrome-h) + 1rem);
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--body-text);
  background: var(--bg-light);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.ar { font-family: var(--font-arabic); }
body.ar h1, body.ar h2, body.ar h3, body.ar h4 { font-family: var(--font-arabic); }

body.zh,
body.zh h1, body.zh h2, body.zh h3, body.zh h4 {
  font-family: 'Inter', 'PingFang SC', 'Microsoft YaHei', 'Hiragino Sans GB', 'Noto Sans SC', system-ui, sans-serif;
}
body.zh h1, body.zh h2, body.zh h3, body.zh h4 { font-family: 'Sora', 'PingFang SC', 'Microsoft YaHei', 'Noto Sans SC', system-ui, sans-serif; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--ink);
  line-height: 1.2;
  margin: 0 0 0.75rem;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.section-sub, .lede, .hero-lede { text-wrap: pretty; }

p { margin: 0 0 1rem; }
img { max-width: 100%; display: block; }
a { color: var(--blue); text-decoration: none; }
ul, ol { margin: 0; padding: 0; }

:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; box-shadow: var(--ring); border-radius: 0.375rem; }

::selection { background: rgba(79, 196, 188, 0.3); }

.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

/* Accessibility */
.skip-link {
  position: absolute;
  top: -3rem;
  inset-inline-start: 1rem;
  background: var(--navy-900);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 0 0 0.5rem 0.5rem;
  z-index: 200;
  transition: top 0.2s;
}
.skip-link:focus-visible { top: 0; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* === Buttons ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 1.6rem;
  border-radius: 0.75rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.2;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease),
              background-color 0.25s, border-color 0.25s, color 0.25s;
  text-align: center;
}
.btn:active { transform: translateY(0) scale(0.98); }

.btn-accent {
  background: var(--grad-accent);
  color: var(--navy-950);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 8px 20px -6px rgba(79, 196, 188, 0.45);
}
.btn-accent:hover {
  transform: translateY(-2px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 14px 28px -8px rgba(79, 196, 188, 0.55);
}

.btn-ghost-dark {
  background: transparent;
  color: var(--on-dark);
  border-color: rgba(232, 239, 248, 0.35);
}
.btn-ghost-dark:hover {
  border-color: var(--teal);
  color: var(--teal-light);
  transform: translateY(-2px);
}

.btn-navy {
  background: var(--navy-800);
  color: #fff;
}
.btn-navy:hover {
  background: var(--navy-700);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-outline {
  background: var(--surface);
  color: var(--navy-800);
  border-color: var(--line);
}
.btn-outline:hover {
  border-color: var(--teal);
  color: var(--blue);
  transform: translateY(-2px);
}

/* Secondary CTA used by the generated tool pages */
.btn-secondary {
  background: var(--surface);
  color: var(--navy-800);
  border-color: var(--line);
  box-shadow: var(--shadow-sm);
}
.btn-secondary:hover {
  border-color: var(--teal);
  color: var(--blue);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-lg { padding: 1rem 2rem; font-size: 1rem; }
.btn-block { width: 100%; }

/* === Top bar ============================================================ */
.site-chrome {
  position: sticky;
  top: 0;
  z-index: 100;
  isolation: isolate;
}

.topbar {
  background: var(--navy-950);
  color: var(--on-dark-muted);
  font-size: 0.82rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.topbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 2.5rem;
  flex-wrap: wrap;
  padding-block: 0.35rem;
}
.topbar-tagline { display: inline-flex; align-items: center; gap: 0.5rem; }
.topbar-tagline::before {
  content: '';
  width: 0.5rem; height: 0.5rem;
  background: var(--green);
  border-radius: 2px;
  transform: rotate(45deg);
  flex-shrink: 0;
}
.topbar-links { display: flex; align-items: center; gap: 0.25rem; flex-wrap: wrap; }
.topbar-links a, .lang-toggle {
  color: var(--on-dark-muted);
  padding: 0.25rem 0.6rem;
  border-radius: 0.4rem;
  transition: color 0.2s, background-color 0.2s;
}
.topbar-links a:hover { color: var(--teal-light); background: rgba(255, 255, 255, 0.06); }
.topbar-phone { color: var(--teal-light) !important; font-weight: 600; border: 1px solid rgba(79, 196, 188, 0.3); border-radius: 0.4rem; }
.lang-toggle {
  background: rgba(79, 196, 188, 0.12);
  border: 1px solid rgba(79, 196, 188, 0.35);
  color: var(--teal-light);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  margin-inline-start: 0.4rem;
}
.lang-toggle:hover { background: rgba(79, 196, 188, 0.22); }
.lang-select {
  background: rgba(79, 196, 188, 0.12);
  border: 1px solid rgba(79, 196, 188, 0.35);
  color: var(--teal-light);
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  border-radius: 0.4rem;
  padding: 0.25rem 0.5rem;
  margin-inline-start: 0.4rem;
}
.lang-select:hover { background: rgba(79, 196, 188, 0.22); }
.lang-select:focus-visible { box-shadow: var(--ring); outline: none; }
.lang-select option { color: var(--ink); background: #fff; }

/* === Header ============================================================= */
.site-header {
  position: relative;
  background: rgba(7, 20, 38, 0.88);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  transition: box-shadow 0.3s;
}
.site-header.scrolled { box-shadow: 0 8px 30px rgba(5, 13, 26, 0.45); }

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: #fff;
  flex-shrink: 0;
}
.brand-mark { width: 2.4rem; height: auto; flex-shrink: 0; }
.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.15;
  color: #fff;
  white-space: nowrap;
}
.brand-tag {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal);
  font-weight: 600;
  white-space: nowrap;
}

.main-nav { display: flex; align-items: center; gap: 0.25rem; }
.main-nav a {
  color: var(--on-dark-muted);
  font-size: 0.92rem;
  font-weight: 500;
  padding: 0.5rem 0.8rem;
  border-radius: 0.5rem;
  transition: color 0.2s, background-color 0.2s;
  white-space: nowrap;
}
.main-nav a:hover, .main-nav a.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
}
.main-nav a.active { color: var(--teal-light); }

.header-cta { display: flex; align-items: center; gap: 0.75rem; }

.menu-toggle {
  display: none;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  border-radius: 0.6rem;
  padding: 0.5rem;
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s, color 0.2s;
}
.menu-toggle:hover { border-color: var(--teal); color: var(--teal-light); background: rgba(255, 255, 255, 0.06); }
.menu-toggle:active { background: rgba(255, 255, 255, 0.1); }
.menu-toggle svg { width: 1.4rem; height: 1.4rem; display: block; }

.mobile-nav {
  display: none;
  flex-direction: column;
  padding: 0.5rem 0 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.mobile-nav.open { display: flex; animation: navDrop 0.25s var(--ease); }
.mobile-nav a {
  color: var(--on-dark);
  padding: 0.8rem 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-weight: 500;
}
.mobile-nav a:hover { color: var(--teal-light); }

@keyframes navDrop {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* === Hero =============================================================== */
.hero {
  position: relative;
  background: var(--grad-dark);
  color: var(--on-dark);
  overflow: hidden;
}

/* Geometric diamond motif echoing the logo */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(ellipse 50% 60% at 85% 10%, rgba(79, 196, 188, 0.14), transparent 70%),
    radial-gradient(ellipse 40% 50% at 10% 90%, rgba(169, 199, 102, 0.10), transparent 70%);
  pointer-events: none;
}
.hero-pattern {
  position: absolute;
  inset: 0;
  opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72' viewBox='0 0 72 72'%3E%3Cpath d='M36 4 L68 36 L36 68 L4 36 Z' fill='none' stroke='rgba(141,176,221,0.07)' stroke-width='1.5'/%3E%3C/svg%3E");
  background-size: 72px 72px;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(180deg, rgba(0,0,0,0.9), transparent 85%);
  mask-image: linear-gradient(180deg, rgba(0,0,0,0.9), transparent 85%);
}

.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 3.5rem;
  align-items: center;
  padding-block: 5.5rem 6rem;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(79, 196, 188, 0.1);
  border: 1px solid rgba(79, 196, 188, 0.3);
  color: var(--teal-light);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  margin-bottom: 1.5rem;
}
.hero-eyebrow .dot {
  width: 0.5rem; height: 0.5rem;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 2.5s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(169, 199, 102, 0.5); }
  50% { box-shadow: 0 0 0 6px rgba(169, 199, 102, 0); }
}

.hero h1 {
  color: #fff;
  font-size: clamp(2.2rem, 4.5vw, 3.4rem);
  font-weight: 800;
  margin-bottom: 1.25rem;
}
.hero h1 .accent {
  background: var(--grad-accent);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.hero-subtitle {
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--on-dark);
  margin-bottom: 1rem;
}
.hero-lede {
  font-size: 1rem;
  color: var(--on-dark-muted);
  max-width: 36rem;
  margin-bottom: 2rem;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-bottom: 2.25rem; }

.hero-badges { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--on-dark-muted);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  transition: border-color 0.25s, color 0.25s;
}
.chip:hover { border-color: var(--teal); color: var(--on-dark); }
.chip::before { content: '✓'; color: var(--green); font-weight: 700; }

/* Hero panel (right column) */
.hero-panel {
  position: relative;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(10px);
  padding: 1.75rem;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.hero-panel::before {
  content: '';
  position: absolute;
  top: 0;
  inset-inline: 0;
  height: 3px;
  background: var(--grad-accent);
}
.hero-panel-brand {
  border-radius: 0.9rem;
  overflow: hidden;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.hero-panel-brand img { width: 100%; height: auto; }

.hero-lists { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.hero-list-title {
  color: var(--teal-light);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.75rem;
}
.hero-list ul { list-style: none; display: grid; gap: 0.5rem; }
.hero-list li {
  position: relative;
  font-size: 0.85rem;
  color: var(--on-dark-muted);
  padding-inline-start: 1.1rem;
}
.hero-list li::before {
  content: '';
  position: absolute;
  inset-inline-start: 0;
  top: 0.5em;
  width: 0.4rem; height: 0.4rem;
  background: var(--green);
  transform: rotate(45deg);
}
.hero-panel-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1.25rem;
  color: var(--teal-light);
  font-weight: 600;
  font-size: 0.9rem;
  transition: gap 0.25s var(--ease);
}
.hero-panel-link:hover { gap: 0.7rem; }

/* === Stats band ========================================================= */
.stats-band {
  position: relative;
  background: var(--navy-950);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--on-dark);
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: rgba(255, 255, 255, 0.06);
}
.stat {
  background: var(--navy-950);
  text-align: center;
  padding: 2.5rem 1.5rem;
}
.stat-number {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 800;
  line-height: 1;
  background: var(--grad-accent);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  margin-bottom: 0.4rem;
}
.stat-label { font-weight: 600; color: #fff; font-size: 1rem; }
.stat-desc { font-size: 0.85rem; color: var(--on-dark-muted); margin-top: 0.25rem; }

/* === Sections =========================================================== */
.section { padding-block: 5.5rem; }
.section-white { background: var(--surface); }
.section-dark {
  background: var(--grad-dark);
  color: var(--on-dark);
}
.section-dark h2 { color: #fff; }

.section-head {
  max-width: 46rem;
  margin: 0 auto 3.25rem;
  text-align: center;
}
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--green-strong);
  margin-bottom: 1rem;
}
.kicker::before, .kicker::after {
  content: '';
  width: 0.45rem; height: 0.45rem;
  background: currentColor;
  transform: rotate(45deg);
  opacity: 0.6;
}
.section-dark .kicker { color: var(--green); }

.section-title {
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  font-weight: 800;
}
.section-sub { font-size: 1.05rem; color: var(--body-text); }
.section-sub a { text-decoration: underline; text-decoration-thickness: 0.08em; text-underline-offset: 0.16em; }
.section-dark .section-sub { color: var(--on-dark-muted); }

/* === Cards: services ==================================================== */
.cards-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.cards-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.service-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.9rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.35s;
  overflow: hidden;
}
.service-card::after {
  content: '';
  position: absolute;
  top: 0;
  inset-inline: 0;
  height: 3px;
  background: var(--grad-accent);
  transform: scaleX(0);
  transform-origin: var(--tx-origin, left);
  transition: transform 0.4s var(--ease);
}
.service-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(79, 196, 188, 0.5);
}
.service-card:hover::after { transform: scaleX(1); }

.card-icon {
  width: 3rem; height: 3rem;
  display: grid;
  place-items: center;
  border-radius: 0.85rem;
  background: var(--navy-800);
  color: var(--teal-light);
  margin-bottom: 1.2rem;
  flex-shrink: 0;
}
.card-icon svg { width: 1.5rem; height: 1.5rem; }

.card-num {
  position: absolute;
  top: 1.4rem;
  inset-inline-end: 1.6rem;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
  opacity: 0.6;
  letter-spacing: 0.05em;
}

.service-card h3 { font-size: 1.15rem; font-weight: 700; }
.service-card p { font-size: 0.92rem; flex-grow: 1; }
.service-card .card-service-sub { font-size: 0.8rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--blue, #2D7DD2); flex-grow: 0; margin-top: -0.35rem; }

.card-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--blue);
  margin-top: 0.5rem;
  transition: gap 0.25s var(--ease), color 0.2s;
}
.card-link:hover { gap: 0.7rem; color: var(--green-strong); }

/* === Why us ============================================================= */
.why-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}
.why-card {
  display: flex;
  gap: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.35s;
}
.why-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(169, 199, 102, 0.6);
}
.why-card h3 { font-size: 1.08rem; font-weight: 700; margin-bottom: 0.5rem; }
.why-card p { font-size: 0.92rem; margin: 0; }

/* === Industries (dark band) ============================================ */
.industry-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 1.9rem;
  transition: transform 0.35s var(--ease), border-color 0.35s, background-color 0.35s;
}
.industry-card:hover {
  transform: translateY(-5px);
  border-color: rgba(79, 196, 188, 0.45);
  background: rgba(255, 255, 255, 0.07);
}
.industry-card .card-icon { background: rgba(79, 196, 188, 0.12); }
.industry-card h3 { color: #fff; font-size: 1.1rem; font-weight: 700; }
.industry-card p { color: var(--on-dark-muted); font-size: 0.9rem; margin: 0; }

/* Industry cards on light pages (Who We Serve hub) */
.page-body .industry-card { background: #fff; border: 1px solid var(--border, #e2e8f0); }
.page-body .industry-card h3 { color: var(--ink, #0f172a); }
.page-body .industry-card p { color: var(--muted, #475569); }
.page-body .industry-card .card-icon { background: rgba(45, 125, 210, 0.10); color: var(--blue); }


/* === Process ============================================================ */
.process-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  counter-reset: step;
}
.process-step {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.35s;
}
.process-step:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(79, 196, 188, 0.5);
}
.step-num {
  display: inline-grid;
  place-items: center;
  width: 2.8rem; height: 2.8rem;
  border-radius: 0.8rem;
  background: var(--navy-800);
  color: var(--green);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 1.1rem;
}
.process-step h3 { font-size: 1.05rem; font-weight: 700; }
.process-step p { font-size: 0.88rem; margin: 0; }

/* === Pricing ============================================================ */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  align-items: stretch;
}
.price-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 2.1rem 1.9rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.35s;
}
.price-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(79, 196, 188, 0.5);
}
.price-card h3 { font-size: 1.25rem; font-weight: 700; }
.price-card > p { font-size: 0.9rem; }

.price-featured {
  background: var(--grad-dark);
  border-color: var(--navy-700);
  color: var(--on-dark-muted);
}
.price-featured h3 { color: #fff; }
.price-featured .price-amount { color: #fff; }
.price-featured .feature-list li { color: var(--on-dark-muted); }

.featured-tag {
  position: absolute;
  top: -0.85rem;
  inset-inline-start: 50%;
  transform: translateX(-50%);
  background: var(--grad-accent);
  color: var(--navy-950);
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.4rem 1.1rem;
  border-radius: 999px;
  white-space: nowrap;
}
[dir="rtl"] .featured-tag { transform: translateX(50%); }

.feature-list { list-style: none; display: grid; gap: 0.55rem; margin: 1rem 0 1.5rem; flex-grow: 1; }
.feature-list li {
  position: relative;
  font-size: 0.88rem;
  padding-inline-start: 1.5rem;
}
.feature-list li::before {
  content: '✓';
  position: absolute;
  inset-inline-start: 0;
  color: var(--green-strong);
  font-weight: 700;
}
.price-featured .feature-list li::before { color: var(--green); }

.price-amount {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--ink);
  line-height: 1;
  margin-bottom: 1.5rem;
}
.price-amount .period {
  font-size: 1rem;
  font-weight: 500;
  color: var(--muted);
}
.price-amount .from {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.3rem;
}
.pricing-note {
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 2.25rem;
}

/* === Contact ============================================================ */
.contact-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
}

.contact-form { display: grid; gap: 1.25rem; }
.form-group { display: grid; gap: 0.4rem; }
.form-label { font-weight: 600; font-size: 0.9rem; color: var(--ink); }
.form-input, .form-textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  padding: 0.8rem 1rem;
  border-radius: 0.7rem;
  border: 1.5px solid var(--line);
  background: var(--bg-light);
  transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}
.form-input:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--teal);
  background: #fff;
  box-shadow: var(--ring);
}
.form-input.error, .form-textarea.error { border-color: var(--danger); }
.form-textarea { resize: vertical; min-height: 8rem; }

.form-status { font-size: 0.85rem; color: var(--muted); text-align: center; margin: 0; }
.form-status.success { color: #2E9E6B; font-weight: 600; }
.form-status.error { color: var(--danger); font-weight: 600; }

/* Contact mode toggle: message <-> schedule a meeting */
.contact-switch {
  display: flex;
  gap: 0.25rem;
  padding: 0.3rem;
  margin-bottom: 1.5rem;
  background: var(--bg-light);
  border: 1px solid var(--line);
  border-radius: 0.75rem;
}
.contact-switch-btn {
  flex: 1 1 0;
  font: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--muted);
  padding: 0.6rem 0.75rem;
  border: none;
  border-radius: 0.55rem;
  background: transparent;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s, box-shadow 0.2s;
}
.contact-switch-btn:hover { color: var(--ink); }
.contact-switch-btn.is-active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}
.contact-switch-btn:focus-visible { outline: none; box-shadow: var(--ring); }

/* Phone numbers are inherently LTR: isolate every tel: link so dial codes and
   digits don't reorder inside the RTL (Arabic) layout (e.g. "+1" -> "1+"). */
a[href^="tel:"] { direction: ltr; unicode-bidi: isolate; }

/* International phone: country selector + local number.
   Phone numbers and dial codes are inherently LTR, so keep this control LTR
   even on RTL (Arabic) pages - the label above stays in the page direction. */
.phone-row { display: flex; gap: 0.5rem; align-items: stretch; direction: ltr; }
.phone-country { flex: 0 0 auto; max-width: 42%; direction: ltr; }
.phone-number { flex: 1 1 auto; min-width: 0; direction: ltr; text-align: left; }
.form-input.error { border-color: var(--danger); }

/* Turnstile CAPTCHA block (revealed from the 2nd submission) */
.cf-turnstile-group { justify-items: center; gap: 0.6rem; }
.form-captcha-prompt { font-size: 0.85rem; color: var(--muted); margin: 0; text-align: center; }

/* Cal.com scheduling panel */
.schedule-panel { display: grid; gap: 1rem; }
.schedule-title { margin: 0; font-size: 1.15rem; color: var(--ink); text-align: center; }
.schedule-duration {
  display: flex;
  gap: 0.25rem;
  padding: 0.25rem;
  background: var(--bg-light);
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  max-width: 16rem;
  margin: 0 auto;
}
.schedule-duration-btn {
  flex: 1 1 0;
  font: inherit;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--muted);
  padding: 0.45rem 0.5rem;
  border: none;
  border-radius: 0.45rem;
  background: transparent;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s, box-shadow 0.2s;
}
.schedule-duration-btn:hover { color: var(--ink); }
.schedule-duration-btn.is-active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.schedule-duration-btn:focus-visible { outline: none; box-shadow: var(--ring); }
.cal-inline { min-height: 24rem; width: 100%; }
.schedule-note { font-size: 0.85rem; color: var(--muted); text-align: center; margin: 0; }

.details-list { list-style: none; display: grid; gap: 1.1rem; margin-bottom: 1.25rem; }
.details-list strong { display: block; color: var(--ink); font-size: 0.85rem; margin-bottom: 0.15rem; }
.details-list li { font-size: 0.92rem; }
.details-note { font-size: 0.78rem; color: var(--muted); font-style: italic; }

/* === CTA band (subpages) ================================================ */
.cta-band {
  position: relative;
  background: var(--grad-dark);
  border-radius: var(--radius-lg);
  padding: 3rem 2rem;
  text-align: center;
  color: var(--on-dark-muted);
  overflow: hidden;
}
.cta-band::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72' viewBox='0 0 72 72'%3E%3Cpath d='M36 4 L68 36 L36 68 L4 36 Z' fill='none' stroke='rgba(141,176,221,0.08)' stroke-width='1.5'/%3E%3C/svg%3E");
  background-size: 72px 72px;
  pointer-events: none;
}
.cta-band > * { position: relative; }
.cta-band h2 { color: #fff; font-size: 1.7rem; margin-bottom: 0.5rem; }
.cta-band p { max-width: 34rem; margin: 0 auto 1.5rem; }

/* === Footer ============================================================= */
.site-footer {
  background: var(--navy-950);
  color: var(--on-dark-muted);
  border-top: 0;
  font-size: 0.9rem;
}
.site-footer::before {
  content: '';
  display: block;
  height: 3px;
  background: var(--grad-accent);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
  gap: 2.5rem;
  padding-block: 3.5rem 2.5rem;
}
.footer-brand .brand { margin-bottom: 1rem; }
.footer-brand p { font-size: 0.85rem; max-width: 18rem; }

.footer-col h2 {
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1.1rem;
}
.footer-col ul { list-style: none; display: grid; gap: 0.55rem; }
.footer-col a { color: var(--on-dark-muted); transition: color 0.2s; }
.footer-col a:hover { color: var(--teal-light); text-decoration: underline; text-underline-offset: 0.2em; }
.footer-col li { line-height: 1.5; }

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 0.82rem;
}
.footer-privacy {
  color: var(--on-dark-muted);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}
.footer-privacy:hover { color: var(--teal-light); }

/* === Subpage layout ===================================================== */
.page-hero {
  position: relative;
  background: var(--grad-dark);
  color: var(--on-dark);
  padding-block: 4rem 4.5rem;
  overflow: hidden;
}
.page-hero .hero-pattern { opacity: 0.4; }
.page-hero .container { position: relative; }
.page-hero h1 {
  color: #fff;
  font-size: clamp(1.9rem, 3.6vw, 2.8rem);
  font-weight: 800;
  max-width: 46rem;
}
.page-hero .lede {
  font-size: 1.1rem;
  color: var(--on-dark-muted);
  max-width: 42rem;
  margin: 0;
}

.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--on-dark-muted);
  margin-bottom: 2rem;
}
.breadcrumb a { color: var(--on-dark-muted); transition: color 0.2s; }
.breadcrumb a:hover { color: var(--teal-light); }
.breadcrumb .sep { opacity: 0.5; }
.breadcrumb .current { color: var(--on-dark); font-weight: 500; }

.page-body { padding-block: 4rem; }
.page-body .container { max-width: 58rem; }

.content-section { margin-bottom: 3.5rem; }
.content-section > h2 {
  font-size: 1.6rem;
  font-weight: 800;
  padding-bottom: 0.75rem;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--line);
  position: relative;
}
.content-section > h2::after {
  content: '';
  position: absolute;
  bottom: -2px;
  inset-inline-start: 0;
  width: 4rem;
  height: 2px;
  background: var(--grad-accent);
}

.detail-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.6rem 1.75rem;
  margin-bottom: 1.25rem;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.detail-card:hover { border-color: rgba(79, 196, 188, 0.45); box-shadow: var(--shadow-sm); }
.detail-card h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.85rem; }
.detail-card h4 { font-size: 1rem; font-weight: 700; margin-bottom: 0.75rem; }
.detail-card > p { font-size: 0.95rem; }

.bullet-list { list-style: none; display: grid; gap: 0.6rem; }
.bullet-list li {
  position: relative;
  font-size: 0.93rem;
  padding-inline-start: 1.25rem;
}
.bullet-list li::before {
  content: '';
  position: absolute;
  inset-inline-start: 0;
  top: 0.55em;
  width: 0.42rem; height: 0.42rem;
  background: var(--green-strong);
  transform: rotate(45deg);
}
.bullet-list strong { color: var(--ink); }

.check-list li::before {
  content: '✓';
  background: none;
  transform: none;
  top: 0;
  color: var(--green-strong);
  font-weight: 700;
}

.num-list {
  list-style: none;
  counter-reset: num;
  display: grid;
  gap: 0.9rem;
}
.num-list li {
  position: relative;
  counter-increment: num;
  font-size: 0.95rem;
  padding-inline-start: 2.4rem;
}
.num-list li::before {
  content: counter(num);
  position: absolute;
  inset-inline-start: 0;
  top: 0.1em;
  width: 1.6rem; height: 1.6rem;
  display: grid;
  place-items: center;
  background: var(--navy-800);
  color: var(--green);
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: 0.45rem;
}
.num-list strong { color: var(--ink); }

.sub-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}
.tint-card {
  background: var(--bg-light);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem;
}
.tint-card h4 { font-size: 0.98rem; font-weight: 700; margin-bottom: 0.7rem; }
.tint-card p { font-size: 0.88rem; }
.tint-card .bullet-list li { font-size: 0.88rem; }

/* Topic cards (technical topics index) */
.topics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-bottom: 4rem;
}
.topic-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  color: inherit;
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s;
}
.topic-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: rgba(79, 196, 188, 0.5);
}
.topic-card h3 { font-size: 1.02rem; font-weight: 700; margin-bottom: 0.4rem; }
.topic-card p { font-size: 0.85rem; flex-grow: 1; margin-bottom: 0.75rem; }
.topic-card .card-link { font-size: 0.85rem; margin: 0; }

.scroll-target { scroll-margin-top: calc(var(--site-chrome-h) + 1.5rem); }
section[id] { scroll-margin-top: calc(var(--site-chrome-h) + 1rem); }

/* === ITIN eligibility checker =========================================== */
.itin-tool {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-md);
}
.itin-progress {
  height: 0.5rem;
  background: var(--bg-light-2);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 1.75rem;
  box-shadow: inset 0 0 0 1px var(--line);
}
.itin-progress-bar {
  display: block;
  height: 100%;
  width: 0;
  background: var(--grad-accent);
  border-radius: 999px;
  transition: width 0.4s var(--ease);
  box-shadow: 0 0 10px rgba(79, 196, 188, 0.5);
}
.itin-step {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--green-strong);
  margin: 0 0 0.5rem;
}
.itin-question {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 0.4rem;
}
.itin-help { font-size: 0.9rem; color: var(--muted); margin: 0 0 1.25rem; }

.itin-options { display: grid; gap: 0.7rem; }
.itin-option {
  display: block;
  width: 100%;
  text-align: start;
  font: inherit;
  cursor: pointer;
  background: var(--bg-light);
  border: 1.5px solid var(--line);
  border-radius: 0.8rem;
  padding: 0.95rem 1.15rem;
  transition: border-color 0.2s, background-color 0.2s, transform 0.2s var(--ease), box-shadow 0.2s;
}
.itin-option:hover {
  border-color: var(--teal);
  background: #fff;
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}
.itin-option:focus-visible { box-shadow: var(--ring); }
.itin-option-label { display: block; font-weight: 600; color: var(--ink); }
.itin-option-hint { display: block; font-size: 0.82rem; color: var(--muted); margin-top: 0.15rem; }

.itin-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}
.itin-back {
  font: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--blue);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.4rem 0.2rem;
}
.itin-back:hover { color: var(--green-strong); }

/* Result */
.itin-result-icon {
  width: 3rem; height: 3rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
}
.itin-result h3 { font-size: 1.4rem; font-weight: 800; }
.itin-result-ok { border-inline-start: 4px solid var(--green); padding-inline-start: 1.25rem; }
.itin-result-ok .itin-result-icon { background: rgba(169, 199, 102, 0.18); color: var(--green-strong); }
.itin-result-no { border-inline-start: 4px solid var(--danger); padding-inline-start: 1.25rem; }
.itin-result-no .itin-result-icon { background: rgba(197, 63, 63, 0.14); color: var(--danger); }
.itin-result-info { border-inline-start: 4px solid var(--blue-bright); padding-inline-start: 1.25rem; }
.itin-result-info .itin-result-icon { background: rgba(45, 125, 210, 0.14); color: var(--blue-bright); font-style: normal; }

.itin-box {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  background: var(--bg-light);
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  padding: 0.85rem 1.1rem;
  margin: 0 0 1.5rem;
}
.itin-box span {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.itin-box strong { color: var(--ink); font-size: 0.98rem; }

.itin-doc-title { font-size: 1.05rem; font-weight: 700; margin: 1.25rem 0 0.85rem; }
.doc-checklist { list-style: none; display: grid; gap: 0.7rem; margin: 0 0 1.25rem; }
.doc-checklist li {
  position: relative;
  font-size: 0.93rem;
  padding-inline-start: 1.7rem;
}
.doc-checklist li::before {
  content: '✓';
  position: absolute;
  inset-inline-start: 0;
  top: 0;
  width: 1.15rem; height: 1.15rem;
  display: grid;
  place-items: center;
  background: rgba(169, 199, 102, 0.2);
  color: var(--green-strong);
  border-radius: 0.3rem;
  font-size: 0.7rem;
  font-weight: 700;
}
.doc-checklist strong { color: var(--ink); }

.itin-note {
  font-size: 0.85rem;
  color: var(--body-text);
  background: var(--bg-light);
  border-inline-start: 3px solid var(--teal);
  border-radius: 0 0.5rem 0.5rem 0;
  padding: 0.75rem 1rem;
  margin: 0 0 0.75rem;
}

/* === Back to top ======================================================== */
.back-to-top {
  position: fixed;
  bottom: 1.75rem;
  inset-inline-end: 1.75rem;
  width: 3rem; height: 3rem;
  display: grid;
  place-items: center;
  background: var(--grad-accent);
  color: var(--navy-950);
  border: none;
  border-radius: 0.9rem;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  z-index: 90;
  opacity: 0;
  visibility: hidden;
  transform: translateY(0.75rem);
  transition: opacity 0.3s, visibility 0.3s, transform 0.3s var(--ease);
}
.back-to-top.visible { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { transform: translateY(-3px); }
.back-to-top svg { width: 1.3rem; height: 1.3rem; }

/* === Reveal animation =================================================== */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal.show { opacity: 1; transform: translateY(0); }
.reveal:nth-child(2) { transition-delay: 0.08s; }
.reveal:nth-child(3) { transition-delay: 0.16s; }
.reveal:nth-child(4) { transition-delay: 0.24s; }

/* === RTL ================================================================ */
[dir="rtl"] body { text-align: right; }
[dir="rtl"] .service-card::after { --tx-origin: right; }

/* Arabic script is joined; uppercase tracking and negative heading tracking
   visually break it, so reset letter-spacing for RTL pages. */
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3, [dir="rtl"] h4,
[dir="rtl"] .kicker, [dir="rtl"] .itin-step, [dir="rtl"] .hero-list-title,
[dir="rtl"] .footer-col h2, [dir="rtl"] .brand-tag, [dir="rtl"] .featured-tag,
[dir="rtl"] .price-amount .from, [dir="rtl"] .tool-category-badge,
[dir="rtl"] .card-num, [dir="rtl"] .w7-eyebrow { letter-spacing: 0; }
[dir="rtl"] .card-link svg,
[dir="rtl"] .hero-panel-link svg,
[dir="rtl"] .topic-card .card-link svg { transform: scaleX(-1); }

/* Tool directory RTL fixes */
[dir="rtl"] .tool-directory-controls {
  direction: rtl;
}
[dir="rtl"] .tool-search-field input,
[dir="rtl"] .tool-filter-field select {
  text-align: right;
  direction: rtl;
}
[dir="rtl"] .tool-search-field input::placeholder {
  text-align: right;
}
[dir="rtl"] .tool-card-footer .card-link svg {
  transform: scaleX(-1);
}
[dir="rtl"] .itin-note {
  border-radius: var(--radius) 0 0 var(--radius);
}
[dir="rtl"] .tool-directory-head {
  text-align: center;
}
[dir="rtl"] .tool-category-nav a {
  text-align: center;
}


/* === Responsive ========================================================= */
@media (max-width: 1024px) {
  .hero-grid { grid-template-columns: 1fr; gap: 2.5rem; padding-block: 4rem; }
  .hero-panel { max-width: 34rem; }
  .cards-3, .topics-grid { grid-template-columns: repeat(2, 1fr); }
  .process-grid { grid-template-columns: repeat(2, 1fr); }
  .pricing-grid { grid-template-columns: 1fr; max-width: 28rem; margin-inline: auto; }
  .contact-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
}

/* Spanish navigation labels need a little more room before switching to the menu. */
@media (max-width: 1340px) {
  html[lang="es"] .main-nav, html[lang="es"] .header-cta .btn { display: none; }
  html[lang="es"] .menu-toggle { display: block; }
}

@media (max-width: 1250px) {
  .main-nav, .header-cta .btn { display: none; }
  .menu-toggle { display: block; }
}

@media (max-width: 680px) {
  .section { padding-block: 3.5rem; }
  .cards-3, .cards-2, .topics-grid, .why-grid, .process-grid, .sub-grid,
  .hero-lists { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr; }
  .stat { padding: 1.75rem 1rem; }
  .footer-grid { grid-template-columns: 1fr; }
  .topbar .container { justify-content: center; }
  .topbar-tagline { display: none; }
  /* Keep the sticky chrome to one row on phones: the hidden links stay
     reachable through the mobile nav and the footer. */
  .topbar-links a:not(.topbar-phone) { display: none; }
  .hero h1 { font-size: 2rem; }
  .page-body { padding-block: 2.5rem; }
  .back-to-top { width: 2.6rem; height: 2.6rem; bottom: 1.1rem; inset-inline-end: 1.1rem; }
}

/* === Print ============================================================== */
@media print {
  .topbar, .site-header, .back-to-top, .cta-band, .site-footer, .hero-pattern { display: none; }
  body { background: #fff; }
  .section { padding-block: 1.5rem; page-break-inside: avoid; }
  /* Dark bands print with no background, so force dark text */
  .hero, .page-hero, .section-dark, .stats-band {
    background: #fff !important;
    color: #1a1a1a;
  }
  .hero h1, .page-hero h1, .section-dark h2, .section-dark h3,
  .hero-subtitle, .hero-lede, .stat-label, .stat-desc { color: #000 !important; }
  .hero h1 .accent, .stat-number {
    background: none !important;
    -webkit-text-fill-color: initial !important;
    color: #000 !important;
  }
}

/* === Reduced motion ===================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* ====================================================================
   Tax-prep checklist wizards (reuse .itin-* engine styles; only the
   multi-select "selected" state and the schedules list are new).
   ==================================================================== */
.tw-option { position: relative; padding-inline-end: 2.6rem; }
.tw-option.is-selected {
  border-color: var(--teal);
  background: #fff;
  box-shadow: var(--shadow-sm);
}
.tw-option.is-selected::after {
  content: "\2713";
  position: absolute;
  inset-inline-end: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.4rem;
  height: 1.4rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--grad-accent);
  color: #06243f;
  font-weight: 700;
  font-size: 0.85rem;
}
.doc-checklist.tw-sched li::before { color: var(--blue-bright); }

/* Tax-prep checklist hub: return-type cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1.25rem;
}
.link-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, transform 0.2s var(--ease), box-shadow 0.2s;
}
a.link-card:hover {
  border-color: var(--teal);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.link-card h3 { margin: 0; color: var(--ink); }
.link-card p { margin: 0; color: var(--body-text); font-size: 0.95rem; }
.link-card-cta { margin-top: auto; font-weight: 600; color: var(--blue); }
/* Muted look via tinted surface, keeping text at full AA contrast */
.link-card.is-soon { background: var(--bg-light); border-style: dashed; }
.link-card.is-soon h3 { color: var(--body-text); }
.link-card.is-soon .link-card-cta { color: var(--muted); }

/* ====================================================================
   Free Tools directory + unified wizard presentation
   ==================================================================== */
.tool-directory-hero .kicker,
.tool-category-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-bottom: 0.8rem;
  padding: 0.36rem 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  color: var(--green-light);
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.tool-trust-row { display: flex; flex-wrap: wrap; gap: 0.7rem 1.25rem; margin-top: 1.15rem; color: var(--on-dark-muted); font-size: 0.82rem; font-weight: 600; }
.tool-trust-row > span::before { content: '\2713'; margin-inline-end: 0.4rem; color: var(--green-light); font-weight: 800; }
.tool-review-meta { display: flex; justify-content: center; gap: 0.5rem; flex-wrap: wrap; margin: 0.9rem 0 0; color: var(--on-dark-muted); font-size: 0.78rem; }

.tool-category-nav { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; margin-bottom: 1.5rem; padding: 0.5rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.tool-category-nav a { padding: 0.8rem 1rem; border-radius: calc(var(--radius) - 0.25rem); color: var(--body-text); text-align: center; font-size: 0.9rem; font-weight: 700; }
.tool-category-nav a:hover { background: var(--bg-light); color: var(--blue); }
.tool-category-nav a[aria-current="page"] { background: var(--ink); color: #fff; }

.tool-category-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.tool-category-card { display: flex; min-height: 19rem; flex-direction: column; align-items: flex-start; padding: 1.7rem; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-sm); }
.tool-category-card::before { content: ''; width: 3.2rem; height: 0.3rem; margin-bottom: 1.25rem; border-radius: 99px; background: var(--grad-accent); }
.tool-category-card h2 { font-size: 1.3rem; }
.tool-category-card p { flex-grow: 1; }
.tool-category-count { display: flex; align-items: baseline; gap: 0.4rem; margin-bottom: 0.7rem; color: var(--muted); }
.tool-category-count strong { color: var(--ink); font-family: var(--font-display); font-size: 2rem; }
.tool-category-count span { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; }

.tool-directory-controls { display: grid; grid-template-columns: minmax(0, 1fr) minmax(13rem, 0.42fr) auto; gap: 1rem; align-items: end; margin-bottom: 1.5rem; padding: 1.25rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.tool-search-field, .tool-filter-field { display: grid; gap: 0.45rem; margin: 0; color: var(--ink); font-size: 0.8rem; font-weight: 700; }
.tool-search-field input, .tool-filter-field select { width: 100%; min-height: 2.8rem; margin: 0; padding: 0.65rem 0.8rem; border: 1px solid var(--line); border-radius: 0.65rem; background: #fff; color: var(--ink); font: inherit; }
.tool-search-field input:focus, .tool-filter-field select:focus { outline: none; box-shadow: var(--ring); border-color: var(--teal); }
.tool-results-count { margin: 0 0 0.7rem; color: var(--muted); font-size: 0.82rem; white-space: nowrap; }
.tool-results-count strong { color: var(--ink); }

.tool-directory-section { scroll-margin-top: 7rem; }
.tool-directory-section + .tool-directory-section { margin-top: 1.25rem; }
.tool-directory-head { margin-inline: auto; margin-bottom: 1.5rem; text-align: center; }
.tool-card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.tool-card { display: flex; min-height: 19rem; flex-direction: column; padding: 1.35rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition); }

/* Underline in-content links so they are identifiable without color alone */
.page-body p a:not(.btn):not(.card-link), .detail-card p a, .itin-note a {
  text-decoration: underline;
  text-decoration-thickness: 0.08em;
  text-decoration-color: rgba(29, 95, 168, 0.4);
  text-underline-offset: 0.16em;
}
.page-body p a:not(.btn):not(.card-link):hover, .detail-card p a:hover, .itin-note a:hover {
  text-decoration-color: currentColor;
}
.tool-card:hover { transform: translateY(-3px); border-color: rgba(79, 196, 188, 0.55); box-shadow: var(--shadow-md); }
.tool-card-meta { display: flex; justify-content: space-between; gap: 0.75rem; align-items: center; margin-bottom: 0.9rem; color: var(--muted); }
.tool-card-index { color: var(--blue); font-family: var(--font-display); font-size: 0.75rem; font-weight: 800; letter-spacing: 0.08em; }
.tool-card-steps { font-size: 0.75rem; }
.tool-card h3 { margin-bottom: 0.7rem; font-size: 1.05rem; line-height: 1.35; }
.tool-card h3 a { color: var(--ink); }
.tool-card h3 a:hover { color: var(--blue); }
.tool-card > p { flex-grow: 1; margin-bottom: 1rem; color: var(--body-text); font-size: 0.86rem; }
.tool-card-footer { display: grid; gap: 0.7rem; margin-top: auto; padding-top: 0.9rem; border-top: 1px solid var(--line); }
.tool-card-guidance { color: var(--green-strong); font-size: 0.72rem; font-weight: 700; }
.tool-card-guidance::before { content: '\2713'; margin-inline-end: 0.35rem; }
.tool-related { margin-top: 4rem; }
.tool-related > p { max-width: 48rem; margin: -0.55rem auto 1.5rem; color: var(--muted); text-align: center; }
.service-tools > p { max-width: 48rem; margin: -0.55rem auto 1.5rem; color: var(--muted); text-align: center; }
.tool-related-grid .tool-card-related { min-height: 13.5rem; }
.tool-card-related .card-link { margin-top: auto; padding-top: 1rem; border-top: 1px solid var(--line); }
.tool-service-callout { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; margin-top: 1.25rem; padding: 1.35rem 1.5rem; border: 1px solid rgba(45, 125, 210, 0.24); border-radius: var(--radius); background: linear-gradient(135deg, rgba(45, 125, 210, 0.07), rgba(169, 199, 102, 0.1)); }
.tool-service-callout h3 { margin-bottom: 0.35rem; font-size: 1.05rem; }
.tool-service-callout p { margin: 0; color: var(--body-text); font-size: 0.9rem; }
.tool-service-callout .btn { flex: 0 0 auto; }
.tool-no-results { padding: 2rem; border: 1px dashed var(--line); border-radius: var(--radius); text-align: center; }

#tools .section-head { text-align: center; }
.tool-home-head { margin-top: 3rem; margin-bottom: 1.5rem; }
.tool-home-head .section-title { font-size: 1.6rem; }
.tool-home-cta { margin-top: 2rem; text-align: center; }
.tool-card-home { position: relative; min-height: 18rem; padding: 1.9rem; overflow: hidden; text-align: start; }
.tool-card-home .card-icon { margin-bottom: 1.2rem; }
.tool-card-home .card-link { margin-top: auto; }
.tool-page-hero .container,
.tool-directory-hero .container { text-align: center; }
.tool-page-hero .breadcrumb,
.tool-directory-hero .breadcrumb { justify-content: center; text-align: center; }
.tool-page-hero h1,
.tool-directory-hero h1,
.tool-page-hero .lede,
.tool-directory-hero .lede { margin-inline: auto; text-align: center; }
.tool-page-hero .tool-trust-row { justify-content: center; }

.wizard-static-helper { margin-bottom: 0.7rem; color: var(--muted); font-size: 0.88rem; }
.wizard-static-guidance { margin: 0.8rem 0; padding: 0.7rem 0.8rem; border-inline-start: 3px solid var(--blue); background: var(--bg-light); font-size: 0.85rem; }
.itin-guidance { margin-top: 1rem; }
.itin-guidance a { font-weight: 700; }
.itin-result-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.9rem; margin: 1rem 0; }
.itin-result-panel { padding: 1rem; border: 1px solid var(--line); border-radius: 0.75rem; background: var(--bg-light); }
.itin-result-panel h4 { margin-bottom: 0.6rem; font-size: 0.9rem; }
.itin-result-panel ul { display: grid; gap: 0.4rem; margin: 0; padding-inline-start: 1.1rem; color: var(--body-text); font-size: 0.84rem; }

@media (max-width: 1024px) {
  .tool-card-grid, .tool-category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .tool-category-nav, .tool-card-grid, .tool-category-grid, .itin-result-grid { grid-template-columns: 1fr; }
  .tool-directory-controls { grid-template-columns: 1fr; }
  .tool-category-card, .tool-card { min-height: 0; }
  .tool-results-count { margin: 0; }
  .tool-service-callout { align-items: stretch; flex-direction: column; }
  .tool-service-callout .btn { width: 100%; }
}

/* Form W-7 intake */
.w7-hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }
.w7-intake-section { scroll-margin-top: 7rem; }
.w7-intake-intro { display: flex; align-items: flex-start; justify-content: space-between; gap: 2rem; margin-bottom: 1.25rem; }
.w7-intake-intro > div:first-child { max-width: 48rem; }
.w7-intake-intro h2 { margin: 0.35rem 0 0.75rem; }
.w7-intake-intro p { margin: 0; }
.w7-eyebrow { color: var(--blue); font-size: 0.76rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.w7-intake-badge { display: grid; flex: 0 0 12.5rem; gap: 0.25rem; padding: 1rem; border: 1px solid rgba(45, 125, 210, 0.3); border-radius: 0.75rem; background: rgba(45, 125, 210, 0.07); }
.w7-intake-badge strong { color: var(--ink); font-size: 0.9rem; }
.w7-intake-badge span { color: var(--muted); font-size: 0.75rem; }
.w7-security-note { margin-bottom: 0.9rem; padding: 1rem 1.1rem; border-inline-start: 4px solid var(--green); border-radius: 0.5rem; background: rgba(169, 199, 102, 0.12); color: var(--body-text); font-size: 0.88rem; }
.w7-security-note strong { color: var(--ink); }
.w7-translation-note { margin: -0.15rem 0 0.9rem; color: var(--muted); font-size: 0.76rem; font-style: italic; }
.w7-reference-links { display: flex; flex-wrap: wrap; gap: 1rem; margin-bottom: 1.25rem; font-size: 0.83rem; font-weight: 700; }
.w7-reference-links a { text-decoration: underline; text-underline-offset: 0.2em; }

.w7-form { overflow: hidden; border: 2px solid #24354a; border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-md); color: #172435; }
.w7-form-header { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 1.1rem; padding: 1rem 1.25rem; background: #24354a; color: #fff; }
.w7-form-header > div:last-child { display: grid; gap: 0.15rem; }
.w7-form-header strong { font-family: var(--font-display); font-size: 1.05rem; }
.w7-form-header span { color: rgba(255, 255, 255, 0.78); font-size: 0.78rem; }
.w7-form-number { padding-inline-end: 1.1rem; border-inline-end: 1px solid rgba(255, 255, 255, 0.35); font-family: var(--font-display); font-size: 2rem; font-weight: 800; letter-spacing: -0.05em; }
.w7-block { min-width: 0; margin: 0; padding: 1.35rem 1.4rem 1.5rem; border: 0; border-bottom: 1px solid #cbd4df; }
.w7-block legend { width: 100%; margin: 0 0 0.9rem; padding: 0; color: #172435; font-family: var(--font-display); font-size: 1rem; font-weight: 800; }
.w7-block label:not(.w7-choice):not(.w7-attestation) { display: grid; gap: 0.4rem; margin-bottom: 0.9rem; color: #24354a; font-size: 0.78rem; font-weight: 700; }
.w7-block label span { color: #68778a; font-weight: 500; }
.w7-form input[type="text"],
.w7-form input[type="email"],
.w7-form input[type="tel"],
.w7-form input[type="date"],
.w7-form select,
.w7-form textarea { width: 100%; min-height: 2.75rem; margin: 0; padding: 0.65rem 0.75rem; border: 1px solid #aab6c3; border-radius: 0.45rem; background: #fff; color: #172435; font: 500 0.9rem/1.35 var(--font-body); }
.w7-form textarea { min-height: 5rem; resize: vertical; }
.w7-form input:focus,
.w7-form select:focus,
.w7-form textarea:focus { outline: none; border-color: var(--blue); box-shadow: var(--ring); }
.w7-form [aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(197, 63, 63, 0.14); }
.w7-form input[type="radio"],
.w7-form input[type="checkbox"] { width: 1.05rem; height: 1.05rem; margin: 0.12rem 0 0; accent-color: var(--blue); }
.w7-grid { display: grid; gap: 0.9rem; }
.w7-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.w7-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.w7-choice-row { display: flex; flex-wrap: wrap; gap: 0.65rem 1.5rem; }
.w7-choice-wrap { margin-bottom: 1rem; }
.w7-choice { display: flex; align-items: flex-start; gap: 0.55rem; color: #24354a; font-size: 0.86rem; line-height: 1.45; cursor: pointer; }
.w7-reason-list { display: grid; gap: 0.6rem; }
.w7-reason-list .w7-choice strong { flex: 0 0 1rem; text-transform: lowercase; }
.w7-helper { margin: -0.35rem 0 0.9rem; color: #68778a; font-size: 0.8rem; }
.w7-subhead { margin: 0.9rem 0 0.7rem; padding-top: 0.9rem; border-top: 1px dashed #c7d0da; color: #24354a; font-size: 0.82rem; font-weight: 800; }
.w7-field-label { margin: 0.2rem 0 0.55rem; color: #24354a; font-size: 0.78rem; font-weight: 800; }
.w7-conditional { margin-top: 1rem; padding: 1rem; border: 1px solid rgba(45, 125, 210, 0.28); border-radius: 0.6rem; background: rgba(45, 125, 210, 0.055); }
.w7-conditional[hidden] { display: none !important; }
.w7-conditional > label:last-child,
.w7-conditional .w7-grid > label { margin-bottom: 0 !important; }
.w7-attestation { display: flex; align-items: flex-start; gap: 0.65rem; margin-top: 0.9rem; padding: 0.9rem; border: 1px solid #cbd4df; border-radius: 0.55rem; color: #35465a; font-size: 0.78rem; line-height: 1.5; cursor: pointer; }
.w7-attestation a { font-weight: 700; text-decoration: underline; }
.w7-agent-note { display: grid; gap: 0.25rem; padding: 1rem 1.4rem; border-bottom: 1px solid #cbd4df; background: #f3f6f9; }
.w7-agent-note strong { color: #24354a; font-size: 0.82rem; text-transform: uppercase; }
.w7-agent-note span { color: #68778a; font-size: 0.78rem; }
.w7-submit-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.25rem 1.4rem 0.9rem; }
.w7-submit-row > div { display: grid; gap: 0.2rem; }
.w7-submit-row strong { color: #24354a; font-size: 0.88rem; }
.w7-submit-row span { color: #68778a; font-size: 0.76rem; }
.w7-submit-row .btn[disabled] { cursor: wait; opacity: 0.7; }
.w7-form-status { min-height: 1.4rem; margin: 0; padding: 0 1.4rem 1.15rem; text-align: start; }
.w7-form-status.submitting { color: var(--blue); font-weight: 600; }
.w7-form-status:focus { outline: none; }
.w7-honeypot { position: absolute !important; width: 1px !important; height: 1px !important; margin: -1px !important; padding: 0 !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; clip-path: inset(50%) !important; border: 0 !important; white-space: nowrap !important; }
[dir="rtl"] .w7-form input,
[dir="rtl"] .w7-form select,
[dir="rtl"] .w7-form textarea { text-align: right; }
[dir="rtl"] .w7-form input[inputmode="numeric"],
[dir="rtl"] .w7-form input[type="email"],
[dir="rtl"] .w7-form input[type="tel"] { direction: ltr; text-align: left; }

@media (max-width: 760px) {
  .w7-hero-actions { align-items: stretch; flex-direction: column; }
  .w7-hero-actions .btn { width: 100%; }
  .w7-intake-intro { flex-direction: column; }
  .w7-intake-badge { width: 100%; }
  .w7-grid-2, .w7-grid-3 { grid-template-columns: 1fr; gap: 0; }
  .w7-form-header { grid-template-columns: 1fr; }
  .w7-form-number { padding: 0 0 0.65rem; border: 0; border-bottom: 1px solid rgba(255, 255, 255, 0.35); }
  .w7-block { padding: 1.15rem 1rem 1.3rem; }
  .w7-submit-row { align-items: stretch; flex-direction: column; padding: 1.15rem 1rem 0.8rem; }
  .w7-submit-row .btn { width: 100%; }
  .w7-form-status { padding: 0 1rem 1rem; }
}
