/*
 * Darqora landing page. Colours and type follow the Darqora brand kit:
 * deep teal is the primary, amber is the light in the doorway (accent only,
 * never text), Sora for everything.
 */
:root {
  --teal-900: #0a3539;
  --teal-800: #0E4A4F;   /* Deep teal, primary */
  --teal-600: #2F8A8F;   /* Teal */
  --teal-300: #7CC4C6;   /* Light teal, on dark */
  --teal-100: #dceeee;
  --teal-50: #eff7f7;
  --amber: #F2A33A;
  --amber-soft: #fdf0dc;

  --canvas: #ffffff;
  --tint: #f3f8f8;
  --ink: #102528;
  --ink-muted: #4c6265;
  --line: #d9e6e6;

  --success: #2c7845;
  --success-soft: #e1f0e5;
  --warning: #8a5a0b;
  --warning-soft: #fbefd6;
  --danger: #b0372f;
  --danger-soft: #f8e2df;

  --radius: 14px;
  --radius-lg: 20px;
  --shadow: 0 1px 2px rgba(14, 74, 79, .06), 0 8px 24px rgba(14, 74, 79, .08);
  --shadow-lg: 0 2px 4px rgba(14, 74, 79, .08), 0 24px 60px rgba(14, 74, 79, .18);
  --wrap: 1140px;
  color-scheme: light;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 80px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: "Sora", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--teal-600); }
a:hover { color: var(--teal-800); }
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.025em; margin: 0 0 .6em; color: var(--teal-800); }
h1 { font-size: clamp(2.2rem, 4.6vw, 3.5rem); font-weight: 700; }
h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); font-weight: 600; }
h3 { font-size: 1.08rem; font-weight: 600; }
p { margin: 0 0 1em; }

:focus-visible { outline: 3px solid var(--teal-300); outline-offset: 2px; border-radius: 6px; }

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

.skip-link { position: absolute; left: -9999px; top: 8px; background: var(--teal-800); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip-link:focus { left: 16px; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .78rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--teal-600); margin-bottom: 14px;
}
.eyebrow::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--amber); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font: inherit; font-weight: 600; font-size: .98rem;
  padding: 13px 24px; border-radius: 999px; border: 2px solid transparent;
  text-decoration: none; cursor: pointer; transition: background .15s, color .15s, border-color .15s, transform .15s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--teal-800); color: #fff; }
.btn-primary:hover { background: var(--teal-900); color: #fff; }
.btn-ghost { background: transparent; color: var(--teal-800); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--teal-600); color: var(--teal-800); }
.btn-sm { padding: 9px 18px; font-size: .9rem; }
.btn-block { width: 100%; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .9);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; height: 70px; }
.brand img { width: 150px; }
.site-nav { display: flex; gap: 28px; }
.site-nav a { color: var(--ink-muted); text-decoration: none; font-size: .94rem; font-weight: 500; }
.site-nav a:hover { color: var(--teal-800); }

/* Hero */
.hero {
  padding: 72px 0 96px;
  background:
    radial-gradient(900px 420px at 85% 10%, var(--teal-50), transparent 70%),
    radial-gradient(500px 300px at 10% 90%, var(--amber-soft), transparent 70%);
}
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: center; }
.lead { font-size: 1.15rem; color: var(--ink-muted); max-width: 34em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 30px 0 28px; }
.hero-points { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 10px 22px; color: var(--ink-muted); font-size: .9rem; }
.hero-points li { display: flex; align-items: center; gap: 8px; }
.hero-points li::before {
  content: ""; width: 16px; height: 16px; flex: none; border-radius: 50%;
  background: var(--teal-100) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 8.2l2.2 2.2 4.8-4.8' fill='none' stroke='%230E4A4F' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/12px no-repeat;
}

