/* =========================
   RepVisit — main stylesheet
   Palette derived from the app screenshots:
   navy/royal blue primary, light lavender backgrounds,
   green for "navigate" actions, dark red for "end" actions.
   ========================= */

:root {
  --brand: #1e40af;            /* royal/navy blue — primary buttons, links */
  --brand-dark: #1e3a8a;       /* deeper navy — hover/active */
  --brand-darker: #172554;     /* darkest navy — footer/headings accent */
  --brand-light: #eef0fa;      /* very light lavender-blue — tab bg, chip bg */
  --brand-soft: #e0e7ff;       /* soft indigo for borders/halos */
  --accent: #2563eb;           /* brighter blue accent */
  --success: #10b981;          /* navigate / next visit green */
  --success-dark: #059669;
  --danger: #991b1b;           /* end day / end visit dark red */
  --warn: #f59e0b;             /* star / pending */

  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #ffffff;
  --bg-alt: #f6f7fb;

  --radius: 14px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 10px 25px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 20px 45px rgba(15, 23, 42, 0.12);
  --max: 1120px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-ar: "SF Arabic", "Geeza Pro", "Tahoma", "Segoe UI", "Noto Sans Arabic", "Cairo", system-ui, sans-serif;
}

/* Arabic / RTL */
[lang="ar"], [dir="rtl"] {
  font-family: var(--font-ar);
}
[dir="rtl"] .hero h1,
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3, [dir="rtl"] h4 {
  letter-spacing: 0;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; display: block; }

a {
  color: var(--brand);
  text-decoration: none;
  transition: color .15s ease;
}
a:hover { color: var(--brand-dark); }

.container {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 20px;
}

/* ----- Header / Nav ----- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,0.88);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 700;
}
.brand:hover { color: var(--ink); }
.brand-logo { width: 32px; height: 32px; border-radius: 22%; }
.brand-name { font-size: 1.15rem; letter-spacing: -0.01em; }

.nav {
  display: flex;
  align-items: center;
  gap: 22px;
}
.nav-link {
  color: var(--ink-2);
  font-weight: 500;
  font-size: 0.95rem;
}
.nav-link:hover { color: var(--brand-dark); }
.nav-link.active { color: var(--brand); }

/* Language switcher icon button */
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-2);
  font-size: 0.82rem;
  font-weight: 600;
  background: #fff;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.lang-switch:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-light);
}
.lang-switch svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.nav-toggle {
  display: none;
  background: none;
  border: 0;
  width: 36px;
  height: 36px;
  cursor: pointer;
  flex-direction: column;
  gap: 5px;
  justify-content: center;
  align-items: center;
}
.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--ink);
  display: block;
  border-radius: 2px;
}

/* ----- Buttons ----- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .06s ease, background .15s ease, color .15s ease, border-color .15s ease, box-shadow .15s ease;
  text-align: center;
}
.btn-sm { padding: 8px 14px; font-size: 0.875rem; }
.btn-primary {
  background: var(--brand);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { background: var(--brand-dark); color: #fff; }
.btn-primary:active { transform: translateY(1px); }
.btn-ghost {
  background: transparent;
  color: var(--brand);
  border-color: transparent;
}
.btn-ghost:hover { background: var(--brand-light); }
.btn-outline {
  background: #fff;
  color: var(--ink);
  border-color: var(--line);
}
.btn-outline:hover { border-color: var(--brand); color: var(--brand); }

/* ----- Shared type ----- */
.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brand);
  background: var(--brand-light);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 14px;
}
h1, h2, h3, h4 {
  color: var(--ink);
  line-height: 1.2;
  margin: 0 0 12px;
  letter-spacing: -0.02em;
}
h1 { font-size: clamp(2rem, 4vw, 3rem); }
h2 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); }
h3 { font-size: 1.15rem; }
p  { margin: 0 0 12px; color: var(--ink-2); }
.muted { color: var(--muted); }
.accent { color: var(--brand); }
.lead { font-size: 1.1rem; color: var(--ink-2); }

/* ----- Hero ----- */
.hero {
  padding: 72px 0 56px;
  background:
    radial-gradient(900px 380px at 85% -10%, rgba(37,99,235,0.18), transparent 60%),
    radial-gradient(800px 300px at -10% 30%, rgba(30,64,175,0.10), transparent 60%),
    linear-gradient(180deg, #fff 0%, #f6f7fb 100%);
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 48px;
  align-items: center;
}
.hero-content h1 { margin-bottom: 18px; }
.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 20px 0 18px;
}
.hero-badges {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  color: var(--muted);
  font-size: 0.9rem;
}

