/* ===== Design tokens ===== */
:root{
  --bg:#f7f8fb;
  --surface:#ffffff;
  --text:#1a1f2c;
  --muted:#5b6577;
  --border:#e5e7eb;
  --primary:#1e40af;
  --primary-600:#1d4ed8;
  --primary-foreground:#ffffff;
  --accent:#f59e0b;
  --green:#16a34a;
  --pink:#ec4899;
  --yellow:#eab308;
  --danger:#dc2626;
  --radius:12px;
  --shadow:0 6px 20px -8px rgba(15,23,42,.18);
  --shadow-sm:0 2px 6px -2px rgba(15,23,42,.12);
  --maxw:1100px;
}

*{box-sizing:border-box;}
html,body{margin:0;padding:0;}
body{
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  color:var(--text);
  background:var(--bg);
  line-height:1.5;
  -webkit-text-size-adjust:100%;
}
img{max-width:100%;display:block;}
a{color:var(--primary);text-decoration:none;}
h1,h2,h3,h4{margin:0 0 .5rem;line-height:1.2;}
p{margin:0 0 1rem;}

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

/* ===== Header ===== */
.site-header{
  background:#fff;
  border-bottom:1px solid var(--border);
  position:sticky;top:0;z-index:50;
  backdrop-filter:saturate(160%) blur(6px);
}
.header-inner{
  display:flex;flex-direction:column;align-items:center;
  gap:1rem;padding:1rem;text-align:center;
}
.brand-title{
  font-size:1.5rem;letter-spacing:.04em;font-weight:800;margin:0;
}
.brand-sub{margin:.25rem 0 0;color:var(--muted);font-size:.95rem;}
.c-pink{color:var(--pink);}
.c-yellow{color:var(--yellow);}
.c-green{color:var(--green);}

@media (min-width:640px){
  .header-inner{flex-direction:row;justify-content:space-between;text-align:left;}
  .brand-title{font-size:1.85rem;}
}

