/* ==========================================================================
   Intercity Marketplace — original design system (Phase 0)
   Self-contained: no external CSS framework. Light-first, dark-aware.
   ========================================================================== */

:root {
  /* Brand — a travel/trust teal with a warm amber accent (original palette). */
  --brand-900: #0b3b36;
  --brand-800: #0f5148;
  --brand-700: #12766c;
  --brand-600: #159187;
  --brand-500: #1aa79a;
  --brand-100: #d9efec;
  --brand-050: #f0f8f6;

  --accent-600: #d97706;
  --accent-500: #f59e0b;

  --ink-900: #101828;
  --ink-700: #344054;
  --ink-500: #667085;
  --ink-300: #98a2b3;

  --line: #e6e9ef;
  --bg: #ffffff;
  --bg-soft: #f6f9f8;
  --bg-brandsoft: var(--brand-050);
  --white: #ffffff;

  --ok-500: #16a34a;
  --warn-500: #d97706;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
  --shadow: 0 8px 24px rgba(16, 24, 40, 0.08);
  --shadow-lg: 0 20px 48px rgba(11, 59, 54, 0.14);

  --maxw: 1120px;
  --space: 1rem;

  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, "Noto Sans", "Noto Nastaliq Urdu", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink-900: #f2f4f7;
    --ink-700: #d0d5dd;
    --ink-500: #98a2b3;
    --ink-300: #667085;
    --line: #22303a;
    --bg: #0c1416;
    --bg-soft: #0f1b1e;
    --bg-brandsoft: #10221f;
    --white: #12211f;
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.5);
  }
}

/* ----- base ----- */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink-900);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { line-height: 1.15; color: var(--ink-900); margin: 0 0 0.5em; }
h1 { font-size: clamp(2rem, 4.5vw, 3.25rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); letter-spacing: -0.01em; }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1rem; color: var(--ink-700); }
a { color: var(--brand-700); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { max-width: 100%; }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

.section { padding-block: clamp(2.75rem, 6vw, 5rem); }
.section--soft { background: var(--bg-soft); }
.section--brand { background: var(--bg-brandsoft); }

.eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-700);
  margin-bottom: 0.6rem;
}

.lead { font-size: 1.15rem; color: var(--ink-700); max-width: 62ch; }
.text-center { text-align: center; }
.mx-auto { margin-inline: auto; }
.muted { color: var(--ink-500); }

/* ----- skip link / a11y ----- */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--brand-700);
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: 0 0 var(--radius-sm) 0;
  z-index: 100;
}
.skip-link:focus { left: 0; }

:where(a, button, summary, input, select, textarea):focus-visible {
  outline: 3px solid var(--brand-500);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ----- buttons ----- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1;
  padding: 0.85rem 1.35rem;
  border-radius: 999px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform 0.06s ease, box-shadow 0.15s ease, background 0.15s ease;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--brand-700); color: #fff; box-shadow: var(--shadow-sm); }
.btn--primary:hover { background: var(--brand-800); color: #fff; }
.btn--accent { background: var(--accent-500); color: #201400; }
.btn--accent:hover { background: var(--accent-600); color: #fff; }
.btn--ghost { background: transparent; color: var(--brand-700); border-color: var(--brand-100); }
.btn--ghost:hover { background: var(--brand-050); }
.btn--lg { padding: 1rem 1.7rem; font-size: 1.05rem; }
.btn--block { display: flex; width: 100%; }

/* ----- header / nav ----- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  height: 68px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--ink-900);
  letter-spacing: -0.01em;
}
.brand:hover { text-decoration: none; }
.brand__mark { width: 30px; height: 30px; flex: none; }
.nav__links {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: auto;
  list-style: none;
  padding: 0;
}
.nav__links a {
  display: inline-block;
  padding: 0.5rem 0.8rem;
  border-radius: 999px;
  color: var(--ink-700);
  font-weight: 500;
}
.nav__links a:hover { background: var(--bg-soft); text-decoration: none; }
.nav__links a[aria-current="page"] { color: var(--brand-700); font-weight: 700; }
.nav__cta { margin-left: 0.5rem; }

.nav__toggle {
  display: none;
  margin-left: auto;
  background: transparent;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 0.5rem;
  cursor: pointer;
  color: var(--ink-900);
}

@media (max-width: 860px) {
  .nav__toggle { display: inline-flex; }
  .nav__links {
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0.15rem;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    padding: 0.75rem 1.25rem 1rem;
    box-shadow: var(--shadow);
    display: none;
  }
  .nav__links.is-open { display: flex; }
  .nav__cta { margin: 0.4rem 0 0; }
}

/* ----- hero ----- */
.hero {
  background:
    radial-gradient(1100px 460px at 78% -8%, var(--brand-100), transparent 60%),
    linear-gradient(180deg, var(--bg-brandsoft), var(--bg));
}
.hero__grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 2.5rem;
  align-items: center;
  padding-block: clamp(2.5rem, 6vw, 4.5rem);
}
.hero__trust {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: var(--brand-800);
  background: var(--white);
  border: 1px solid var(--brand-100);
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  font-size: 0.9rem;
  box-shadow: var(--shadow-sm);
}
.hero__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }
.hero__card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
}
@media (max-width: 860px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__card { order: -1; }
}

