/* =========================================================================
   Dynamic Translation & Office Services — Design System
   "Precision Across Languages" — ported from the approved Lovable build.
   Never hardcode colours in templates/widgets; always use these tokens.
   ========================================================================= */

:root {
  --radius: 0.75rem;
  --radius-sm: calc(var(--radius) - 4px);
  --radius-md: calc(var(--radius) - 2px);
  --radius-lg: var(--radius);
  --radius-xl: calc(var(--radius) + 4px);
  --radius-2xl: calc(var(--radius) + 8px);
  --radius-3xl: calc(var(--radius) + 12px);

  --font-display: "Manrope", "Plus Jakarta Sans", system-ui, sans-serif;
  --font-sans: "Inter", system-ui, sans-serif;
  --font-arabic: "IBM Plex Sans Arabic", "Noto Kufi Arabic", system-ui, sans-serif;

  /* Fallbacks first; oklch overrides below reproduce the Lovable values exactly */
  --navy: #24405e;
  --navy-foreground: #fbfcfe;
  --deep: #1b3049;
  --brand: #3d7ab8;
  --brand-foreground: #fbfcfe;
  --bright: #52aede;
  --surface: #f4f7fa;
  --whatsapp: #25d366;
  --whatsapp-foreground: #10321f;

  --background: #ffffff;
  --foreground: #2b3a4f;
  --card: #ffffff;
  --card-foreground: #2b3a4f;
  --primary: #24405e;
  --primary-foreground: #fbfcfe;
  --secondary: #f4f7fa;
  --secondary-foreground: #24405e;
  --muted: #f4f7fa;
  --muted-foreground: #6b7688;
  --accent: #3d7ab8;
  --accent-foreground: #fbfcfe;
  --destructive: #d6453b;
  --destructive-foreground: #fbfcfe;
  --success: #2c9d68;
  --warning: #d99321;
  --border: #dfe6ee;
  --input: #dfe6ee;
  --ring: #3d7ab8;
}

@supports (color: oklch(0.5 0.1 250)) {
  :root {
    --navy: oklch(0.333 0.081 256.9);
    --navy-foreground: oklch(0.99 0.004 236.6);
    --deep: oklch(0.273 0.059 253.1);
    --brand: oklch(0.587 0.136 249.5);
    --brand-foreground: oklch(0.99 0.004 236.6);
    --bright: oklch(0.723 0.121 232.3);
    --surface: oklch(0.976 0.008 236.6);
    --whatsapp: oklch(0.761 0.201 149.7);
    --whatsapp-foreground: oklch(0.24 0.05 160);

    --background: oklch(1 0 0);
    --foreground: oklch(0.315 0.042 258.3);
    --card: oklch(1 0 0);
    --card-foreground: oklch(0.315 0.042 258.3);
    --primary: oklch(0.333 0.081 256.9);
    --primary-foreground: oklch(0.99 0.004 236.6);
    --secondary: oklch(0.976 0.008 236.6);
    --secondary-foreground: oklch(0.333 0.081 256.9);
    --muted: oklch(0.976 0.008 236.6);
    --muted-foreground: oklch(0.544 0.035 265.1);
    --accent: oklch(0.587 0.136 249.5);
    --accent-foreground: oklch(0.99 0.004 236.6);
    --destructive: oklch(0.576 0.209 29.5);
    --destructive-foreground: oklch(0.99 0.004 236.6);
    --success: oklch(0.619 0.137 157.8);
    --warning: oklch(0.703 0.147 69.3);
    --border: oklch(0.917 0.015 244.7);
    --input: oklch(0.917 0.015 244.7);
    --ring: oklch(0.587 0.136 249.5);
  }
}

