/* Uyron Vehicle — mobile-first, no framework. */
:root {
  --brand: #0f766e;
  --brand-dark: #115e59;
  --brand-soft: #e6f4f2;
  --accent: #b45309;
  --accent-soft: #fef3c7;
  --danger: #b91c1c;
  --danger-soft: #fee2e2;
  --ok: #15803d;
  --ok-soft: #dcfce7;
  --info-soft: #e0f2fe;
  --info: #0369a1;
  --text: #0f172a;
  --muted: #475569;
  --line: #e2e8f0;
  --bg: #f8fafc;
  --card: #ffffff;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 2px 8px rgba(15, 23, 42, 0.05);
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans', 'Helvetica Neue', Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.5; color: var(--text); background: var(--bg); }
img, svg { max-width: 100%; }
a { color: var(--brand-dark); }
a:hover { color: var(--brand); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 0.5rem; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 0.75rem; }
:focus-visible { outline: 3px solid #f59e0b; outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--text); color: #fff; padding: 0.5rem 1rem; z-index: 100; }
.skip-link:focus { left: 0.5rem; top: 0.5rem; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.num { font-variant-numeric: tabular-nums; }
.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 1rem; }
.stack > * + * { margin-top: 1rem; }
.row { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: center; }
.spacer { flex: 1; }
.hidden { display: none !important; }

/* Header / footer */
.site-header { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.site-header .container { display: flex; align-items: center; gap: 0.75rem; min-height: 60px; }
.logo { display: flex; align-items: center; gap: 0.5rem; font-weight: 800; font-size: 1.1rem; color: var(--text); text-decoration: none; }
.logo svg { width: 30px; height: 30px; }
.logo small { font-weight: 600; color: var(--muted); font-size: 0.75rem; display: none; }
.nav { margin-left: auto; display: flex; align-items: center; gap: 0.25rem; }
.nav a { text-decoration: none; color: var(--text); font-weight: 600; padding: 0.5rem 0.65rem; border-radius: 8px; font-size: 0.95rem; }
.nav a:hover, .nav a[aria-current='page'] { background: var(--brand-soft); color: var(--brand-dark); }
.nav .btn { padding: 0.5rem 0.85rem; }
.nav .hide-sm { display: none; }
.site-footer { margin-top: 3rem; padding: 2rem 0 5.5rem; border-top: 1px solid var(--line); background: #fff; color: var(--muted); font-size: 0.9rem; }
.site-footer nav { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
main { min-height: 60vh; padding: 1.25rem 0 1rem; }
main:focus { outline: none; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem; min-height: 44px; padding: 0.6rem 1.1rem; border-radius: 10px; border: 1px solid transparent; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; line-height: 1.2; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); color: #fff; }
.btn-secondary { background: #fff; color: var(--brand-dark); border-color: #99d1ca; }
.btn-secondary:hover { background: var(--brand-soft); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn-ghost:hover { background: #f1f5f9; }
.btn-danger { background: #fff; color: var(--danger); border-color: #fca5a5; }
.btn-danger:hover { background: var(--danger-soft); }
.btn-whatsapp { background: #128c4b; color: #fff; }
.btn-whatsapp:hover { background: #0f7a41; color: #fff; }
.btn-sm { min-height: 36px; padding: 0.35rem 0.75rem; font-size: 0.875rem; border-radius: 8px; }
.btn-block { width: 100%; }
.btn[disabled], .btn[aria-busy='true'] { opacity: 0.6; cursor: not-allowed; }
.link-btn { background: none; border: none; padding: 0; color: var(--brand-dark); font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; }

/* Cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem; }
.card-title { display: flex; align-items: center; gap: 0.5rem; justify-content: space-between; }

/* Hero */
.hero { background: linear-gradient(160deg, #0f766e 0%, #134e4a 100%); color: #fff; border-radius: 0 0 20px 20px; margin: -1.25rem 0 1.5rem; padding: 1.75rem 0 2rem; }
.hero h1 { font-size: 1.7rem; margin-bottom: 0.4rem; }
.hero p.lead { color: #ccfbf1; font-size: 1.05rem; margin-bottom: 1.25rem; max-width: 40rem; }
.hero .search-card { color: var(--text); }
.trust-row { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 1rem; font-size: 0.9rem; color: #ccfbf1; }
.trust-row span::before { content: '✓ '; font-weight: 800; color: #fde68a; }

/* Forms */
.field { display: flex; flex-direction: column; gap: 0.3rem; min-width: 0; }
.field label, .field legend, .label { font-weight: 650; font-size: 0.925rem; }
.field .hint { font-size: 0.825rem; color: var(--muted); }
.req { color: var(--danger); }
input, select, textarea { font: inherit; color: var(--text); background: #fff; border: 1px solid #cbd5e1; border-radius: 10px; padding: 0.6rem 0.75rem; min-height: 44px; width: 100%; }
textarea { min-height: 88px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.2); }
input[aria-invalid='true'], select[aria-invalid='true'], textarea[aria-invalid='true'] { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(185, 28, 28, 0.12); }
.field-error { color: var(--danger); font-size: 0.85rem; font-weight: 600; }
.field-error:empty { display: none; }
.checkbox { display: flex; gap: 0.6rem; align-items: flex-start; font-weight: 500; }
.checkbox input { width: 22px; height: 22px; min-height: 0; margin-top: 2px; flex: none; accent-color: var(--brand); }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; margin: 0; min-width: 0; }
fieldset legend { padding: 0 0.35rem; font-size: 1rem; font-weight: 750; }
.grid { display: grid; gap: 0.85rem; grid-template-columns: 1fr; }
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip-check { position: relative; }
.chip-check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip-check span { display: inline-flex; align-items: center; min-height: 40px; padding: 0.35rem 0.8rem; border: 1px solid #cbd5e1; border-radius: 999px; background: #fff; cursor: pointer; font-size: 0.9rem; font-weight: 600; }
.chip-check input:checked + span { background: var(--brand); color: #fff; border-color: var(--brand); }
.chip-check input:focus-visible + span { outline: 3px solid #f59e0b; outline-offset: 2px; }
.chip { display: inline-flex; align-items: center; min-height: 40px; padding: 0.35rem 0.85rem; border: 1px solid #99d1ca; border-radius: 999px; background: #fff; color: var(--brand-dark); font: inherit; font-weight: 650; font-size: 0.9rem; cursor: pointer; }
.chip:hover { background: var(--brand-soft); }
.error-summary { border: 2px solid var(--danger); background: var(--danger-soft); border-radius: var(--radius); padding: 0.85rem 1rem; }
.error-summary h2 { font-size: 1rem; color: var(--danger); margin: 0 0 0.35rem; }
.error-summary ul { margin: 0; padding-left: 1.2rem; }
.form-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: center; }
.sticky-actions { position: sticky; bottom: 0; background: rgba(248, 250, 252, 0.96); padding: 0.75rem 0; border-top: 1px solid var(--line); z-index: 5; }

/* Alerts */
.alert { border-radius: var(--radius); padding: 0.85rem 1rem; border: 1px solid; }
.alert-info { background: var(--info-soft); border-color: #7dd3fc; color: #0c4a6e; }
.alert-ok { background: var(--ok-soft); border-color: #86efac; color: #14532d; }
.alert-warn { background: var(--accent-soft); border-color: #fcd34d; color: #78350f; }
.alert-error { background: var(--danger-soft); border-color: #fca5a5; color: #7f1d1d; }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.15rem 0.6rem; border-radius: 999px; font-size: 0.78rem; font-weight: 750; white-space: nowrap; border: 1px solid transparent; }
.badge-available, .badge-active, .badge-accepted { background: var(--ok-soft); color: #14532d; border-color: #86efac; }
.badge-part_booked, .badge-pending { background: var(--accent-soft); color: #78350f; border-color: #fcd34d; }
.badge-booked, .badge-completed { background: #e0e7ff; color: #312e81; border-color: #a5b4fc; }
.badge-paused, .badge-draft, .badge-expired, .badge-cancelled, .badge-removed { background: #f1f5f9; color: #334155; border-color: #cbd5e1; }
.badge-declined { background: var(--danger-soft); color: #7f1d1d; border-color: #fca5a5; }
.badge-neutral { background: #f1f5f9; color: #334155; border-color: #e2e8f0; }

/* Search layout */
.search-layout { display: grid; gap: 1rem; grid-template-columns: 1fr; }
.filters summary { cursor: pointer; font-weight: 750; list-style: none; display: flex; justify-content: space-between; align-items: center; min-height: 44px; }
.filters summary::-webkit-details-marker { display: none; }
.filters summary::after { content: '▾'; }
.filters[open] summary::after { content: '▴'; }
.results-head { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: center; justify-content: space-between; margin-bottom: 0.75rem; }
.results-head select { width: auto; min-width: 11rem; }
.results { display: grid; gap: 0.85rem; grid-template-columns: 1fr; }

/* Listing card */
.listing-card { display: flex; flex-direction: column; gap: 0.65rem; }
.listing-card .route { font-size: 1.1rem; font-weight: 800; display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; }
.listing-card .route .arrow { color: var(--brand); }
.listing-card .via { font-size: 0.85rem; color: var(--muted); }
.meta { display: flex; flex-wrap: wrap; gap: 0.4rem 0.9rem; font-size: 0.9rem; color: var(--muted); }
.meta b { color: var(--text); font-weight: 650; }
.price-block { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.6rem; }
.price-regular { color: var(--muted); text-decoration: line-through; font-size: 0.95rem; }
.price-offer { font-size: 1.45rem; font-weight: 850; color: var(--text); }
.price-save { background: var(--accent-soft); color: var(--accent); font-weight: 800; font-size: 0.85rem; padding: 0.1rem 0.5rem; border-radius: 6px; }
.price-note { font-size: 0.8rem; color: var(--muted); width: 100%; }
.card-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.card-actions .btn { flex: 1 1 auto; }

/* Skeleton */
.skeleton { position: relative; overflow: hidden; background: #e2e8f0; border-radius: 8px; }
.skeleton::after { content: ''; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent); animation: shimmer 1.3s infinite; }
@keyframes shimmer { 100% { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) { .skeleton::after { animation: none; } }
.sk-line { height: 14px; margin: 8px 0; }
.sk-title { height: 22px; width: 70%; }

/* Empty */
.empty { text-align: center; padding: 2rem 1rem; }
.empty .icon { font-size: 2.5rem; }

/* Detail */
.detail-layout { display: grid; gap: 1rem; grid-template-columns: 1fr; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 1rem 1.6rem; }
.timeline li::before { content: ''; position: absolute; left: 5px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 3px solid var(--brand); }
.timeline li::after { content: ''; position: absolute; left: 10px; top: 20px; bottom: 0; width: 2px; background: #99d1ca; }
.timeline li:last-child::after { display: none; }
.timeline li.stop::before { width: 10px; height: 10px; left: 6px; border-width: 2px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 0.35rem 1rem; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; }
.contact-box .number { font-size: 1.3rem; font-weight: 800; letter-spacing: 0.02em; }

/* Steps */
.steps { display: grid; gap: 0.85rem; grid-template-columns: 1fr; counter-reset: step; }
.step { position: relative; padding-left: 3.2rem; }
.step::before { counter-increment: step; content: counter(step); position: absolute; left: 1rem; top: 1rem; width: 1.8rem; height: 1.8rem; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 800; display: grid; place-items: center; }
.section { margin: 2rem 0; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 0.75rem; flex-wrap: wrap; }
.owner-cta { background: var(--accent-soft); border-color: #fcd34d; }

/* Dashboard */
.tabs { display: flex; gap: 0.25rem; overflow-x: auto; border-bottom: 1px solid var(--line); margin-bottom: 1rem; scrollbar-width: thin; }
.tabs a { white-space: nowrap; text-decoration: none; color: var(--muted); font-weight: 700; padding: 0.7rem 0.9rem; border-bottom: 3px solid transparent; }
.tabs a[aria-current='page'] { color: var(--brand-dark); border-bottom-color: var(--brand); }
.tabs .count { background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 0 0.45rem; font-size: 0.78rem; margin-left: 0.25rem; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
.stat .value { font-size: 1.8rem; font-weight: 850; }
.stat .label { color: var(--muted); font-size: 0.9rem; }
.list { display: grid; gap: 0.75rem; }
.request-card .who { font-weight: 750; }
.toolbar { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; margin-bottom: 0.75rem; }
.toolbar select { width: auto; }
.price-preview { background: var(--brand-soft); border-radius: 10px; padding: 0.75rem 1rem; }

/* Toast */
.toast-region { position: fixed; left: 50%; bottom: 1rem; transform: translateX(-50%); z-index: 50; display: grid; gap: 0.5rem; width: min(92vw, 420px); }
.toast { background: var(--text); color: #fff; padding: 0.75rem 1rem; border-radius: 10px; box-shadow: var(--shadow); font-weight: 600; }
.toast.error { background: var(--danger); }

/* Dialog */
dialog { border: none; border-radius: var(--radius); padding: 0; width: min(94vw, 460px); box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25); }
dialog::backdrop { background: rgba(15, 23, 42, 0.45); }
dialog .dialog-body { padding: 1.25rem; }

/* Auth */
.auth-wrap { max-width: 440px; margin: 0 auto; }

/* Status page */
.status-hero { text-align: center; padding: 1.5rem 1rem; }
.status-hero .badge { font-size: 0.95rem; padding: 0.35rem 0.9rem; }
.history { list-style: none; padding: 0; margin: 0; }
.history li { padding: 0.5rem 0; border-bottom: 1px dashed var(--line); font-size: 0.925rem; }
.copy-row { display: flex; gap: 0.5rem; }
.copy-row input { font-size: 0.85rem; }

/* Prose pages */
.prose { max-width: 46rem; }
.prose h2 { margin-top: 1.5rem; }

/* Mobile sticky CTA on detail */
.mobile-cta { position: fixed; left: 0; right: 0; bottom: 0; background: #fff; border-top: 1px solid var(--line); padding: 0.6rem 1rem calc(0.6rem + env(safe-area-inset-bottom)); display: flex; gap: 0.5rem; z-index: 15; box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.06); }
.mobile-cta .btn { flex: 1; }

/* ---------- Tablet ---------- */
@media (min-width: 640px) {
  h1 { font-size: 1.9rem; }
  .hero h1 { font-size: 2.2rem; }
  .logo small { display: inline; }
  .nav .hide-sm { display: inline-flex; }
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .results { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .stats { grid-template-columns: repeat(4, 1fr); }
  .span-2 { grid-column: span 2; }
}

/* ---------- Desktop ---------- */
@media (min-width: 960px) {
  .search-layout { grid-template-columns: 290px 1fr; align-items: start; }
  .search-layout .filters-wrap { position: sticky; top: 76px; }
  .filters summary { pointer-events: none; }
  .filters summary::after { content: none; }
  .detail-layout { grid-template-columns: 1fr 360px; align-items: start; }
  .detail-layout aside { position: sticky; top: 76px; }
  .mobile-cta { display: none; }
  .site-footer { padding-bottom: 2rem; }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
  .hero { border-radius: 0 0 28px 28px; padding: 2.5rem 0 2.75rem; }
}

/* ---------- Fixes: header on small screens, nav button colour, grid overflow ---------- */
.logo span { white-space: nowrap; }
.nav a { white-space: nowrap; }
.nav a.btn-primary, .nav a.btn-primary:hover { color: #fff; background: var(--brand); }
.nav a.btn-primary:hover { background: var(--brand-dark); }
.route { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; }
.route .arrow { color: var(--brand); }
.search-layout > *, .detail-layout > *, .grid > * { min-width: 0; }
.kv dd { overflow-wrap: anywhere; }
@media (max-width: 420px) {
  .site-header .container { gap: 0.4rem; }
  .logo { font-size: 1rem; }
  .nav a { padding: 0.45rem 0.5rem; font-size: 0.9rem; }
  .kv { grid-template-columns: 1fr; gap: 0 0; }
  .kv dt { margin-top: 0.4rem; font-size: 0.85rem; }
}
.show-sm { display: inline; }
@media (min-width: 640px) { .show-sm { display: none; } }