/* ----- grid helpers ----- */
.grid { display: grid; gap: 1.25rem; }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 860px) {
  .grid--3, .grid--2 { grid-template-columns: 1fr; }
}

/* ----- cards ----- */
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  height: 100%;
}
.card--interactive { transition: box-shadow 0.15s ease, transform 0.1s ease; }
.card--interactive:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.card__icon {
  width: 48px; height: 48px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: var(--brand-050);
  color: var(--brand-700);
  margin-bottom: 0.9rem;
}
.card h3 { margin-bottom: 0.35rem; }
.card p { margin-bottom: 0; }

.step-num {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 999px;
  background: var(--brand-700);
  color: #fff;
  font-weight: 700;
  margin-bottom: 0.8rem;
}

/* ----- list with checks ----- */
.check-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.75rem; }
.check-list li { display: flex; gap: 0.6rem; align-items: flex-start; color: var(--ink-700); }
.check-list svg { flex: none; margin-top: 0.15rem; color: var(--brand-600); }

/* ----- route chips ----- */
.chips { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.95rem;
  border-radius: 999px;
  background: var(--white);
  border: 1px solid var(--line);
  color: var(--ink-900);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}
.chip:hover { border-color: var(--brand-500); text-decoration: none; }

/* ----- badges / pills ----- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  background: var(--brand-050);
  color: var(--brand-800);
}
.pill--accent { background: #fff4e0; color: #7a4b00; }

/* ----- accordion (native details) ----- */
.accordion { display: grid; gap: 0.75rem; }
.accordion details {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--white);
  overflow: hidden;
}
.accordion summary {
  cursor: pointer;
  list-style: none;
  padding: 1rem 1.25rem;
  font-weight: 600;
  color: var(--ink-900);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary::after {
  content: "+";
  font-size: 1.35rem;
  color: var(--brand-700);
  line-height: 1;
}
.accordion details[open] summary::after { content: "\2013"; }
.accordion .accordion__body { padding: 0 1.25rem 1.1rem; color: var(--ink-700); }

/* ----- footer ----- */
.site-footer {
  background: var(--brand-900);
  color: #cfe6e1;
  padding-block: 3rem 2rem;
  margin-top: 2rem;
}
.site-footer a { color: #eafaf6; }
.site-footer h4 { color: #fff; font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.06em; }
.footer__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 2rem; }
.footer__links { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.5rem; }
.footer__bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  margin-top: 2rem;
  padding-top: 1.25rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.9rem;
  color: #9dc4bd;
}
@media (max-width: 860px) { .footer__grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer__grid { grid-template-columns: 1fr; } }

/* ----- misc ----- */
.disclaimer {
  font-size: 0.85rem;
  color: var(--ink-500);
  border-left: 3px solid var(--brand-100);
  padding-left: 0.9rem;
}
.stack-sm > * + * { margin-top: 0.5rem; }
.mt-2 { margin-top: 1.5rem; }
.mt-3 { margin-top: 2.5rem; }
.badge-row { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }

/* ----- forms ----- */
fieldset { border: 1px solid var(--line); border-radius: var(--radius); }
fieldset legend { padding: 0 0.4rem; color: var(--ink-900); }
label {
  display: block;
  font-weight: 600;
  color: var(--ink-900);
  font-size: 0.95rem;
}
input[type="text"], input[type="tel"], input[type="email"], input[type="number"],
select, textarea {
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.65rem 0.8rem;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--ink-900);
  font-size: 1rem;
  font-family: inherit;
  font-weight: 400;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--brand-500);
  outline: none;
  box-shadow: 0 0 0 3px var(--brand-050);
}
.role-check {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-weight: 500;
}
.role-check input { width: auto; margin-top: 0.2rem; }
[hidden] { display: none !important; }

/* ----- inline field validation ----- */
.field-error {
  display: block;
  color: #b42318;
  font-size: 0.85rem;
  margin-top: 0.3rem;
}
.field-error:empty { display: none; }
input[aria-invalid="true"],
select[aria-invalid="true"],
textarea[aria-invalid="true"] {
  border-color: #e5484d;
}
input[aria-invalid="true"]:focus,
select[aria-invalid="true"]:focus,
textarea[aria-invalid="true"]:focus {
  box-shadow: 0 0 0 3px #fde3e3;
}
@media (prefers-color-scheme: dark) {
  .field-error { color: #ff9a94; }
}

/* Screen-reader-only text (visible to assistive tech, hidden visually). */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Respect reduced-motion preferences (WCAG 2.3.3). */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ----- tables (admin) ----- */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.6rem 0.8rem; border-bottom: 1px solid var(--line); font-size: 0.92rem; }
th { color: var(--ink-500); font-weight: 600; }
tr:last-child td { border-bottom: none; }