/* Product preview (illustration) */
.preview { perspective: 1600px; }
.preview-window {
  display: grid; grid-template-columns: 56px 1fr;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); overflow: hidden;
  transform: rotateY(-6deg) rotateX(3deg);
}
@media (prefers-reduced-motion: reduce) { .preview-window { transform: none; } }
.preview-rail { background: var(--teal-800); display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 16px 0; }
.preview-rail img { margin-bottom: 8px; }
.rail-item { width: 24px; height: 6px; border-radius: 3px; background: rgba(124, 196, 198, .35); }
.rail-item.is-active { background: var(--teal-300); }
.preview-body { padding: 18px 20px 20px; background: var(--tint); }
.preview-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.preview-title { font-weight: 600; color: var(--teal-800); }
.preview-chip { font-size: .72rem; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; color: var(--ink-muted); }
.preview-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stat-label { font-size: .68rem; color: var(--ink-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-value { font-size: 1.15rem; font-weight: 700; color: var(--teal-800); font-variant-numeric: tabular-nums; }
.stat-note { font-size: .66rem; color: var(--ink-muted); }
.stat-note.up { color: var(--success); }
.meter { height: 5px; border-radius: 3px; background: var(--teal-100); margin-top: 6px; overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--teal-600); }
.preview-chart {
  display: flex; align-items: flex-end; gap: 6px; height: 110px;
  background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 14px 14px 10px; margin-bottom: 12px;
}
.preview-chart span { flex: 1; background: var(--teal-100); border-radius: 4px 4px 0 0; }
.preview-chart span.is-current { background: var(--teal-800); }
.preview-tasks { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 6px 12px; }
.task { display: flex; align-items: center; gap: 10px; font-size: .78rem; padding: 7px 0; border-bottom: 1px solid var(--line); }
.task:last-child { border-bottom: 0; }
.task-meta { margin-left: auto; color: var(--ink-muted); font-size: .72rem; white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dot.amber { background: var(--amber); }
.dot.teal { background: var(--teal-600); }

/* Sections */
.section { padding: 96px 0; }
.section-tint { background: var(--tint); }
.section-dark { background: var(--teal-800); color: rgba(255, 255, 255, .86); }
.section-dark h2 { color: #fff; }
.section-dark .eyebrow { color: var(--teal-300); }
.section-head { max-width: 720px; margin-bottom: 48px; }
.section-head p { color: var(--ink-muted); font-size: 1.05rem; }

/* Chain of records */
.chain { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; counter-reset: none; }
.chain li {
  position: relative; background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 20px; box-shadow: var(--shadow);
}
.chain li:not(:last-child)::after {
  content: ""; position: absolute; top: 34px; right: -17px; width: 18px; height: 2px; background: var(--teal-300);
}
.chain-step { display: inline-block; font-size: .78rem; font-weight: 600; color: var(--teal-600); background: var(--teal-50); border-radius: 999px; padding: 2px 10px; margin-bottom: 14px; }
.chain p { color: var(--ink-muted); font-size: .92rem; margin: 0; }

/* Split layout */
.split { display: grid; grid-template-columns: .9fr 1.1fr; gap: 56px; align-items: start; }
.split-copy p { color: var(--ink-muted); font-size: 1.05rem; }
.section-dark .split-copy p { color: rgba(255, 255, 255, .78); }
.split-copy .btn { margin-top: 8px; }
.split-reverse .split-copy { order: 2; }

.card-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.card h3 { display: flex; align-items: center; gap: 10px; }
.card h3::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--teal-600); flex: none; }
.card p { color: var(--ink-muted); font-size: .94rem; margin: 0; }

.feature-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 1px solid var(--line); }
.feature { padding: 28px 28px 28px 0; border-bottom: 1px solid var(--line); }
.feature:not(:nth-child(3n+1)) { padding-left: 28px; border-left: 1px solid var(--line); }
.feature p { color: var(--ink-muted); font-size: .94rem; margin: 0; }

