/* CarPlus public pages. Colors match the app theme (src/theme/variables.scss). */

:root {
  --navy: #041b44;
  --orange: #f64c32;
  --orange-text: #c7361f;
  --bg: #f2f4f8;
  --surface: #ffffff;
  --text: #0e1a33;
  --muted: #56617a;
  --border: rgba(4, 27, 68, 0.12);
  --radius: 16px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1120;
    --surface: #141b2b;
    --text: #eef1f7;
    --muted: #a3adc2;
    --border: rgba(255, 255, 255, 0.1);
    --orange-text: #ff7a63;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Cairo', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 1rem;
  line-height: 1.7;
}

a { color: var(--orange-text); }

/* Only the section for the active language is shown. Without JS, <html lang="en"> shows English. */
[data-lang] { display: none; }
html[lang="en"] [data-lang="en"],
html[lang="fr"] [data-lang="fr"],
html[lang="ar"] [data-lang="ar"] { display: block; }
html[lang="en"] span[data-lang="en"],
html[lang="fr"] span[data-lang="fr"],
html[lang="ar"] span[data-lang="ar"] { display: inline; }

/* Header */
.header {
  background: var(--navy);
  color: #fff;
}
.header__inner {
  max-width: 880px;
  margin: 0 auto;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.header__logo img { display: block; height: 40px; width: auto; }

.langs { display: flex; gap: 4px; }
.langs button {
  font: inherit;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.8);
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  padding: 2px 12px;
  cursor: pointer;
}
.langs button[aria-pressed="true"] { background: var(--orange); border-color: var(--orange); color: #fff; }

.nav {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 16px 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  font-size: 0.9375rem;
}
.nav a { color: rgba(255, 255, 255, 0.8); text-decoration: none; }
.nav a:hover { color: #fff; }
.nav a[aria-current="page"] { color: #fff; font-weight: 700; box-shadow: inset 0 -2px var(--orange); }

/* Content */
main {
  max-width: 880px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
@media (max-width: 480px) { .card { padding: 18px; } }

h1 { font-size: 1.75rem; line-height: 1.3; margin: 0 0 4px; }
h2 { font-size: 1.1875rem; line-height: 1.4; margin: 28px 0 8px; }
h3 { font-size: 1rem; margin: 18px 0 4px; }
p, ul, ol { margin: 0 0 12px; }
ul, ol { padding-inline-start: 22px; }
li { margin-bottom: 4px; }

.updated { color: var(--muted); font-size: 0.875rem; margin-bottom: 20px; }
.lead { font-size: 1.0625rem; }
.muted { color: var(--muted); }

.table-wrap { overflow-x: auto; margin: 0 0 12px; }
table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
th, td { text-align: start; vertical-align: top; padding: 8px 10px; border-bottom: 1px solid var(--border); }
th { font-weight: 700; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-top: 20px; }
.tile {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  color: inherit;
  text-decoration: none;
}
.tile:hover { border-color: var(--orange); }
.tile strong { display: block; font-size: 1.0625rem; }
.tile span { color: var(--muted); font-size: 0.9375rem; }

.contact-list { list-style: none; padding: 0; }
.contact-list li { margin-bottom: 8px; }
.contact-list strong { display: inline-block; min-width: 110px; }

.callout {
  border-inline-start: 4px solid var(--orange);
  background: rgba(246, 76, 50, 0.08);
  border-radius: 8px;
  padding: 12px 16px;
  margin: 0 0 16px;
}

/* Form */
form { display: grid; gap: 14px; margin-top: 8px; }
label { display: grid; gap: 4px; font-weight: 600; font-size: 0.9375rem; }
input, textarea {
  font: inherit;
  font-weight: 400;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  width: 100%;
}
input:focus, textarea:focus { outline: 2px solid var(--orange); outline-offset: 1px; }
.phone { display: flex; align-items: stretch; direction: ltr; }
.phone span {
  display: flex; align-items: center;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-inline-end: 0;
  border-radius: 10px 0 0 10px;
  color: var(--muted);
}
.phone input { border-radius: 0 10px 10px 0; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.check input { width: auto; margin-top: 6px; }
.error { color: var(--orange-text); font-size: 0.875rem; margin: 0; min-height: 1.2em; }

.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.btn {
  font: inherit;
  font-weight: 700;
  border: 0;
  border-radius: 12px;
  padding: 10px 18px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn--primary { background: var(--orange); color: #fff; }
.btn--secondary { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

footer {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 16px 32px;
  color: var(--muted);
  font-size: 0.875rem;
}
footer a { color: inherit; }

html[dir="rtl"] .contact-list strong { min-width: 90px; }

/* Home page */
.hero { padding: 16px 0 8px; }
.hero h1 { font-size: 2.25rem; margin-bottom: 8px; }
@media (max-width: 480px) { .hero h1 { font-size: 1.875rem; } }
.hero .lead { max-width: 620px; }

.stores { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.stores [hidden] { display: none; }

.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.feature {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}
.feature strong { display: block; font-size: 1.0625rem; }
.feature span { color: var(--muted); font-size: 0.9375rem; }

.steps { list-style: none; padding: 0; counter-reset: step; display: grid; gap: 14px; }
.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 36px 1fr;
  column-gap: 12px;
  margin: 0;
}
.steps li::before {
  content: counter(step);
  grid-row: span 2;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--orange);
  color: #fff;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.steps strong { display: block; }
.steps span { color: var(--muted); font-size: 0.9375rem; }

.cta { margin-top: 28px; }
.cta h2 { margin-top: 0; }
.cta p { margin: 0; }