:root {
  --gradient-navy: linear-gradient(140deg, #1b3049 0%, #24405e 55%, #2b4d70 100%);
  --gradient-brand: linear-gradient(100deg, #3d7ab8 0%, #52aede 100%);
  --gradient-surface: linear-gradient(180deg, #ffffff 0%, #f4f7fa 100%);
  --grid-line: rgba(223, 230, 238, 0.9);
  --grid-line-dark: rgba(251, 252, 254, 0.07);

  --shadow-soft: 0 1px 2px rgba(36, 64, 94, 0.06), 0 8px 24px rgba(36, 64, 94, 0.07);
  --shadow-lift: 0 2px 4px rgba(36, 64, 94, 0.06), 0 18px 44px rgba(36, 64, 94, 0.14);
  --shadow-glow: 0 0 0 1px rgba(82, 174, 222, 0.28), 0 22px 60px rgba(27, 48, 73, 0.45);
}

@supports (color: oklch(0.5 0.1 250)) {
  :root {
    --gradient-navy: linear-gradient(140deg, oklch(0.273 0.059 253.1) 0%, oklch(0.333 0.081 256.9) 55%, oklch(0.38 0.1 253) 100%);
    --gradient-brand: linear-gradient(100deg, oklch(0.587 0.136 249.5) 0%, oklch(0.723 0.121 232.3) 100%);
    --gradient-surface: linear-gradient(180deg, oklch(1 0 0) 0%, oklch(0.976 0.008 236.6) 100%);
    --grid-line: oklch(0.917 0.015 244.7 / 0.9);
    --grid-line-dark: oklch(0.99 0.004 236.6 / 0.07);
    --shadow-soft: 0 1px 2px oklch(0.333 0.081 256.9 / 0.06), 0 8px 24px oklch(0.333 0.081 256.9 / 0.07);
    --shadow-lift: 0 2px 4px oklch(0.333 0.081 256.9 / 0.06), 0 18px 44px oklch(0.333 0.081 256.9 / 0.14);
    --shadow-glow: 0 0 0 1px oklch(0.723 0.121 232.3 / 0.28), 0 22px 60px oklch(0.273 0.059 253.1 / 0.45);
  }
}

/* ---------------------------------------------------------------- base -- */

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body.d4t {
  margin: 0;
  background-color: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

[dir="rtl"] body.d4t { font-family: var(--font-arabic); }

body.d4t h1, body.d4t h2, body.d4t h3, body.d4t h4 {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
  line-height: 1.1;
  font-weight: 700;
  color: var(--navy);
  margin: 0;
}

[dir="rtl"] body.d4t h1, [dir="rtl"] body.d4t h2,
[dir="rtl"] body.d4t h3, [dir="rtl"] body.d4t h4 {
  font-family: var(--font-arabic);
  letter-spacing: 0;
  line-height: 1.3;
}

body.d4t p { margin: 0; }
body.d4t ul, body.d4t ol { margin: 0; padding: 0; list-style: none; }
body.d4t a { color: inherit; text-decoration: none; }
body.d4t img { max-width: 100%; height: auto; display: block; }
body.d4t address { font-style: normal; }
body.d4t button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
body.d4t input, body.d4t textarea, body.d4t select { font: inherit; color: inherit; }

::selection { background: var(--bright); color: var(--navy); }

.d4t :focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.d4t-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;
}

.d4t-skip-link {
  position: absolute; inset-inline-start: 1rem; top: -100px; z-index: 999;
  background: var(--brand); color: var(--brand-foreground);
  padding: 0.75rem 1.25rem; border-radius: var(--radius); font-weight: 600;
  transition: top 0.2s;
}
.d4t-skip-link:focus { top: 1rem; }

/* ---------------------------------------------------------- utilities -- */

.container-page {
  width: 100%;
  margin-inline: auto;
  max-width: 80rem;
  padding-inline: 1.25rem;
}

.section-y { padding-block: clamp(3.5rem, 7vw, 7rem); }
.section-y-sm { padding-block: clamp(2.5rem, 4.5vw, 4.5rem); }

.surface-navy { background: var(--gradient-navy); color: var(--navy-foreground); }
.bg-surface { background-color: var(--surface); }
.bg-deep { background-color: var(--deep); color: var(--navy-foreground); }
.bg-card { background-color: var(--card); }
.relative { position: relative; }
.overflow-hidden { overflow: hidden; }

.text-gradient-brand {
  background: var(--gradient-brand);
  background-clip: text; -webkit-background-clip: text; color: transparent;
}

.grid-pattern {
  background-image:
    linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-size: 56px 56px;
}
.grid-pattern-dark {
  background-image:
    linear-gradient(to right, var(--grid-line-dark) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line-dark) 1px, transparent 1px);
  background-size: 56px 56px;
}
.pattern-layer { position: absolute; inset: 0; pointer-events: none; }
.pattern-70 { opacity: 0.7; }
.pattern-60 { opacity: 0.6; }

.eyebrow {
  font-family: var(--font-display);
  font-size: 0.8125rem; font-weight: 700;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--brand); margin: 0;
}
.eyebrow.on-dark { color: var(--bright); }
[dir="rtl"] .eyebrow { letter-spacing: 0; font-family: var(--font-arabic); }

.display-1 {
  font-family: var(--font-display);
  font-size: clamp(2.375rem, 5.2vw, 4.25rem);
  line-height: 1.04; font-weight: 800; letter-spacing: -0.03em;
}
.display-2 {
  font-family: var(--font-display);
  font-size: clamp(1.875rem, 3.4vw, 3rem);
  line-height: 1.1; font-weight: 700; letter-spacing: -0.025em;
}
.display-3 {
  font-family: var(--font-display);
  font-size: clamp(1.375rem, 2vw, 2rem);
  line-height: 1.2; font-weight: 700;
}
.display-3.is-xl { font-size: 1.25rem; }
[dir="rtl"] .display-1, [dir="rtl"] .display-2, [dir="rtl"] .display-3 {
  font-family: var(--font-arabic); letter-spacing: 0; line-height: 1.3;
}

.lede {
  font-size: clamp(1.0625rem, 1.3vw, 1.1875rem);
  color: var(--muted-foreground);
  max-width: 62ch;
}
.lede.on-dark { color: rgba(251, 252, 254, 0.72); }

.text-muted { color: var(--muted-foreground); }
.text-navy { color: var(--navy); }
.text-brand { color: var(--brand); }
.text-bright { color: var(--bright); }
.text-light { color: var(--navy-foreground); }
.text-light-70 { color: rgba(251, 252, 254, 0.7); }
.text-light-85 { color: rgba(251, 252, 254, 0.85); }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.font-display { font-family: var(--font-display); }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }

