:root {
  --blue: #0d9488;
  --blue-dark: #0f766e;
  --sky: #5eead4;
  --ink: #1e293b;
  --body: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --panel: #f1f5f9;
  --panel-tint: #ccfbf1;
  --danger: #dc2626;
  --danger-tint: #fee2e2;
  --success: #16a34a;
  --success-tint: #dcfce7;
  --radius: 10px;
  --max: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--body);
  background: #ffffff;
  line-height: 1.55;
}
h1, h2, h3 { color: var(--ink); line-height: 1.2; }
a { color: var(--blue-dark); }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }

.skip-link {
  position: absolute; left: 12px; top: -50px;
  background: var(--blue); color: #fff; padding: 10px 16px;
  border-radius: var(--radius); text-decoration: none; font-weight: 700;
  transition: top .15s; z-index: 200;
}
.skip-link:focus { top: 12px; }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }

/* Header */
.site-header {
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: #fff; z-index: 50;
}
.header-row {
  display: flex; align-items: center; gap: 24px;
  min-height: 64px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-weight: 800; font-size: 1.15rem; color: var(--ink); }
.brand-tag { font-size: 0.68rem; color: var(--muted); font-weight: 600; }
.site-nav { display: flex; gap: 20px; margin-left: auto; flex-wrap: wrap; }
.site-nav a { text-decoration: none; color: var(--body); font-weight: 600; font-size: 0.92rem; }
.site-nav a:hover { color: var(--blue-dark); }
#request-count {
  display: inline-block; min-width: 18px; text-align: center;
  background: var(--panel-tint); color: var(--blue-dark);
  border-radius: 999px; font-size: 0.75rem; padding: 1px 6px; font-weight: 700;
}
.hotline {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--blue); color: #fff; text-decoration: none;
  padding: 10px 16px; border-radius: 999px; font-weight: 700; font-size: 0.9rem;
  min-height: 44px;
}
.hotline:hover { background: var(--blue-dark); }

/* Hero */
.hero {
  padding: 40px 0 28px; border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--panel) 0%, #ffffff 100%);
  overflow: hidden;
}
.hero-grid { display: grid; grid-template-columns: 1fr 220px; align-items: center; gap: 24px; }
.eyebrow { color: var(--blue-dark); font-weight: 700; font-size: 0.85rem; margin: 0 0 8px; }
.hero h1 {
  font-size: clamp(1.7rem, 3.4vw, 2.5rem); margin: 0 0 12px; max-width: 20ch;
  animation: hero-rise .5s ease-out both;
}
.hero-sub { max-width: 62ch; font-size: 1.02rem; color: var(--body); margin: 0; animation: hero-rise .5s .08s ease-out both; }

@keyframes hero-rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-mark-stage {
  perspective: 700px; display: flex; justify-content: center; align-items: center;
}
.hero-mark {
  width: 190px; height: 190px;
  transform-style: preserve-3d;
  transform: rotateX(8deg) rotateY(-14deg);
  filter: drop-shadow(0 18px 26px rgba(37,99,235,.22));
  transition: transform .12s ease-out;
  animation: hero-mark-in .6s ease-out both;
}
@keyframes hero-mark-in {
  from { opacity: 0; transform: rotateX(8deg) rotateY(-14deg) scale(.85) translateY(14px); }
  to { opacity: 1; transform: rotateX(8deg) rotateY(-14deg) scale(1) translateY(0); }
}
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-mark-stage { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .hero h1, .hero-sub, .hero-mark { animation: none !important; }
}

/* Layout */
.layout { display: grid; grid-template-columns: 1fr 340px; gap: 28px; padding: 32px 20px 56px; }
@media (max-width: 900px) { .layout { grid-template-columns: 1fr; padding: 24px 16px 40px; } }

/* Form */
#request-form h2 { font-size: 1.3rem; margin: 0 0 18px; }
.fset { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 0 0 18px; }
.fset legend { padding: 0 8px; font-weight: 700; color: var(--ink); font-size: 0.92rem; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }
.field-row { display: flex; gap: 14px; flex-wrap: wrap; }
.field-row .field { flex: 1 1 160px; }
label { font-weight: 700; font-size: 0.88rem; color: var(--ink); }
.req { color: var(--blue-dark); font-weight: 600; font-size: 0.78rem; }
.optional { color: var(--muted); font-weight: 500; font-size: 0.78rem; }
.hint { font-size: 0.8rem; color: var(--muted); margin: 0; }

input[type="text"], input[type="tel"], input[type="number"], select, textarea, input[type="file"] {
  min-height: 46px; border: 1.5px solid var(--line); border-radius: 8px;
  padding: 10px 12px; font-size: 0.95rem; font-family: inherit; color: var(--ink);
  background: #fff; width: 100%;
}
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,.18); outline: none;
}
.rego-row { display: flex; gap: 8px; }
.rego-row select { flex: 0 0 84px; }
.rego-row input { flex: 1; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; }

.decode-result {
  background: var(--panel-tint); border-radius: 8px; padding: 10px 12px;
  font-size: 0.88rem; color: var(--ink); margin: 4px 0 0;
}
.checkbox-field { flex-direction: row; align-items: center; gap: 10px; }
.checkbox-field input { width: 20px; height: 20px; min-height: auto; }
.checkbox-field label { font-weight: 600; }

.photo-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
  gap: 8px; margin-top: 10px;
}
.photo-cell { position: relative; }
.photo-cell img {
  width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; border: 1px solid var(--line);
}
.photo-remove-btn {
  position: absolute; top: -6px; right: -6px; width: 22px; height: 22px;
  border-radius: 50%; border: 1.5px solid var(--danger); background: #fff; color: var(--danger);
  font-size: 14px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center;
  padding: 0;
}
.photo-remove-btn:hover { background: var(--danger-tint); }

