:root {
  --bg: #f4ede2;
  --paper: rgba(255, 251, 245, 0.78);
  --paper-strong: rgba(255, 250, 243, 0.92);
  --ink: #241816;
  --muted: #6c564d;
  --line: rgba(90, 54, 42, 0.13);
  --accent: #8c1530;
  --accent-soft: #f1d4d2;
  --gold: #d5a03d;
  --shadow: 0 30px 80px rgba(77, 42, 33, 0.16);
}

html {
  scroll-behavior: smooth;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 20%, rgba(213, 160, 61, 0.2), transparent 28%),
    radial-gradient(circle at 85% 10%, rgba(140, 21, 48, 0.16), transparent 30%),
    linear-gradient(135deg, #f8f0e2 0%, #efe4d2 52%, #e9dbc7 100%);
}

html[dir="rtl"] body {
  font-family: "Cairo", "Space Grotesk", sans-serif;
}

.page-shell {
  position: relative;
  overflow: hidden;
}

.backdrop {
  position: fixed;
  border-radius: 999px;
  filter: blur(18px);
  pointer-events: none;
  opacity: 0.8;
}

.backdrop-one {
  width: 24rem;
  height: 24rem;
  top: -6rem;
  right: -7rem;
  background: rgba(140, 21, 48, 0.16);
}

.backdrop-two {
  width: 20rem;
  height: 20rem;
  left: -5rem;
  bottom: 4rem;
  background: rgba(213, 160, 61, 0.22);
}

.layout {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 3rem 0 4rem;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 1.5rem;
  align-items: start;
}

.hero-card,
.form-card {
  border: 1px solid var(--line);
  background: var(--paper);
  backdrop-filter: blur(14px);
  border-radius: 32px;
  box-shadow: var(--shadow);
}

.hero-card {
  padding: 3rem;
  min-height: auto;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: start;
}

.hero-topline {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.hero-copy-block {
  display: grid;
  gap: 1rem;
}

.locale-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
}

.locale-switch a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 5.25rem;
  min-height: 2.5rem;
  padding: 0 0.85rem;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 700;
  text-decoration: none;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

.locale-switch a:hover {
  transform: translateY(-1px);
}

.locale-switch a.active {
  color: white;
  background: linear-gradient(135deg, #8c1530, #b42a4d);
}

.eyebrow,
.section-kicker {
  margin: 0 0 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Fraunces", serif;
  font-weight: 700;
  line-height: 0.98;
}

html[dir="rtl"] h1,
html[dir="rtl"] h2,
html[dir="rtl"] h3 {
  font-family: "Cairo", sans-serif;
  line-height: 1.2;
}

h1 {
  font-size: clamp(3.1rem, 6vw, 5.3rem);
  max-width: 10ch;
}

h2 {
  font-size: clamp(2rem, 4vw, 2.7rem);
}

h3 {
  font-size: clamp(2.2rem, 4vw, 3rem);
}

.hero-copy {
  max-width: 38rem;
  margin: 1.25rem 0 0;
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--muted);
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 2rem;
}

.stat-pill,
.result-tile,
.message-card {
  border: 1px solid var(--line);
  background: var(--paper-strong);
  border-radius: 22px;
}

.stat-pill {
  min-width: 13rem;
  padding: 1rem 1.15rem;
}

.stat-pill strong {
  display: block;
  margin-top: 0.25rem;
  font-size: 1.05rem;
}

.stat-label-with-dot {
  display: inline-flex;
  align-items: center;
}

.live-dot {
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  margin-inline-start: 0.4rem;
  vertical-align: middle;
  background: #8ef07a;
  box-shadow:
    0 0 0 0.18rem rgba(142, 240, 122, 0.18),
    0 0 0.5rem rgba(142, 240, 122, 0.85),
    0 0 1rem rgba(142, 240, 122, 0.55);
}

.stat-label,
.result-tile span {
  color: var(--muted);
  font-size: 0.88rem;
}

.form-card {
  padding: 2rem;
  text-align: start;
}

.predict-form {
  display: grid;
  gap: 1.35rem;
}

.section-heading {
  margin-bottom: 0.15rem;
}

.control-group {
  display: grid;
  gap: 0.65rem;
}

.plate-input-wrap {
  position: relative;
}

.control-label {
  font-weight: 700;
  letter-spacing: 0.01em;
}

.segmented-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.segment {
  position: relative;
  display: block;
}

.segment input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.segment span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 3.7rem;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.48);
  font-weight: 700;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.segment:hover span,