.check-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.check-list li {
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(124, 196, 198, .25); border-radius: var(--radius);
  padding: 18px 20px 18px 52px; position: relative;
}
.check-list li::before {
  content: ""; position: absolute; left: 20px; top: 21px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--amber) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 8.2l2.2 2.2 4.8-4.8' fill='none' stroke='%230E4A4F' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/13px no-repeat;
}
.check-list strong { color: #fff; font-weight: 600; }

/* Contact */
.contact-grid { display: grid; grid-template-columns: .85fr 1.15fr; gap: 56px; align-items: start; }
.contact-copy p { color: var(--ink-muted); font-size: 1.05rem; }
.contact-mail { font-weight: 500; }
.contact-mail a { font-weight: 600; }
.contact-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 32px; box-shadow: var(--shadow-lg); }
.contact-form { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-full { grid-column: 1 / -1; }
.field label { font-size: .86rem; font-weight: 600; color: var(--ink); }
.field input, .field select, .field textarea {
  font: inherit; font-size: .95rem; color: var(--ink);
  background: #fff; border: 1px solid #c4d4d4; border-radius: 10px; padding: 11px 13px; width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
.field textarea { resize: vertical; min-height: 120px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--teal-600); box-shadow: 0 0 0 4px rgba(47, 138, 143, .18); }
.field textarea::placeholder { color: #8aa0a2; }

.captcha-slot { min-height: 78px; display: flex; justify-content: center; align-items: center; }
.captcha-slot:empty::before { content: "Captcha loads when needed"; color: var(--ink-muted); font-size: .84rem; }
.captcha-slot.is-ready:empty::before { content: ""; }

.alert { border-radius: 10px; padding: 12px 16px; margin-bottom: 18px; font-size: .94rem; border: 1px solid transparent; }
.alert-success { background: var(--success-soft); color: var(--success); border-color: rgba(44, 120, 69, .25); }
.alert-warning { background: var(--warning-soft); color: var(--warning); border-color: rgba(138, 90, 11, .25); }
.alert-danger { background: var(--danger-soft); color: var(--danger); border-color: rgba(176, 55, 47, .25); }

/* Footer */
.site-footer { background: var(--teal-900); color: rgba(255, 255, 255, .7); padding: 48px 0; font-size: .9rem; }
.footer-inner { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.footer-inner img { margin-bottom: 6px; }
.site-footer p { margin: 0; }
.site-footer a { color: var(--teal-300); }
.site-footer a:hover { color: #fff; }
.copyright { font-size: .8rem; color: rgba(255, 255, 255, .5); }

/* Responsive */
@media (max-width: 1020px) {
  .chain { grid-template-columns: repeat(3, 1fr); }
  .chain li:nth-child(3)::after { display: none; }
  .feature-list { grid-template-columns: repeat(2, 1fr); }
  .feature, .feature:not(:nth-child(3n+1)) { padding: 24px 24px 24px 0; border-left: 0; }
  .feature:nth-child(2n) { padding-left: 24px; border-left: 1px solid var(--line); }
}

@media (max-width: 880px) {
  .site-nav { display: none; }
  .hero { padding: 48px 0 72px; }
  .hero-grid, .split, .contact-grid { grid-template-columns: 1fr; gap: 40px; }
  .split-reverse .split-copy { order: 0; }
  .preview-window { transform: none; }
  .section { padding: 72px 0; }
}

@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .header-inner { height: 62px; }
  .brand img { width: 124px; }
  .chain { grid-template-columns: 1fr; }
  .chain li::after { display: none; }
  .card-grid, .feature-list { grid-template-columns: 1fr; }
  .feature, .feature:nth-child(2n) { padding: 22px 0; border-left: 0; }
  .contact-form { grid-template-columns: 1fr; }
  .contact-card { padding: 22px 18px; }
  .preview-window { grid-template-columns: 40px 1fr; }
  .preview-rail img { width: 22px; height: 22px; }
  .rail-item { width: 18px; }
  .preview-body { padding: 14px; }
  .preview-stats { gap: 6px; }
  .stat { padding: 8px; }
  .stat-value { font-size: .95rem; }
  .stat-note { display: none; }
  .hero-actions .btn { flex: 1 1 auto; }
}

/* FAQ */
.faq-wrap { max-width: 860px; }
#faq { padding-top: 24px; }
.faq-list { border-top: 1px solid var(--line); }
.faq-list details { border-bottom: 1px solid var(--line); }
.faq-list summary {
  list-style: none; cursor: pointer; position: relative;
  padding: 20px 40px 20px 0; font-weight: 600; color: var(--teal-800); font-size: 1.04rem;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
  content: ""; position: absolute; right: 6px; top: 50%; width: 10px; height: 10px; margin-top: -7px;
  border-right: 2px solid var(--teal-600); border-bottom: 2px solid var(--teal-600);
  transform: rotate(45deg); transition: transform .2s;
}
.faq-list details[open] summary::after { transform: rotate(-135deg); margin-top: -2px; }
.faq-list details p { color: var(--ink-muted); margin: 0 0 20px; max-width: 46em; }

.card-grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 1020px) { .card-grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .card-grid-3 { grid-template-columns: 1fr; } }

/* Language switch */
.header-actions { display: flex; align-items: center; gap: 14px; }
.lang-switch { color: var(--teal-800); font-weight: 600; font-size: .92rem; text-decoration: none; padding: 6px 4px; }
.lang-switch:hover { color: var(--teal-600); text-decoration: underline; }
.lang-switch[lang="ar"] { font-family: "IBM Plex Sans Arabic", "SF Arabic", "Geeza Pro", "Noto Sans Arabic", "Segoe UI", Tahoma, sans-serif; }

/* Arabic (right-to-left) */
html[dir="rtl"] body { font-family: "IBM Plex Sans Arabic", "Sora", "SF Arabic", "Geeza Pro", "Noto Sans Arabic", "Segoe UI", Tahoma, sans-serif; line-height: 1.75; }
/* Letter-spacing breaks the joins between Arabic letters */
html[dir="rtl"] h1, html[dir="rtl"] h2, html[dir="rtl"] h3,
html[dir="rtl"] .eyebrow { letter-spacing: 0; }
html[dir="rtl"] h1, html[dir="rtl"] h2 { line-height: 1.3; }
html[dir="rtl"] .eyebrow { text-transform: none; font-size: .9rem; }
html[dir="rtl"] .skip-link { left: auto; right: -9999px; }
html[dir="rtl"] .skip-link:focus { right: 16px; }
html[dir="rtl"] .preview-window { transform: rotateY(6deg) rotateX(3deg); }
html[dir="rtl"] .task-meta { margin-left: 0; margin-right: auto; }
html[dir="rtl"] .chain li:not(:last-child)::after { right: auto; left: -17px; }
html[dir="rtl"] .feature { padding: 28px 0 28px 28px; }
html[dir="rtl"] .feature:not(:nth-child(3n+1)) { padding-left: 28px; padding-right: 28px; border-left: 0; border-right: 1px solid var(--line); }
html[dir="rtl"] .check-list li { padding: 18px 52px 18px 20px; }
html[dir="rtl"] .check-list li::before { left: auto; right: 20px; }
html[dir="rtl"] .faq-list summary { padding: 20px 0 20px 40px; }
html[dir="rtl"] .faq-list summary::after { right: auto; left: 6px; }
html[dir="rtl"] .field input[type="email"] { text-align: left; }

@media (max-width: 1020px) {
  html[dir="rtl"] .feature, html[dir="rtl"] .feature:not(:nth-child(3n+1)) { padding: 24px 0 24px 24px; border-right: 0; }
  html[dir="rtl"] .feature:nth-child(2n) { padding-right: 24px; border-right: 1px solid var(--line); }
}
@media (max-width: 880px) {
  html[dir="rtl"] .preview-window { transform: none; }
}
@media (max-width: 640px) {
  .header-actions { gap: 10px; }
  html[dir="rtl"] .feature, html[dir="rtl"] .feature:nth-child(2n) { padding: 22px 0; border-right: 0; }
}
.btn .label-short { display: none; }
html[dir="rtl"] .captcha-slot:empty::before { content: "يتم تحميل التحقق عند الحاجة"; }
@media (max-width: 640px) {
  .btn .label-long { display: none; }
  .btn .label-short { display: inline; }
}

/* Small phones: keep logo, language switch and button on one line */
@media (max-width: 400px) {
  .brand img { width: 108px; }
  .header-actions { gap: 8px; }
  .lang-switch { font-size: .86rem; padding: 6px 2px; }
  .btn-sm { padding: 8px 14px; font-size: .84rem; }
}

/* Error pages (404.html, 500.html) */
.error-page { min-height: 100vh; display: grid; place-items: center; background:
  radial-gradient(700px 360px at 80% 0%, var(--teal-50), transparent 70%),
  radial-gradient(500px 300px at 10% 100%, var(--amber-soft), transparent 70%), var(--canvas); }
.error-wrap { width: 100%; max-width: 560px; padding: 48px 24px; text-align: center; }
.error-logo { display: inline-block; margin-bottom: 28px; }
.error-logo img { width: 170px; }
.error-code { font-size: clamp(4.5rem, 18vw, 7rem); font-weight: 700; line-height: 1; letter-spacing: -0.04em; color: var(--teal-800); margin: 0 0 18px; }
.error-copy h1, .error-copy h2 { font-size: 1.45rem; font-weight: 600; margin-bottom: .4em; }
.error-copy p { color: var(--ink-muted); }
.error-copy[dir="rtl"] { font-family: "IBM Plex Sans Arabic", "SF Arabic", "Geeza Pro", "Noto Sans Arabic", "Segoe UI", Tahoma, sans-serif; margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--line); }
.error-copy[dir="rtl"] h2 { letter-spacing: 0; }
.error-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin: 28px 0 18px; }
.btn[lang="ar"] { font-family: "IBM Plex Sans Arabic", "SF Arabic", "Geeza Pro", "Noto Sans Arabic", "Segoe UI", Tahoma, sans-serif; }
.error-help { font-size: .9rem; color: var(--ink-muted); margin: 0; }
