:root {
  --bg: #f3f8fb;
  --surface: #ffffff;
  --surface-soft: #edf8fb;
  --text: #0c1654;
  --muted: #5f6c95;
  --accent: #2fd7d2;
  --accent-dark: #09005d;
  --accent-soft: #dffaf8;
  --border: #d9e6f2;
  --shadow: 0 20px 50px rgba(9, 0, 93, 0.12);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: #eef5fb;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Inter', sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(47, 215, 210, 0.22), transparent 30%),
    radial-gradient(circle at top right, rgba(9, 0, 93, 0.12), transparent 28%),
    linear-gradient(180deg, #f6fbfd 0%, #eef5fb 100%);
  background-repeat: no-repeat;
}

.landing-body {
  min-height: 100dvh;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  padding: 0.95rem 1.35rem;
  background: linear-gradient(135deg, var(--accent-dark), var(--accent));
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

button:hover,
.button-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 24px rgba(9, 0, 93, 0.18);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
  box-shadow: none;
}

.button-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: none;
}

.ghost-link {
  color: var(--accent-dark);
  font-weight: 600;
  text-decoration: none;
}

.ghost-link:hover {
  color: var(--accent);
}

.shell {
  width: min(1200px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.5rem 0 3rem;
}

.landing-body .shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-bottom: 1.5rem;
}

.shell-wide {
  width: min(1280px, calc(100% - 2rem));
}

.shell-narrow {
  width: min(720px, calc(100% - 2rem));
}

.marketing-topbar,
.simple-topbar,
.app-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.brand-link {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--accent-dark);
  letter-spacing: -0.04em;
}

[hidden] {
  display: none !important;
}

.marketing-actions,
.topbar-user,
.hero-actions,
.feature-chips,
.browser-bar,
.toolbar,
.actions,
.pill-row {
  display: flex;
  gap: 0.85rem;
  align-items: center;
  flex-wrap: wrap;
}

.nav-link {
  color: var(--muted);
  font-weight: 600;
}

.nav-link:hover {
  color: var(--text);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.4rem 0.75rem;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.eyebrow-light {
  background: rgba(47, 215, 210, 0.14);
}

.marketing-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 2rem;
  align-items: center;
  min-height: calc(100vh - 140px);
}

.landing-body .marketing-hero {
  flex: 1;
  min-height: 0;
}

.marketing-copy h1,
.hub-hero h1,
.panel-card h1,
.form-card h1 {
  margin: 0 0 1rem;
  font-size: clamp(3.2rem, 8vw, 6.2rem);
  line-height: 0.96;
  letter-spacing: -0.06em;
}

.hero-text,
.section-copy,
.visual-panel p,
.hub-card p,
.panel-card p,
.user-pill,
.meta,
.empty-state {
  color: var(--muted);
}

.meta {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.hero-text,
.section-copy {
  font-size: 1.05rem;
  line-height: 1.7;
  max-width: 42rem;
}

.feature-chips {
  margin-top: 1.5rem;
}

.chip,
.user-pill,
.pill,
.mini-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.45rem 0.8rem;
  background: #fff;
  border: 1px solid var(--border);
  font-weight: 600;
}

.user-pill:empty {
  display: none;
}

.hero-visual-card,
.panel-card,
.form-card,
.hub-card,
.ride-card,
.chat-box,
.request-list li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-visual-card {
  overflow: hidden;
}

.browser-bar {
  padding: 1rem 1.2rem;
  background: #f2f8fc;
  border-bottom: 1px solid var(--border);
}

.browser-bar span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #cfe1ef;
}

.hero-visual-content {
  padding: 1.5rem;
}

.visual-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1rem;
}

.visual-header h2,
.visual-panel h3,
.hub-card h2,
.ride-card h3,
.panel-card h2,
.form-card h2 {
  margin: 0;
}

.mini-label {
  margin: 0 0 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  color: var(--muted);
}