.segment input:focus-visible + span {
  transform: translateY(-1px);
  border-color: rgba(140, 21, 48, 0.45);
}

.segment input:checked + span {
  color: white;
  background: linear-gradient(135deg, #8c1530, #b42a4d);
  box-shadow: 0 14px 30px rgba(140, 21, 48, 0.25);
  border-color: transparent;
}

.plate-input {
  width: 100%;
  min-height: 4.1rem;
  padding: 0 3rem 0 1.1rem;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--ink);
  font-size: 1.55rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  outline: none;
}

.plate-input:focus {
  border-color: rgba(140, 21, 48, 0.5);
  box-shadow: 0 0 0 5px rgba(140, 21, 48, 0.09);
}

.plate-clear-button {
  position: absolute;
  inset-inline-end: 0.7rem;
  top: 50%;
  transform: translateY(-50%);
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 999px;
  background: rgba(140, 21, 48, 0.1);
  color: var(--accent);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 180ms ease, background 180ms ease, opacity 180ms ease;
}

.plate-clear-button:hover {
  transform: translateY(-50%) scale(1.04);
  background: rgba(140, 21, 48, 0.16);
}

.plate-clear-button:focus-visible {
  outline: 2px solid rgba(140, 21, 48, 0.45);
  outline-offset: 2px;
}

.field-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.primary-button {
  min-height: 4rem;
  border: 0;
  border-radius: 24px;
  background: linear-gradient(135deg, #241816, #54241f 55%, #8c1530 100%);
  color: white;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease;
  box-shadow: 0 18px 36px rgba(43, 23, 18, 0.24);
}

.primary-button:hover {
  transform: translateY(-1px);
}

.message-card {
  margin-top: 1rem;
  padding: 1rem 1.1rem;
  text-align: start;
}

.message-card strong {
  display: block;
  margin-bottom: 0.25rem;
}

.message-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.message-error {
  background: rgba(169, 42, 53, 0.08);
}

.message-note {
  background: rgba(213, 160, 61, 0.11);
}

.result-panel {
  margin-top: 1.2rem;
  padding: 1.3rem;
  border-radius: 28px;
  background:
    radial-gradient(circle at top right, rgba(213, 160, 61, 0.2), transparent 28%),
    linear-gradient(180deg, rgba(255, 252, 247, 0.94), rgba(247, 238, 229, 0.92));
  border: 1px solid rgba(140, 21, 48, 0.14);
}

.result-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: end;
}

.price-badge {
  padding: 0.95rem 1.05rem;
  border-radius: 18px;
  color: white;
  font-weight: 700;
  font-size: 1.2rem;
  background: linear-gradient(135deg, #8c1530, #d5a03d);
  text-align: start;
}

.result-subtitle {
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.result-grid {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}

.result-tile {
  padding: 1rem;
}

.result-tile strong {
  display: block;
  margin-top: 0.35rem;
  font-size: 1rem;
  line-height: 1.35;
}

.reasons-block {
  margin-top: 1.35rem;
}

.reasons-list {
  list-style: none;
  padding: 0;
  margin: 0.7rem 0 0;
  display: grid;
  gap: 0.7rem;
}

.reasons-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.95rem 1rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid var(--line);
}

.reason-label {
  font-weight: 500;
}

.reason-direction {
  flex-shrink: 0;
  padding: 0.38rem 0.7rem;
  border-radius: 999px;
  background: rgba(140, 21, 48, 0.08);
  color: var(--accent);
  font-size: 0.86rem;
  font-weight: 700;
  text-transform: capitalize;
}

@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .hero-card {
    min-height: auto;
  }
}

@media (max-width: 640px) {
  .layout {
    width: min(100% - 1rem, 100%);
    padding: 1rem 0 2rem;
  }

  .hero-card,
  .form-card {
    border-radius: 24px;
  }

  .hero-card,
  .form-card {
    padding: 1.35rem;
  }

  h1 {
    font-size: 2.8rem;
  }

  .hero-topline {
    flex-direction: column;
    align-items: stretch;
  }

  .segmented-grid,
  .result-grid,
  .result-header,
  .reasons-list li {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

  .price-badge {
    text-align: left;
  }

  .plate-input {
    font-size: 1.25rem;
    letter-spacing: 0.12em;
  }

  .plate-clear-button {
    inset-inline-end: 0.55rem;
    width: 1.85rem;
    height: 1.85rem;
  }
}
