/* Nearova public website. Colours follow the app's design tokens (src/frontend/nearova-web/src/theme/tokens.ts).
   Logical properties (inline-start/end) keep the Arabic page mirrored without separate rules. */

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

:root {
  --brand: #b4441e;
  --brand-dark: #8f3416;
  --brand-tint: #f6e6de;
  --teal: #0f766e;
  --teal-tint: #e0efed;
  --teal-light: #5fd3c4;
  --canvas: #faf7f2;
  --paper: #ffffff;
  --ink: #1a1d21;
  --muted: #5a6470;
  --line: rgba(16, 24, 40, 0.1);
  --night: #12161c;
  --night-2: #1b2129;
  --night-ink: #e6edf3;
  --night-muted: #9da7b3;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.1);
  --shadow-lg: 0 28px 56px -16px rgba(16, 24, 40, 0.22), 0 2px 6px rgba(16, 24, 40, 0.06);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-ar: "Segoe UI", "Noto Sans Arabic", "Noto Kufi Arabic", "Geeza Pro", Tahoma, system-ui, sans-serif;
  --wrap: 1160px;
  --header-h: 68px;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 400 1rem/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

html[lang="ar"] body {
  font-family: var(--font-ar);
  line-height: 1.8;
}

svg {
  display: block;
  flex: none;
}

a {
  color: inherit;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

/* Letter-spacing breaks Arabic joining. */
html[lang="ar"] :is(h1, h2, h3, .brand, .eyebrow, .till-course) {
  letter-spacing: 0;
  line-height: 1.45;
}

p {
  margin: 0;
}

.wrap {
  width: min(100% - 2.5rem, var(--wrap));
  margin-inline: auto;
}

.skip {
  position: absolute;
  inset-inline-start: 1rem;
  top: -4rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}

.skip:focus {
  top: 1rem;
}

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

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 50px;
  padding: 0.75rem 1.4rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-weight: 650;
  font-size: 1rem;
  line-height: 1.2;
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn svg {
  width: 18px;
  height: 18px;
}

html[dir="rtl"] .arrow {
  transform: scaleX(-1);
}

.btn-primary {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 8px 18px -8px rgba(180, 68, 30, 0.6);
}

.btn-primary:hover {
  background: var(--brand-dark);
}

.btn-ghost {
  background: var(--paper);
  border-color: var(--line);
  color: var(--ink);
}

.btn-ghost:hover {
  border-color: rgba(16, 24, 40, 0.28);
}

.btn-light {
  background: #fff;
  color: var(--brand-dark);
}

.btn-light:hover {
  background: var(--canvas);
}

.btn-sm {
  min-height: 40px;
  padding: 0.45rem 1rem;
  font-size: 0.95rem;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(250, 247, 242, 0.86);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.nav {
  display: flex;
  gap: 1.75rem;
  margin-inline-start: 1rem;
}

.nav a {
  color: var(--muted);
  font-weight: 550;
  text-decoration: none;
}

.nav a:hover {
  color: var(--ink);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-inline-start: auto;
}

.langs {
  display: flex;
  gap: 0.15rem;
  padding: 0.2rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
}

.langs a {
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 650;
  text-decoration: none;
}

.langs a:hover {
  color: var(--ink);
}

.langs a[aria-current="page"] {
  background: var(--ink);
  color: #fff;
}

.link-signin {
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.link-signin:hover {
  color: var(--brand);
}

@media (max-width: 920px) {
  .nav {
    display: none;
  }
}

@media (max-width: 640px) {
  .header-cta {
    display: none;
  }
}

@media (max-width: 420px) {
  .link-signin {
    display: none;
  }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(3rem, 7vw, 6rem) 0 clamp(3rem, 6vw, 5rem);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("/pattern.svg") repeat;
  -webkit-mask-image: radial-gradient(ellipse 60% 70% at 78% 40%, #000 15%, transparent 72%);
  mask-image: radial-gradient(ellipse 60% 70% at 78% 40%, #000 15%, transparent 72%);
  pointer-events: none;
}

html[dir="rtl"] .hero::before {
  -webkit-mask-image: radial-gradient(ellipse 60% 70% at 22% 40%, #000 15%, transparent 72%);
  mask-image: radial-gradient(ellipse 60% 70% at 22% 40%, #000 15%, transparent 72%);
}

.hero-grid {
  position: relative;
  display: grid;
  gap: 3.5rem;
  align-items: center;
}

@media (min-width: 980px) {
  .hero-grid {
    grid-template-columns: 1.08fr 0.92fr;
    gap: 4rem;
  }
}

.eyebrow {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: var(--brand-tint);
  color: var(--brand-dark);
  font-size: 0.875rem;
  font-weight: 650;
}

.hero h1 {
  margin-top: 1.25rem;
  font-size: clamp(2.2rem, 1.35rem + 3.4vw, 3.7rem);
  font-weight: 800;
}

.lead {
  margin-top: 1.25rem;
  max-width: 36rem;
  color: var(--muted);
  font-size: clamp(1.05rem, 1rem + 0.3vw, 1.2rem);
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

.hero-note {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.25rem;
  color: var(--muted);
  font-size: 0.925rem;
}

.hero-note svg {
  width: 18px;
  height: 18px;
  color: var(--teal);
}

/* ---------- Product preview ---------- */
.mock {
  position: relative;
  width: 100%;
  max-width: 470px;
  margin: 0 auto;
  /* The kitchen card hangs below the till and only tucks under its bottom corner. */
  padding-bottom: 10.75rem;
}

@media (max-width: 560px) {
  .mock {
    padding-bottom: 0;
  }

  .mock .till {
    margin-inline-end: 0;
  }

  .mock .kds {
    position: relative;
    width: 86%;
    margin-top: -0.75rem;
    margin-inline-start: auto;
  }
}

.till {
  margin-inline-end: 3rem;
  padding: 1.25rem 1.35rem 1.35rem;
  border-radius: 22px;
  background: var(--paper);
  box-shadow: var(--shadow-lg), 0 0 0 1px var(--line);
}

.till-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px dashed var(--line);
}

.till-table {
  font-weight: 800;
  font-size: 1.1rem;
}

.till-covers {
  padding: 0.15rem 0.65rem;
  border-radius: 999px;
  background: var(--canvas);
  color: var(--muted);
  font-size: 0.85rem;
}

.till-course {
  margin-top: 0.9rem;
  color: var(--teal);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.till-lines {
  margin: 0.4rem 0 0;
  padding: 0;
  list-style: none;
}

.till-lines li {
  display: grid;
  grid-template-columns: 1.75rem 1fr auto;
  gap: 0.5rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
}

.qty {
  color: var(--brand);
  font-weight: 750;
}

.price,
.till-totals dd {
  font-variant-numeric: tabular-nums;
}

.till-totals {
  display: grid;
  gap: 0.3rem;
  margin: 0.9rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.till-totals div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.till-totals dd {
  margin: 0;
}

.till-totals .grand {
  padding-top: 0.35rem;
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 800;
}

.till-pay {
  margin-top: 1rem;
  padding: 0.8rem;
  border-radius: 12px;
  background: var(--teal);
  color: #fff;
  font-weight: 700;
  text-align: center;
}

.kds {
  position: absolute;
  inset-inline-end: 0;
  bottom: 0;
  width: min(280px, 72%);
  padding: 1rem 1.1rem 1.05rem;
  border-radius: 16px;
  background: var(--night);
  color: var(--night-ink);
  box-shadow: var(--shadow-lg);
  transform: rotate(2.5deg);
}

html[dir="rtl"] .kds {
  transform: rotate(-2.5deg);
}

.kds-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 700;
}

.kds-status {
  flex: none;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  background: #f08c00;
  color: #1a1d21;
  font-size: 0.75rem;
}

.kds-meta {
  margin-top: 0.15rem;
  color: var(--night-muted);
  font-size: 0.8rem;
}

.kds ul {
  display: grid;
  gap: 0.3rem;
  margin: 0.7rem 0 0;
  padding: 0;
  list-style: none;
  font-weight: 650;
}

.kds-held {
  margin-top: 0.7rem;
  padding-top: 0.6rem;
  border-top: 1px dashed rgba(255, 255, 255, 0.2);
  color: var(--night-muted);
  font-size: 0.85rem;
}

/* ---------- Morocco strip ---------- */
.morocco-card {
  padding: clamp(1.5rem, 3vw, 2rem);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.morocco-card > h2 {
  color: var(--brand-dark);
  font-size: 1rem;
  font-weight: 750;
  letter-spacing: 0;
}

.morocco-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.5rem;
  margin-top: 1.25rem;
}

.mi {
  display: flex;
  gap: 0.9rem;
}

.mi-icon,
.card-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--brand-tint);
  color: var(--brand);
}

.card-icon {
  background: var(--teal-tint);
  color: var(--teal);
}

.mi h3,
.trust-item h3 {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0;
}

.mi p,
.trust-item p {
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.95rem;
}

/* ---------- Sections ---------- */
.section {
  padding: clamp(4rem, 8vw, 6.5rem) 0;
}

.section-head {
  max-width: 42rem;
  margin-bottom: 2.75rem;
}

.section-head h2,
.offline h2,
.cta-card h2 {
  font-size: clamp(1.8rem, 1.3rem + 1.8vw, 2.6rem);
  font-weight: 800;
}

.section-head p {
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: 1.1rem;
}

/* ---------- Features ---------- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  gap: 1.25rem;
}

.card {
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.card h3 {
  margin-top: 1rem;
  font-size: 1.15rem;
  font-weight: 750;
}

.points {
  display: grid;
  gap: 0.5rem;
  margin: 0.8rem 0 0;
  padding: 0;
  list-style: none;
}

.points li {
  display: flex;
  gap: 0.55rem;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.points svg {
  width: 18px;
  height: 18px;
  margin-top: 0.15em;
  color: var(--teal);
}

/* ---------- Offline ---------- */
.offline {
  padding: clamp(4rem, 8vw, 6rem) 0;
  background: var(--night);
  color: var(--night-ink);
}

.offline-grid {
  display: grid;
  gap: 3rem;
  align-items: center;
}

@media (min-width: 980px) {
  .offline-grid {
    grid-template-columns: 1.1fr 0.9fr;
    gap: 5rem;
  }
}

.offline h2 {
  color: #fff;
}

.offline-text {
  margin-top: 1rem;
  max-width: 38rem;
  color: var(--night-muted);
  font-size: 1.1rem;
}

.offline .points {
  margin-top: 1.5rem;
}

.offline .points li {
  color: var(--night-ink);
  font-size: 1rem;
}

.offline .points svg {
  color: var(--teal-light);
}

.status-stack {
  display: grid;
  justify-items: center;
  gap: 0.9rem;
}

.status {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  width: min(100%, 380px);
  padding: 1rem 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: var(--night-2);
  font-weight: 600;
}

.dot {
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot-off {
  background: #f08c00;
  box-shadow: 0 0 0 5px rgba(240, 140, 0, 0.18);
}

.dot-on {
  background: #2f9e44;
  box-shadow: 0 0 0 5px rgba(47, 158, 68, 0.2);
}

.status-sync {
  color: var(--teal-light);
}

/* ---------- Trust ---------- */
.trust-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}

.trust-item {
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.trust-item h3 {
  margin-top: 1rem;
  font-size: 1.1rem;
}

/* ---------- Steps ---------- */
.steps {
  border-block: 1px solid var(--line);
  background: var(--paper);
}

.steps-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps-list li {
  padding: 1.75rem;
  border-radius: var(--radius);
  background: var(--canvas);
  counter-increment: step;
}

.steps-list li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-bottom: 1.1rem;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
}

.steps-list h3 {
  font-size: 1.15rem;
  font-weight: 750;
}

.steps-list p {
  margin-top: 0.4rem;
  color: var(--muted);
}

/* ---------- FAQ ---------- */
.faq-grid {
  display: grid;
  gap: 0.5rem;
}

@media (min-width: 980px) {
  .faq-grid {
    grid-template-columns: 0.75fr 1.25fr;
    gap: 3rem;
    align-items: start;
  }
}

.faq-list {
  display: grid;
  gap: 0.75rem;
}

details {
  padding: 0 1.25rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
}

details[open] {
  box-shadow: var(--shadow);
}

summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 0;
  font-size: 1.05rem;
  font-weight: 700;
  list-style: none;
  cursor: pointer;
}

summary::-webkit-details-marker {
  display: none;
}

summary::after {
  content: "";
  flex: none;
  width: 10px;
  height: 10px;
  margin-top: -5px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}

details[open] summary::after {
  margin-top: 5px;
  transform: rotate(-135deg);
}

details p {
  padding-bottom: 1.2rem;
  color: var(--muted);
}

/* ---------- Call to action ---------- */
.cta {
  padding: clamp(1rem, 3vw, 2rem) 0 clamp(4rem, 8vw, 6rem);
}

.cta-card {
  position: relative;
  overflow: hidden;
  padding: clamp(2.5rem, 6vw, 4.5rem) clamp(1.5rem, 5vw, 4rem);
  border-radius: 28px;
  background: var(--brand);
  color: #fff;
  text-align: center;
}

.cta-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("/pattern-light.svg") repeat;
  pointer-events: none;
}

.cta-card > * {
  position: relative;
}

.cta-card p {
  max-width: 34rem;
  margin: 0.9rem auto 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.1rem;
}

.cta-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  margin-top: 2rem;
}

.cta-signin {
  color: #fff;
  font-weight: 600;
  text-underline-offset: 4px;
}

/* ---------- Footer ---------- */
.site-footer {
  padding: 3rem 0 2rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.95rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

@media (min-width: 760px) {
  .footer-grid {
    grid-template-columns: 2fr 1fr 1fr 1fr;
  }
}

.footer-brand {
  grid-column: 1 / -1;
}

@media (min-width: 760px) {
  .footer-brand {
    grid-column: auto;
  }
}

.footer-brand .brand {
  color: var(--ink);
}

.footer-brand p {
  margin-top: 0.75rem;
  max-width: 22rem;
}

.footer-grid h2 {
  margin-bottom: 0.75rem;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0;
}

.footer-grid ul {
  display: grid;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-grid a {
  text-decoration: none;
}

.footer-grid a:hover {
  color: var(--ink);
}

.footer-bottom {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  font-size: 0.875rem;
}

/* ---------- 404 ---------- */
.not-found {
  padding: clamp(5rem, 12vw, 9rem) 0;
}

.not-found h1 {
  font-size: clamp(2rem, 1.5rem + 2vw, 3rem);
  font-weight: 800;
}

.not-found .btn {
  margin-top: 2rem;
}

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition: none !important;
  }
}
