/* TL Home & Landscape Solutions — app styles */
:root {
  --green: #1d4e7c;        /* primary blue */
  --green-dark: #102a45;   /* deep navy */
  --green-light: #e4edf6;  /* pale blue tint */
  --terra: #c2703d;        /* warm accent for buttons */
  --sand: #f3f6f9;         /* cool light background */
  --ink: #1c242c;
  --muted: #5e6a75;
  --line: #d9e0e7;
  --white: #ffffff;
  --danger: #b3402e;
  --radius: 14px;
  --shadow: 0 2px 14px rgba(16, 42, 69, .12);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink); background: var(--sand); line-height: 1.55;
}
a { color: var(--green); }
img { max-width: 100%; }

/* Header */
.topbar {
  background: var(--green-dark); color: #fff; padding: 12px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  position: sticky; top: 0; z-index: 50;
}
.topbar .brand { font-weight: 800; font-size: 17px; letter-spacing: .2px; color: #fff; text-decoration: none; display: flex; align-items: center; gap: 8px; }
.topbar .brand .leaf { font-size: 20px; }
.topbar nav a { color: #e7eef7; text-decoration: none; font-size: 14px; margin-left: 14px; font-weight: 600; }
.topbar nav a.cta { background: var(--terra); padding: 8px 14px; border-radius: 999px; color: #fff; }

.container { max-width: 760px; margin: 0 auto; padding: 16px; }
.wide { max-width: 1050px; }

/* Hero */
.hero {
  background: linear-gradient(160deg, var(--green-dark) 0%, var(--green) 70%);
  color: #fff; text-align: center; padding: 52px 20px 60px;
}
.hero h1 { font-size: clamp(28px, 6vw, 44px); margin: 0 0 10px; line-height: 1.15; }
.hero p.sub { font-size: clamp(16px, 3.5vw, 20px); color: #cdddef; margin: 0 auto 26px; max-width: 560px; }
.hero .steps { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-bottom: 28px; }
.hero .steps span { background: rgba(255,255,255,.14); border-radius: 999px; padding: 7px 14px; font-size: 13.5px; font-weight: 600; }

.btn {
  display: inline-block; border: 0; cursor: pointer; text-decoration: none; text-align: center;
  font-size: 16.5px; font-weight: 700; border-radius: 999px; padding: 14px 26px;
  background: var(--terra); color: #fff; box-shadow: var(--shadow); transition: transform .06s ease;
}
.btn:active { transform: scale(.98); }
.btn.green { background: var(--green); }
.btn.ghost { background: transparent; border: 2px solid var(--line); color: var(--ink); box-shadow: none; }
.btn.small { font-size: 14px; padding: 9px 16px; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.block { display: block; width: 100%; }

/* Cards */
.card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin: 14px 0; }
.card h3 { margin: 0 0 6px; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }

.badge { display: inline-block; background: var(--green-light); color: var(--green-dark); font-size: 12px; font-weight: 700; border-radius: 999px; padding: 3px 10px; }
.badge.terra { background: #f6e3d7; color: #8a4a22; }
.muted { color: var(--muted); }
.small { font-size: 13.5px; }

/* Forms */
label.field { display: block; margin: 12px 0 4px; font-weight: 600; font-size: 14.5px; }
input[type=text], input[type=email], input[type=tel], input[type=number], input[type=password], input[type=date], textarea, select {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 10px;
  font-size: 16px; background: #fff; color: var(--ink);
}
textarea { min-height: 80px; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--green); border-color: var(--green); }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 140px; }
.checkline { display: flex; gap: 10px; align-items: flex-start; margin: 10px 0; font-size: 14px; }
.checkline input { width: 20px; height: 20px; margin-top: 1px; }

/* Wizard */
.wizard-steps { display: flex; gap: 6px; margin: 14px 0 4px; }
.wizard-steps .st { flex: 1; height: 6px; border-radius: 3px; background: var(--line); }
.wizard-steps .st.done { background: var(--green); }
.step-title { font-size: 20px; font-weight: 800; margin: 12px 0 2px; }
.step-hint { color: var(--muted); font-size: 14px; margin-bottom: 12px; }

/* Canvas stage */
.stage-wrap { position: relative; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: #111; touch-action: none; }
.stage-wrap canvas { display: block; width: 100%; height: auto; }
.stage-tools { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }

/* Zones */
.zone-pills { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 10px; }
.zone-pill {
  border: 2px solid var(--zc, var(--line)); background: #fff; color: var(--ink);
  border-radius: 999px; padding: 7px 14px; font-weight: 700; font-size: 13.5px; cursor: pointer;
}
.zone-pill.active { background: var(--zc, var(--green)); color: #fff; }
.zone-pill.remove { border-color: var(--line); }

/* Variants */
.variant-row { display: flex; gap: 8px; flex-wrap: wrap; }
.variant-chip {
  display: flex; align-items: center; gap: 8px; border: 2px solid var(--line);
  background: #fff; border-radius: 999px; padding: 6px 14px 6px 6px; font-weight: 600; font-size: 14px; cursor: pointer;
}
.variant-chip.selected { border-color: var(--green); background: var(--green-light); }
.variant-chip .vswatch { width: 30px; height: 30px; border-radius: 50%; background-size: 60px 60px; border: 1px solid var(--line); }

/* Compare gallery */
.compare-row { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.compare-card { flex: 0 0 220px; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.compare-card img { width: 100%; height: 130px; object-fit: cover; display: block; }
.compare-card .cc-body { padding: 10px 12px 12px; }

/* Product picker */
.product-card { border: 2px solid var(--line); border-radius: var(--radius); padding: 14px; cursor: pointer; background: #fff; }
.product-card.selected { border-color: var(--green); background: var(--green-light); }
.product-card .price { color: var(--green-dark); font-weight: 800; }
.swatch { width: 100%; height: 66px; border-radius: 8px; margin-bottom: 8px; border: 1px solid var(--line); background-size: 96px 96px; }

/* Before/After slider */
.ba-wrap { position: relative; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); user-select: none; touch-action: none; }
.ba-wrap img { display: block; width: 100%; }
.ba-top { position: absolute; inset: 0; overflow: hidden; }
.ba-top img { height: 100%; width: auto; max-width: none; }
.ba-handle { position: absolute; top: 0; bottom: 0; width: 4px; background: #fff; box-shadow: 0 0 8px rgba(0,0,0,.5); }
.ba-handle::after { content: '◂ ▸'; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); background: #fff; color: var(--ink); border-radius: 999px; padding: 6px 10px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.ba-label { position: absolute; top: 10px; font-size: 12px; font-weight: 800; background: rgba(0,0,0,.55); color: #fff; border-radius: 6px; padding: 4px 8px; }

/* Estimate box */
.estimate-box { background: var(--green-dark); color: #fff; border-radius: var(--radius); padding: 20px; }
.estimate-box .big { font-size: clamp(26px, 6vw, 36px); font-weight: 800; }
.estimate-box table { width: 100%; font-size: 14px; border-collapse: collapse; margin-top: 8px; }
.estimate-box td { padding: 3px 0; color: #c9d8e8; }
.estimate-box td:last-child { text-align: right; color: #fff; }

/* Slots */
.slot-day { margin: 14px 0; }
.slot-day h4 { margin: 0 0 8px; }
.slots { display: flex; flex-wrap: wrap; gap: 8px; }
.slots button { border: 1.5px solid var(--line); background: #fff; border-radius: 10px; padding: 10px 14px; font-size: 15px; font-weight: 600; cursor: pointer; }
.slots button.selected { background: var(--green); color: #fff; border-color: var(--green); }

/* Admin */
.admin-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 10px 0; }
.admin-tabs button { border: 0; background: #fff; border-radius: 999px; padding: 9px 16px; font-weight: 700; font-size: 14px; cursor: pointer; box-shadow: var(--shadow); white-space: nowrap; }
.admin-tabs button.active { background: var(--green); color: #fff; }
.table-scroll { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; background: #fff; border-radius: var(--radius); overflow: hidden; }
table.data th, table.data td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data th { background: var(--green-light); color: var(--green-dark); }
.status-pill { display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 700; background: #eee; }
.status-pill.requested, .status-pill.awaiting_deposit { background: #fdf0d5; color: #8a6d1a; }
.status-pill.deposit_paid, .status-pill.confirmed { background: #d8e6f2; color: var(--green-dark); }
.status-pill.completed { background: #d8e6ef; color: #1e4d6b; }
.status-pill.canceled, .status-pill.declined { background: #f4dcd7; color: var(--danger); }

/* Sections on landing */
.section { padding: 34px 0 8px; }
.section h2 { font-size: 24px; margin: 0 0 4px; }
footer { text-align: center; padding: 34px 16px 44px; color: var(--muted); font-size: 13px; }
footer a { color: var(--muted); }

.notice { background: #fff8e6; border: 1px solid #eadfb8; color: #6d5a14; border-radius: 10px; padding: 10px 14px; font-size: 13.5px; margin: 12px 0; }
.error-box { background: #fbeae6; border: 1px solid #e8c2b8; color: var(--danger); border-radius: 10px; padding: 10px 14px; font-size: 14px; margin: 12px 0; }
.success-box { background: #e5f2e1; border: 1px solid #bcd9b3; color: var(--green-dark); border-radius: 10px; padding: 14px; margin: 12px 0; }

.spinner { display: inline-block; width: 22px; height: 22px; border: 3px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; vertical-align: middle; }
.spinner.dark { border-color: rgba(45,90,39,.25); border-top-color: var(--green); }
@keyframes spin { to { transform: rotate(360deg); } }

.render-overlay { position: absolute; inset: 0; background: rgba(20,30,18,.72); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; font-weight: 700; text-align: center; padding: 16px; }
.render-overlay[hidden] { display: none; }

@media (max-width: 620px) {
  .topbar nav a:not(.cta) { display: none; }
  .topbar .brand { font-size: 15px; white-space: nowrap; }
  .topbar nav a.cta { white-space: nowrap; font-size: 13px; padding: 8px 12px; }
  .grid { grid-template-columns: 1fr 1fr; }
}
