@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg: #0f1216;
  --panel: #171b21;
  --panel-2: #1f242c;
  --border: #2a2f38;
  --text: #e8eaed;
  --text-dim: #9aa3af;
  --accent: #2ea7de;
  --accent-hover: #52b8e8;
  --accent-ink: #06202c;
  --danger: #d9534f;
  --radius: 10px;
  --font-heading: 'Fraunces', Georgia, serif;
  --font-body: 'Inter', -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.5;
}

h1, h2, h3 { font-family: var(--font-heading); font-weight: 500; letter-spacing: 0.2px; }

.wrap {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 20px;
}

.site-header {
  background: linear-gradient(180deg, #1a1e25, var(--bg));
  border-bottom: 1px solid var(--border);
  padding: 32px 0 24px;
}
.site-header h1 { margin: 0 0 8px; font-size: 2rem; }
.site-header .tagline { margin: 0 0 4px; color: var(--text-dim); font-size: 1.02rem; font-style: italic; }
.site-header .tool-intro { margin: 0 0 10px; color: var(--text); font-size: 1.02rem; }
.site-header .trust-line {
  margin: 0; color: var(--accent); font-size: 0.85rem; font-weight: 600;
  letter-spacing: 0.3px; text-transform: uppercase;
}
.site-footer .phone-link { color: var(--accent); text-decoration: none; font-weight: 600; }
.site-footer .phone-link:hover { text-decoration: underline; }

main { padding: 24px 0 60px; }

.step {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 20px;
}
.step h2 { margin-top: 0; font-size: 1.15rem; display: flex; align-items: center; gap: 10px; }
.step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink); font-size: 0.9rem; font-weight: 700;
}
.hint { color: var(--text-dim); font-size: 0.92rem; margin-top: -4px; }
.error-msg { color: var(--danger); margin-top: 10px; }

input[type="file"] {
  display: block;
  color: var(--text);
}

.upload-row { display: flex; align-items: center; gap: 12px; margin-top: 10px; flex-wrap: wrap; }
.or-divider { color: var(--text-dim); font-size: 0.85rem; }

.canvas-wrap {
  max-width: 100%;
  overflow: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
#outlineCanvas { display: block; max-width: 100%; cursor: crosshair; touch-action: none; }

.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }

.btn-primary, .btn-secondary {
  border: none; border-radius: 8px; padding: 10px 16px;
  font-size: 0.95rem; cursor: pointer; font-weight: 600;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-secondary { background: var(--panel-2); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: #262c35; }

.swatch-row {
  display: flex; gap: 12px; flex-wrap: wrap; margin: 14px 0 18px;
}
.swatch {
  background: var(--panel-2); border: 2px solid var(--border); border-radius: 8px;
  padding: 8px; cursor: pointer; text-align: center; width: 92px;
  color: var(--text);
}
.swatch.active { border-color: var(--accent); }
.swatch-color {
  display: block; width: 100%; height: 44px; border-radius: 6px; margin-bottom: 6px;
  border: 1px solid rgba(255,255,255,0.15);
}
.swatch-name { font-size: 0.78rem; color: var(--text-dim); }

.preview-wrap { margin-top: 10px; }
.before-after {
  position: relative; max-width: 100%; overflow: hidden;
  border-radius: var(--radius); border: 1px solid var(--border);
}
.before-after canvas { display: block; max-width: 100%; width: 100%; height: auto; }
#beforeCanvas {
  position: absolute; top: 0; left: 0;
  clip-path: inset(0 0 0 50%);
}
.ba-divider {
  position: absolute; top: 0; bottom: 0; left: 50%;
  width: 2px; background: var(--accent);
  pointer-events: none;
}
#baSlider { width: 100%; margin-top: 12px; }

.estimate-form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 10px; }
.estimate-form label { display: flex; flex-direction: column; gap: 6px; font-size: 0.9rem; color: var(--text-dim); }
.estimate-form input, .estimate-form select {
  background: var(--panel-2); border: 1px solid var(--border); color: var(--text);
  border-radius: 6px; padding: 8px 10px; font-size: 1rem;
}
.checkbox-label { flex-direction: row !important; align-items: center; gap: 8px !important; }
.checkbox-label input { width: auto; }
.estimate-form button { grid-column: 1 / -1; }

.estimate-result {
  margin-top: 18px; padding: 16px; background: var(--panel-2);
  border: 1px solid var(--border); border-radius: 8px;
}
.estimate-result .range { font-size: 1.6rem; font-weight: 700; color: var(--accent); }
.estimate-result .sub { color: var(--text-dim); font-size: 0.88rem; margin-top: 4px; }

.lead-form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 16px; }
.lead-form label { display: flex; flex-direction: column; gap: 6px; font-size: 0.9rem; color: var(--text-dim); }
.lead-form input {
  background: var(--panel-2); border: 1px solid var(--border); color: var(--text);
  border-radius: 6px; padding: 8px 10px; font-size: 1rem;
}
.lead-form button { grid-column: 1 / -1; }

.lead-result {
  margin-top: 16px; padding: 14px; background: var(--panel-2);
  border: 1px solid var(--border); border-radius: 8px; color: var(--text-dim);
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 18px 0; color: var(--text-dim); font-size: 0.85rem;
}
.site-footer .admin-link {
  color: var(--text-dim); text-decoration: none; margin-left: 14px;
  border-left: 1px solid var(--border); padding-left: 14px; font-size: 0.8rem;
}
.site-footer .admin-link:hover { color: var(--text); }

@media (max-width: 560px) {
  .estimate-form, .lead-form { grid-template-columns: 1fr; }
}