/* ===== Buttons ===== */
.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:.5rem;
  padding:.7rem 1.1rem;border-radius:10px;font-weight:600;
  border:1px solid transparent;cursor:pointer;transition:all .15s ease;
  font-size:1rem;line-height:1;min-height:44px;
}
.btn:active{transform:translateY(1px);}
.btn-primary{background:var(--primary);color:var(--primary-foreground);}
.btn-primary:hover{background:var(--primary-600);}
.btn-outline{background:#fff;color:var(--text);border-color:var(--border);}
.btn-outline:hover{background:#f1f5f9;}
.btn-danger{background:var(--danger);color:#fff;}
.btn-ghost{background:transparent;color:var(--muted);}
.btn-lg{padding:1rem 1.5rem;font-size:1.05rem;}
.btn-block{width:100%;}

/* ===== Hero ===== */
.hero{padding:2rem 1rem 3rem;text-align:center;}
.hero h2{font-size:1.8rem;font-weight:800;margin-bottom:.75rem;}
.hero .lead{color:var(--muted);max-width:640px;margin:0 auto 1.5rem;font-size:1.05rem;}

@media (min-width:768px){
  .hero{padding:4rem 1rem;}
  .hero h2{font-size:2.6rem;}
}

/* ===== Feature cards ===== */
.features{
  display:grid;gap:1rem;margin-top:2.5rem;
  grid-template-columns:1fr;
}
@media (min-width:560px){.features{grid-template-columns:repeat(2,1fr);}}
@media (min-width:960px){.features{grid-template-columns:repeat(4,1fr);}}
.card{
  background:var(--surface);border:1px solid var(--border);
  border-radius:var(--radius);padding:1.25rem;text-align:center;
  box-shadow:var(--shadow-sm);transition:box-shadow .2s ease,transform .2s ease;
}
.card:hover{box-shadow:var(--shadow);transform:translateY(-2px);}
.card .icon{font-size:2rem;margin-bottom:.5rem;}
.card h3{font-size:1.1rem;margin-bottom:.4rem;}
.card p{color:var(--muted);margin:0;font-size:.95rem;}

/* ===== Contact ===== */
.contact{background:#eef2f7;padding:2.5rem 0;margin-top:2rem;}
.contact h3{text-align:center;font-size:1.6rem;margin-bottom:1.5rem;}
.contact-grid{
  display:grid;gap:1.5rem;max-width:640px;margin:0 auto;
  grid-template-columns:1fr;text-align:center;
}
@media (min-width:560px){.contact-grid{grid-template-columns:1fr 1fr;}}
.contact h4{font-weight:700;margin-bottom:.4rem;}
.contact p{color:var(--muted);margin:0;}

/* ===== Footer ===== */
.site-footer{
  background:#0f172a;color:#cbd5e1;padding:1.25rem 0;text-align:center;font-size:.9rem;
}

/* ===== Forms ===== */
.page{padding:1.25rem 0 4rem;}
.page-header{
  display:flex;flex-direction:column;gap:.75rem;margin-bottom:1.25rem;
}
@media (min-width:640px){
  .page-header{flex-direction:row;align-items:center;justify-content:space-between;}
}
.page-title{font-size:1.5rem;font-weight:800;}
.page-sub{color:var(--muted);margin:0;}

.section{
  background:var(--surface);border:1px solid var(--border);
  border-radius:var(--radius);padding:1.25rem;margin-bottom:1rem;box-shadow:var(--shadow-sm);
}
.section h2{
  font-size:1.1rem;font-weight:700;margin:0 0 1rem;padding-bottom:.5rem;
  border-bottom:1px solid var(--border);display:flex;align-items:center;gap:.5rem;
}

.grid{display:grid;gap:1rem;grid-template-columns:1fr;}
@media (min-width:640px){.grid-2{grid-template-columns:1fr 1fr;}}
@media (min-width:768px){.grid-3{grid-template-columns:repeat(3,1fr);}}

.field{display:flex;flex-direction:column;gap:.35rem;}
.field label{font-size:.9rem;font-weight:600;color:var(--text);}
.field input, .field select, .field textarea{
  width:100%;padding:.7rem .8rem;border:1px solid var(--border);
  border-radius:8px;font-size:1rem;background:#fff;color:var(--text);
  font-family:inherit;min-height:44px;
}
.field textarea{min-height:90px;resize:vertical;}
.field input:focus,.field select:focus,.field textarea:focus{
  outline:none;border-color:var(--primary);box-shadow:0 0 0 3px rgba(30,64,175,.15);
}

/* ===== Cost rows ===== */
.cost-section{border-left:4px solid var(--primary);}
.cost-section.cat-refinish{border-left-color:#3b82f6;}
.cost-section.cat-paint{border-left-color:#8b5cf6;}
.cost-section.cat-labour{border-left-color:#f97316;}
.cost-section.cat-parts{border-left-color:#10b981;}
.cost-section.cat-misc{border-left-color:#6b7280;}

.cost-row{
  display:grid;gap:.5rem;align-items:end;
  grid-template-columns:1fr;
  padding:.75rem;background:#f8fafc;border:1px solid var(--border);
  border-radius:8px;margin-bottom:.5rem;
}
@media (min-width:640px){
  .cost-row{grid-template-columns:2fr 1fr 1fr 1fr auto;}
}
.cost-row .field label{font-size:.8rem;color:var(--muted);}
.cost-row .remove{
  background:transparent;border:none;color:var(--danger);
  font-size:1.4rem;cursor:pointer;padding:.5rem;min-height:44px;min-width:44px;
}
.add-row{margin-top:.5rem;}
.subtotal{
  text-align:right;font-weight:700;margin-top:.75rem;color:var(--primary);
}

/* ===== Summary / total ===== */
.summary-row{display:flex;justify-content:space-between;padding:.4rem 0;}
.summary-row.total{
  border-top:2px solid var(--text);margin-top:.5rem;padding-top:.6rem;
  font-size:1.2rem;font-weight:800;
}

/* ===== Sticky action bar ===== */
.actions{
  display:flex;gap:.5rem;flex-wrap:wrap;margin-top:1rem;
}
.actions .btn{flex:1 1 140px;}

/* ===== Print ===== */
@media print{
  .site-header,.site-footer,.no-print,.actions,.add-row,.cost-row .remove{display:none !important;}
  body{background:#fff;}
  .section{box-shadow:none;border:1px solid #ccc;break-inside:avoid;}
  .page{padding:0;}
}