.hairline {
  height: 1px;
  background: linear-gradient(to right, transparent, var(--border), transparent);
}

/* ------------------------------------------------------------ buttons -- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  border-radius: var(--radius); padding: 0.875rem 1.5rem;
  font-size: 0.875rem; font-weight: 600; font-family: var(--font-sans);
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.25s,
    border-color 0.25s, color 0.25s, box-shadow 0.25s;
  white-space: nowrap; cursor: pointer; border: 1px solid transparent;
  text-align: center;
}
[dir="rtl"] .btn { font-family: var(--font-arabic); }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn-brand { background: var(--gradient-brand); color: var(--brand-foreground); box-shadow: var(--shadow-soft); }
.btn-brand.btn-glow { box-shadow: var(--shadow-glow); }
.btn-whatsapp { background: var(--whatsapp); color: var(--whatsapp-foreground); }
.btn-outline { border-color: var(--border); color: var(--navy); background: var(--background); }
.btn-outline:hover { border-color: var(--brand); color: var(--brand); }
.btn-outline-light { border-color: rgba(251, 252, 254, 0.25); color: var(--navy-foreground); }
.btn-outline-light:hover { border-color: var(--bright); color: var(--bright); }
.btn-sm { padding: 0.625rem 1rem; font-size: 0.8125rem; }
.btn-lg { padding: 1rem 1.75rem; }
.btn-block { width: 100%; }

.link-brand {
  display: inline-flex; align-items: center; gap: 0.375rem;
  font-size: 0.875rem; font-weight: 600; color: var(--brand);
}
.link-brand .ico { transition: transform 0.25s; }
.link-brand:hover .ico { transform: translateX(4px); }
[dir="rtl"] .link-brand .ico { transform: scaleX(-1); }
[dir="rtl"] .link-brand:hover .ico { transform: scaleX(-1) translateX(4px); }

/* -------------------------------------------------------------- cards -- */

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
}
.card-lift { transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s; }
.card-lift:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); }

.icon-badge {
  display: grid; place-items: center;
  width: 2.25rem; height: 2.25rem; flex-shrink: 0;
  border-radius: var(--radius-md);
  background: var(--surface); color: var(--brand);
}
.icon-badge-lg { width: 3rem; height: 3rem; border-radius: var(--radius-xl); }
.icon-badge-xl { width: 3.5rem; height: 3.5rem; border-radius: var(--radius-2xl); }
.icon-badge-bright { background: rgba(82, 174, 222, 0.15); color: var(--bright); }

/* --------------------------------------------------------- animations -- */

/*
 * Scroll reveal is opt-in on JavaScript being available. The hidden state is
 * scoped to `html.js`, which is set by an inline script in the head, so if the
 * script fails or is blocked the content renders normally instead of leaving
 * the page blank.
 */
.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}
.js .reveal.is-revealed { opacity: 1; transform: none; will-change: auto; }

@keyframes d4t-flow-line { 0% { stroke-dashoffset: 400; } 100% { stroke-dashoffset: 0; } }
@keyframes d4t-float-soft { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes d4t-marquee-x { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes d4t-spin { to { transform: rotate(360deg); } }
@keyframes d4t-fade-in { from { opacity: 0; } to { opacity: 1; } }

.animate-float { animation: d4t-float-soft 6s ease-in-out infinite; }
.animate-spin { animation: d4t-spin 1s linear infinite; display: inline-block; }

.underline-anim { position: relative; }
.underline-anim::after {
  content: ""; position: absolute; inset-inline-start: 0; bottom: -2px;
  height: 1.5px; width: 0; background: var(--gradient-brand);
  transition: width 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.underline-anim:hover::after { width: 100%; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .js .reveal { opacity: 1 !important; transform: none !important; }
  .btn:hover, .card-lift:hover { transform: none; }
}

/* --------------------------------------------------------------- icons -- */

.d4t-ico { width: 1rem; height: 1rem; flex-shrink: 0; display: inline-block; vertical-align: middle; }
.d4t-ico.ico-lg { width: 1.25rem; height: 1.25rem; }
.d4t-ico.ico-xl { width: 1.5rem; height: 1.5rem; }
.d4t-ico.ico-2xl { width: 2rem; height: 2rem; }