/* Mock dashboard card — modeled on the real app's Home screen */
.hero-visual { display: flex; justify-content: center; }
.mock-card {
  width: 100%;
  max-width: 460px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.mock-status {
  background: var(--brand);
  color: #fff;
  border-radius: 14px;
  padding: 14px 16px;
}
.mock-status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  opacity: 0.9;
}
.mock-status h4 {
  color: #fff;
  margin: 4px 0 10px;
  font-size: 1.05rem;
}
.mock-end-day {
  display: block;
  background: var(--danger);
  color: #fff;
  text-align: center;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 0.85rem;
  font-weight: 600;
}
.mock-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.mock-stat {
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
}
.mock-stat .pill-blue {
  background: var(--brand);
  color: #fff;
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 0.72rem;
  font-weight: 700;
}
.mock-stat .pill-green {
  background: var(--success);
  color: #fff;
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 0.72rem;
  font-weight: 700;
}
.mock-stat strong { display: block; margin: 6px 0 2px; font-size: 0.95rem; }
.mock-stat small { color: var(--muted); font-size: 0.78rem; }
.mock-stat .navigate {
  display: block;
  margin-top: 8px;
  background: var(--success);
  color: #fff;
  text-align: center;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 0.78rem;
  font-weight: 600;
}
.mock-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.mock-row strong { display: block; font-size: 0.92rem; }
.mock-row small { color: var(--muted); font-size: 0.78rem; }
.time-chip {
  background: #0f172a;
  color: #fff;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 700;
}
.next-chip {
  background: #d1fae5;
  color: #047857;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 0.72rem;
  font-weight: 700;
  margin-inline-end: 6px;
}

/* ----- Trust strip ----- */
.trust {
  padding: 28px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.trust-text {
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 14px;
}
.trust-logos {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 28px;
  color: var(--ink-2);
  font-weight: 700;
  letter-spacing: 0.04em;
  opacity: 0.75;
}

/* ----- Sections ----- */
.section { padding: 72px 0; }
.section-alt { background: var(--bg-alt); }
.section-head {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 40px;
}
.section-sub { color: var(--muted); font-size: 1.05rem; }

/* Features grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.feature-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.feature-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--brand-soft);
}
.feature-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  background: var(--brand-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 14px;
}

/* Steps */
.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.step {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  text-align: left;
}
.step-num {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

/* Quote */
.quote {
  max-width: 820px;
  margin: 0 auto;
  text-align: center;
  padding: 36px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.quote p { font-size: 1.25rem; color: var(--ink); }
.quote footer { color: var(--muted); font-size: 0.95rem; }

/* CTA */
.cta {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-darker) 100%);
  color: #fff;
  padding: 56px 0;
}
.cta h2 { color: #fff; margin-bottom: 6px; }
.cta p { color: rgba(255,255,255,0.88); margin: 0; }
.cta-wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}
.cta .btn-outline {
  background: transparent;
  color: #fff;
  border-color: rgba(255,255,255,0.5);
}
.cta .btn-outline:hover { background: rgba(255,255,255,0.1); color: #fff; border-color: #fff; }

/* ----- Generic page hero (for sub-pages) ----- */
.page-hero {
  padding: 64px 0 24px;
  background: linear-gradient(180deg, var(--brand-light) 0%, #fff 100%);
  border-bottom: 1px solid var(--line);
}
.page-hero h1 { margin-bottom: 8px; }

/* Two column */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}

/* Prose */
.prose {
  max-width: 780px;
  margin: 0 auto;
}
.prose h2 {
  margin-top: 32px;
  font-size: 1.3rem;
}
.prose ul {
  margin: 0 0 16px;
  padding-inline-start: 22px;
}
.prose li { margin-bottom: 6px; color: var(--ink-2); }

/* ----- Contact ----- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 40px;
  align-items: start;
}
.contact-list {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.contact-list li {
  display: flex;
  flex-direction: column;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.contact-list strong {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 2px;
}

.contact-form {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}
.form-row {
  display: flex;
  flex-direction: column;
  margin-bottom: 14px;
}
.form-row label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 6px;
}
.form-row input,
.form-row select,
.form-row textarea {
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.18);
}
.form-status {
  margin: 12px 0 0;
  font-size: 0.9rem;
  color: var(--success-dark);
}
.form-status.error { color: #b91c1c; }

/* ----- Footer ----- */
.site-footer {
  background: var(--brand-darker);
  color: #c7d2fe;
  padding: 48px 0 24px;
  margin-top: 40px;
}
.site-footer .brand { color: #fff; }
.site-footer .brand:hover { color: #fff; }
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 30px;
}
.site-footer h4 {
  color: #fff;
  margin: 0 0 12px;
  font-size: 0.95rem;
}
.site-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.site-footer li { margin-bottom: 8px; }
.site-footer a { color: #c7d2fe; font-size: 0.92rem; }
.site-footer a:hover { color: #fff; }
.footer-about {
  color: #a5b4fc;
  font-size: 0.92rem;
  max-width: 320px;
  margin-top: 10px;
}
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 16px;
  margin-top: 28px;
  text-align: center;
  color: #a5b4fc;
}

/* ----- Responsive ----- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .two-col,
  .contact-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .nav { display: none; }
  .nav-toggle { display: flex; }
  .nav.open {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    padding: 16px 20px;
    background: #fff;
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-md);
  }
  .features-grid,
  .steps { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .cta-wrap { flex-direction: column; align-items: flex-start; }
  .hero { padding: 48px 0 32px; }
  .section { padding: 48px 0; }
  .mock-stats { grid-template-columns: 1fr; }
}