.form-error {
  background: var(--danger-tint); border: 1px solid var(--danger); color: #7f1d1d;
  border-radius: 8px; padding: 12px 14px; margin: 0 0 16px; font-size: 0.9rem;
}

.btn-primary {
  width: 100%; min-height: 52px; background: var(--blue); color: #fff;
  border: none; border-radius: 10px; font-size: 1rem; font-weight: 800; cursor: pointer;
}
.btn-primary:hover { background: var(--blue-dark); }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; }

.btn-ghost {
  background: #fff; border: 1.5px solid var(--line); color: var(--ink);
  border-radius: 8px; padding: 9px 14px; font-weight: 700; font-size: 0.85rem; cursor: pointer;
  min-height: 44px;
}
.btn-ghost:hover { border-color: var(--blue); color: var(--blue-dark); }
.btn-small { min-height: 38px; padding: 6px 12px; }

/* Confirmation */
.confirmation {
  background: var(--success-tint); border: 1.5px solid var(--success);
  border-radius: var(--radius); padding: 20px; margin-bottom: 20px;
}
.confirmation h2 { margin: 0 0 6px; font-size: 1.15rem; }
.confirmation p { margin: 4px 0; }
#conf-ref { font-family: "Courier New", monospace; }
.confirmation-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }

/* Sidebar cards */
.card {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; margin-bottom: 20px;
  transition: box-shadow .18s ease, transform .18s ease, border-color .18s ease;
}
.card:hover {
  box-shadow: 0 10px 24px rgba(15,23,42,.08);
  transform: translateY(-2px);
  border-color: #cbd5e1;
}
.card h2 { font-size: 1.05rem; margin: 0 0 6px; }
.log-list { margin: 10px 0; }
.log-entry {
  border-top: 1px solid var(--line); padding: 10px 0; font-size: 0.85rem;
}
.log-entry:first-child { border-top: none; }
.log-entry .ref { font-family: "Courier New", monospace; color: var(--blue-dark); font-weight: 700; }
.empty { color: var(--muted); font-size: 0.88rem; }

.steps { margin: 10px 0 0; padding-left: 20px; }
.steps li { margin-bottom: 10px; font-size: 0.88rem; }
.steps li strong { display: block; color: var(--ink); }

.yards { list-style: none; margin: 10px 0 0; padding: 0; }
.yards li { border-top: 1px solid var(--line); padding: 8px 0; font-size: 0.85rem; }
.yards li:first-child { border-top: none; }
.yards li strong { display: block; color: var(--ink); }
.yards li span { color: var(--muted); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 24px 0; margin-top: 20px; }
.footer-row { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; font-size: 0.82rem; color: var(--muted); }

@media (max-width: 640px) {
  .header-row { gap: 10px; }
  .site-nav { order: 3; width: 100%; gap: 14px; }
  .hotline { margin-left: auto; }
}

@media print {
  .site-header, .site-footer, #how-it-works, #coverage, #btn-clear-log, .confirmation-actions, .site-nav, .hotline { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}

/* ---------- Role picker ---------- */
.role-picker {
  position: fixed; inset: 0; background: #fff; z-index: 300;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.role-picker-box { max-width: 420px; text-align: center; }
.role-picker-title { font-size: 1.6rem; margin: 0 0 6px; }
.role-picker-options { display: flex; flex-direction: column; gap: 10px; }
.role-btn {
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px;
  padding: 14px 16px; border: 1.5px solid var(--line); border-radius: 10px;
  background: #fff; cursor: pointer; text-align: left; width: 100%;
}
.role-btn:hover { border-color: var(--blue); background: var(--panel); }
.role-btn-title { font-weight: 800; color: var(--ink); font-size: 1rem; }
.role-btn-sub { font-size: 0.82rem; color: var(--muted); }

.role-badge {
  background: var(--panel-tint); color: var(--blue-dark); font-weight: 700;
  font-size: 0.78rem; padding: 5px 12px; border-radius: 999px;
}

/* ---------- Wrecker / delivery list cards ---------- */
.wrecker-list { display: flex; flex-direction: column; gap: 12px; perspective: 700px; }
.wrecker-card {
  border: 1px solid var(--line); border-radius: 10px; padding: 16px;
}
.wrecker-card-top { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.wrecker-card-title { font-weight: 800; color: var(--ink); font-size: 1rem; }
.wrecker-card-meta { font-size: 0.85rem; color: var(--muted); }
.wrecker-card-photos { display: flex; gap: 6px; margin: 10px 0; flex-wrap: wrap; }
.wrecker-card-photos img { width: 52px; height: 52px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.quote-form { display: flex; gap: 8px; align-items: flex-end; margin-top: 10px; flex-wrap: wrap; }
.quote-form input { max-width: 140px; }
.status-pill {
  display: inline-block; font-size: 0.75rem; font-weight: 700; padding: 3px 10px;
  border-radius: 999px; background: var(--panel-tint); color: var(--blue-dark);
}
.delivery-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

/* ---------- 3D pop-up effect for confirmations, quotes, and status cards ---------- */
@keyframes pop-in {
  from { opacity: 0; transform: scale(0.7) rotateX(18deg); }
  to   { opacity: 1; transform: scale(1) rotateX(0deg); }
}
.confirmation,
.wrecker-card,
.log-entry {
  animation: pop-in 0.28s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  transform-style: preserve-3d;
}
@media (prefers-reduced-motion: reduce) {
  .confirmation, .wrecker-card, .log-entry { animation: none !important; }
}

/* Force the native "hidden" attribute to always win, no matter what
   other display rules exist on the same element. This is the fix for
   the role-picker/view-switching bug. */
[hidden] { display: none !important; }