.mini-badge {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.visual-grid,
.hub-grid,
.rides-grid,
.two-column-form,
.page-grid {
  display: grid;
  gap: 1rem;
}

.visual-grid,
.hub-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.visual-panel {
  background: var(--surface-soft);
  border-radius: 20px;
  padding: 1.1rem;
}

.accent-panel {
  background: linear-gradient(135deg, rgba(9, 0, 93, 0.08), rgba(47, 215, 210, 0.16));
}

.visual-panel ul {
  margin: 0.75rem 0 0;
  padding-left: 1.1rem;
  color: var(--muted);
}

.center-layout {
  min-height: calc(100vh - 160px);
  display: grid;
  place-items: center;
}

.form-card,
.panel-card {
  padding: 1.5rem;
}

.form-card {
  width: min(100%, 560px);
}

.stack-form {
  display: grid;
  gap: 1rem;
}

.stack-form label {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 0.35rem;
  row-gap: 0.45rem;
  font-weight: 600;
}

.stack-form label > input,
.stack-form label > select,
.stack-form label > textarea {
  flex-basis: 100%;
}

.label-required {
  color: #b42318;
}

.label-optional {
  color: var(--muted);
  font-weight: 500;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  border-radius: 16px;
  padding: 0.9rem 1rem;
}

textarea {
  resize: vertical;
}

select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 3rem;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 1.35rem) calc(50% - 2px),
    calc(100% - 0.95rem) calc(50% - 2px);
  background-size: 10px 10px, 10px 10px;
  background-repeat: no-repeat;
}

select.select-placeholder {
  color: #a1a0a6;
}

select option {
  color: var(--text);
}

input::placeholder,
textarea::placeholder {
  color: #a1a0a6;
}

.feedback {
  margin-bottom: 1rem;
  color: var(--accent-dark);
}

.feedback:empty {
  display: none;
}

.toast-container {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 0.75rem;
  pointer-events: none;
  padding: 1.25rem 1rem 1rem;
}

.toast {
  width: min(420px, calc(100vw - 2rem));
  padding: 0.95rem 1rem;
  border-radius: 18px;
  border: 1px solid rgba(9, 0, 93, 0.08);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 40px rgba(8, 15, 52, 0.18);
  color: var(--text);
  font-weight: 600;
  line-height: 1.45;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.28s ease, transform 0.28s ease;
  backdrop-filter: blur(10px);
}

.toast-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast-hiding {
  opacity: 0;
  transform: translateY(-10px);
}

.toast-success {
  border-color: rgba(11, 138, 79, 0.16);
  background: linear-gradient(135deg, rgba(245, 255, 250, 0.98), rgba(231, 250, 240, 0.96));
}

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

.hub-hero {
  margin-bottom: 1.5rem;
}

.hub-hero h1 {
  font-size: clamp(2.8rem, 6vw, 4.6rem);
}

.hub-card {
  min-height: 220px;
  padding: 1.5rem;
  display: grid;
  gap: 1rem;
  align-content: start;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.hub-card:hover {
  transform: translateY(-3px);
}

.hub-primary {
  background: linear-gradient(135deg, rgba(9, 0, 93, 0.08), rgba(47, 215, 210, 0.16));
}

.hub-label {
  display: inline-flex;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-weight: 800;
}

.single-column {
  grid-template-columns: 1fr;
}

.two-column-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.route-fields {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 1rem;
  align-items: end;
}

.schedule-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: end;
}

.schedule-fields > label:first-child {
  flex: 0 1 calc((100% - 1rem) / 2);
  max-width: calc((100% - 1rem) / 2);
}

.schedule-time-fields {
  flex: 0 1 calc((100% - 1rem) / 2);
  max-width: calc((100% - 1rem) / 2);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  align-items: end;
}

.schedule-fields > label > input {
  max-width: 100%;
}

.schedule-time-fields > label > input {
  max-width: 100%;
}

.route-fields > label:first-of-type {
  max-width: calc(100% - 2rem);
}

.route-swap-button {
  position: absolute;
  left: calc(50% - 1rem);
  bottom: 4px;
  transform: translateX(-50%);
  z-index: 1;
  width: 38px;
  min-height: 38px;
  padding: 0;
  border-radius: 50%;
  font-size: 1rem;
  line-height: 1;
}

.route-swap-button:hover {
  transform: translateX(-50%) translateY(-1px);
}

.full-width {
  grid-column: 1 / -1;
}

.search-toolbar {
  margin-bottom: 1rem;
}

.search-toolbar input {
  min-width: 0;
}

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 500;
  color: var(--muted);
}

.checkbox-field input {
  width: auto;
}

.rides-grid {
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}

.ride-card {
  padding: 1.25rem;
  display: grid;
  gap: 1rem;
}

.route {
  font-size: 1.2rem;
  font-weight: 800;
}

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

