:root {
  --bg: #0b0f1a;
  --surface: rgba(255, 255, 255, 0.05);
  --surface-strong: rgba(255, 255, 255, 0.09);
  --border: rgba(255, 255, 255, 0.12);
  --text: #e8ecf5;
  --text-muted: #9aa5c0;
  --violet: #7c6cff;
  --cyan: #00c8f0;
  --gradient: linear-gradient(90deg, #7c6cff, #00c8f0);
  --button-gradient: linear-gradient(90deg, #5b4bea, #0a7fa8);
  --danger: #ff6b81;
  --success: #3ddc97;
  --radius: 14px;
  --container: 1120px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
}
a { color: #a99fff; }
img { max-width: 100%; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 0.5em; }
h1, h2 { overflow-wrap: anywhere; }
.container { width: min(var(--container), 100% - 32px); margin-inline: auto; }
.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; }
.muted { color: var(--text-muted); }
.center { margin-inline: auto; }
.stack > * + * { margin-top: 14px; }

/* Background glow */
.glow { position: fixed; border-radius: 50%; filter: blur(80px); pointer-events: none; z-index: -1; }
.glow-a { width: 520px; height: 520px; background: #6d5cff; opacity: 0.55; top: -180px; right: -140px; animation: drift 18s ease-in-out infinite alternate; }
.glow-b { width: 440px; height: 440px; background: #00b8e6; opacity: 0.35; bottom: -200px; left: -160px; animation: drift 22s ease-in-out infinite alternate-reverse; }
@keyframes drift { to { transform: translate(-60px, 40px) scale(1.1); } }
@media (prefers-reduced-motion: reduce) {
  .glow { animation: none; }
  html { scroll-behavior: auto; }
}

/* Header and footer */
.site-header { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-block: 24px; flex-wrap: wrap; }
.brand { font-weight: 800; font-size: 1.4rem; color: var(--text); text-decoration: none; letter-spacing: -0.02em; }
.brand span { background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.site-header nav { display: flex; gap: 20px; flex-wrap: wrap; }
.site-header nav a { color: var(--text-muted); text-decoration: none; font-size: 0.95rem; }
.site-header nav a:hover { color: var(--text); }
.site-footer { padding-block: 32px; color: var(--text-muted); font-size: 0.9rem; border-top: 1px solid var(--border); }

/* Type */
.eyebrow { text-transform: uppercase; letter-spacing: 0.18em; font-size: 0.78rem; color: #8fa2ff; font-weight: 600; margin: 0 0 12px; }
.gradient-text { background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lede { font-size: clamp(1.05rem, 2.2vw, 1.25rem); color: var(--text-muted); max-width: 620px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 20px; border-radius: 10px; font: inherit; font-weight: 600; text-decoration: none; border: 1px solid transparent; cursor: pointer; transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease; }
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: 0.6; cursor: progress; transform: none; }
.btn-primary { background: var(--button-gradient); color: #fff; box-shadow: 0 8px 24px rgba(109, 92, 255, 0.35); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-small { padding: 6px 12px; font-size: 0.85rem; border-radius: 8px; }

/* Surfaces */
.glass { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); backdrop-filter: blur(12px); }
section { scroll-margin-top: 24px; }

/* Forms */
input, select, textarea { font: inherit; color: var(--text); background: rgba(0, 0, 0, 0.35); border: 1px solid var(--border); border-radius: 10px; padding: 11px 14px; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--violet); outline-offset: 1px; border-color: transparent; }
textarea { min-height: 120px; resize: vertical; }
select option { background: #121829; color: var(--text); }
.form-error { color: var(--danger); min-height: 1.6em; margin: 10px 0 0; font-weight: 500; }
.alert { padding: 12px 16px; border-radius: 10px; border: 1px solid var(--danger); color: var(--danger); background: rgba(255, 107, 129, 0.08); margin-bottom: 16px; }

/* Landing */
.hero { padding-block: clamp(48px, 10vw, 120px) clamp(40px, 8vw, 96px); max-width: 820px; }
.hero h1 { font-size: clamp(2.4rem, 7vw, 4.6rem); font-weight: 800; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.offer { padding-block: 40px; }
.offer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-top: 24px; }
.offer-card { padding: 24px; }
.offer-card .icon { width: 40px; height: 40px; border-radius: 10px; background: var(--gradient); display: grid; place-items: center; font-weight: 800; margin-bottom: 14px; }
.offer-card p { color: var(--text-muted); margin: 0; }
.lookup { padding-block: 40px 80px; }
.lookup-card { padding: clamp(24px, 5vw, 40px); max-width: 640px; }
.lookup-card p { color: var(--text-muted); }
.lookup-form { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.lookup-form input { flex: 1 1 220px; width: auto; }

/* Client hub */
.hub-header { padding-block: 48px 24px; }
.hub-header h1 { font-size: clamp(1.9rem, 5vw, 3rem); font-weight: 800; }
.design-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.design-card { overflow: hidden; display: flex; flex-direction: column; text-decoration: none; color: inherit; transition: transform 0.2s ease, border-color 0.2s ease; }
.design-card:hover { transform: translateY(-3px); border-color: rgba(124, 108, 255, 0.6); }
.design-card { position: relative; }
.design-link { color: inherit; text-decoration: none; }
.design-link::after { content: ''; position: absolute; inset: 0; }
.design-card:focus-within { outline: 2px solid var(--violet); outline-offset: 2px; }
.design-thumb { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: #fff; }
.design-thumb iframe { position: absolute; top: 0; left: 0; width: 400%; height: 400%; transform: scale(0.25); transform-origin: 0 0; border: 0; pointer-events: none; }
.design-card-body { padding: 18px 20px 22px; }
.design-card-body p:last-child { color: var(--text-muted); margin: 0; }
.cta-card { margin-block: 32px 64px; padding: clamp(24px, 5vw, 40px); display: flex; gap: 20px; align-items: center; justify-content: space-between; flex-wrap: wrap; }

/* Questionnaire */
.q-form { max-width: 760px; padding-bottom: 80px; }
.q-section { padding: clamp(20px, 4vw, 32px); margin-bottom: 20px; }
.q-field { margin: 0 0 22px; }
.q-field:last-child { margin-bottom: 0; }
fieldset.q-field { border: 0; padding: 0; min-width: 0; }
.q-label { display: block; font-weight: 600; margin-bottom: 8px; padding: 0; }
.q-help { color: var(--text-muted); font-size: 0.9rem; margin: -4px 0 8px; }
.q-required { color: var(--cyan); }
.q-options { display: flex; flex-wrap: wrap; gap: 8px; }
.q-option { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); cursor: pointer; }
.q-option input { width: auto; accent-color: var(--violet); }
.q-option:has(input:checked) { border-color: var(--violet); background: rgba(124, 108, 255, 0.18); }
.q-error { color: var(--danger); font-size: 0.9rem; margin: 6px 0 0; }
.q-field.has-error input:not([type=radio]):not([type=checkbox]), .q-field.has-error textarea { border-color: var(--danger); }
.q-actions { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.autosave-status { color: var(--text-muted); font-size: 0.9rem; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Admin */
.login-card { max-width: 400px; margin: 12vh auto; padding: 32px; }
.admin-table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.admin-table th, .admin-table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.admin-table th { color: var(--text-muted); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; white-space: nowrap; }
.admin-table tr:last-child td { border-bottom: 0; }
.inline-form { display: flex; gap: 6px; align-items: center; flex-wrap: nowrap; }
.inline-form input[type=tel] { width: 160px; padding: 6px 10px; }
.form-msg { font-size: 0.8rem; min-width: 3em; }
.form-msg[data-state=ok] { color: var(--success); }
.form-msg[data-state=error] { color: var(--danger); }
[data-status=submitted] { --status: #9aa5c0; }
[data-status=approved] { --status: #4dabf7; }
[data-status=under_contract] { --status: #fcc419; }
[data-status=working] { --status: #b197fc; }
[data-status=completed] { --status: #3ddc97; }
select[data-status] { width: auto; font-weight: 600; padding: 6px 10px; border-color: var(--status); color: var(--status); }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 0.8rem; font-weight: 600; border: 1px solid var(--status, var(--border)); color: var(--status, var(--text-muted)); }
.badge-warn { --status: var(--danger); }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.panel { padding: 24px; }
.answers dt { font-weight: 600; margin-top: 14px; }
.answers dd { margin: 4px 0 0; color: var(--text-muted); white-space: pre-wrap; }
details summary { cursor: pointer; font-weight: 600; margin-top: 20px; }

/* Error pages */
.error-page { text-align: center; padding-block: 18vh; }
.error-page h1 { font-size: clamp(2rem, 6vw, 3.4rem); }