.ride-notes {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.ride-notes-preview,
.request-item,
.chat-message,
.notes-modal-content {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.toggle-notes {
  margin-top: 0.55rem;
  justify-self: start;
}

.notes-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.notes-modal[hidden] {
  display: none;
}

.notes-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 22, 84, 0.4);
  backdrop-filter: blur(2px);
}

.notes-modal-panel {
  position: relative;
  z-index: 1;
  width: min(680px, 100%);
  max-height: min(80vh, 720px);
  display: grid;
  gap: 1rem;
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.notes-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.notes-modal-header h2 {
  margin: 0;
}

.notes-modal-content {
  overflow: auto;
  white-space: pre-wrap;
  color: var(--muted);
  line-height: 1.65;
}

.ride-created-modal-panel {
  width: min(560px, 100%);
}

.ride-created-copy {
  margin: 0;
  color: var(--muted);
}

.ride-created-summary {
  display: grid;
  gap: 0.4rem;
  padding: 1rem;
  background: var(--surface-soft);
  border-radius: 18px;
}

.ride-created-route {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text);
}

.ride-created-meta {
  color: var(--muted);
  line-height: 1.5;
}

.ride-created-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.pill {
  font-size: 0.82rem;
}

.status-pending {
  background: #fff7df;
  color: #9a6c00;
}

.status-accepted {
  background: #edf9ef;
  color: #1d7a34;
}

.status-declined {
  background: #ffeded;
  color: #a53b3b;
}

.request-list,
.chat-messages {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.7rem;
}

.request-list li,
.chat-box {
  padding: 0.9rem;
}

.chat-box {
  display: grid;
  gap: 0.8rem;
}

.request-form {
  display: grid;
  gap: 0.75rem;
}

.request-form label {
  display: grid;
  gap: 0.45rem;
  font-weight: 600;
}

.chat-messages {
  max-height: 220px;
  overflow: auto;
}

.chat-message {
  display: grid;
  gap: 0.4rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.chat-message:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.chat-meta {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.empty-state {
  padding: 1.2rem;
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: 18px;
  background: #fff;
}

.debug-summary-grid,
.debug-section-grid,
.debug-meta-grid,
.debug-list,
.debug-stack {
  display: grid;
  gap: 1rem;
}

.debug-summary-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.debug-stat-card,
.debug-card {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 20px;
}

.debug-stat-card {
  padding: 1rem 1.2rem;
}

.debug-stat-card strong {
  display: block;
  font-size: 1.75rem;
  margin-bottom: 0.35rem;
}

.debug-card {
  padding: 1.25rem;
}

.debug-card-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.debug-meta-grid,
.debug-section-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.debug-subsection {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1rem;
}

.debug-subsection h4,
.debug-card h3 {
  margin: 0 0 0.6rem;
}

.debug-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.debug-list li {
  display: grid;
  gap: 0.35rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
}

.debug-list li:first-child {
  padding-top: 0;
}

.debug-list li:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

@media (max-width: 960px) {
  .marketing-hero,
  .visual-grid,
  .hub-grid,
  .two-column-form,
  .route-fields,
  .card-grid,
  .toolbar,
  .debug-meta-grid,
  .debug-section-grid {
    grid-template-columns: 1fr;
  }

  .route-fields > label:first-of-type,
  .route-fields > label:last-of-type {
    max-width: none;
    padding-left: 0;
  }

  .schedule-fields {
    display: grid;
    grid-template-columns: 1fr;
  }

  .schedule-fields > label:first-child,
  .schedule-time-fields,
  .schedule-fields > label,
  .schedule-fields > label > input {
    max-width: none;
  }

  .schedule-time-fields {
    grid-template-columns: 1fr;
  }

  .route-swap-button {
    position: static;
    transform: none;
    justify-self: center;
    margin: 0.35rem auto;
  }

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

  .marketing-topbar,
  .simple-topbar,
  .app-topbar {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 640px) {
  .toast {
    width: min(100%, 420px);
  }

  .shell,
  .shell-wide,
  .shell-narrow {
    width: min(100% - 1rem, 1280px);
  }

  .marketing-copy h1,
  .hub-hero h1,
  .panel-card h1,
  .form-card h1 {
    font-size: clamp(2.4rem, 14vw, 4rem);
  }

  .marketing-actions,
  .topbar-user,
  .hero-actions,
  .feature-chips,
  .toolbar,
  .actions,
  .debug-card-header {
    flex-direction: column;
    align-items: stretch;
  }
}
