:root {
  --bg: #f1eee8;
  --bg-elevated: #faf8f4;
  --bg-soft: #e5e1d8;
  --bg-deep: #1a1c1e;
  --ink: #1a1c1e;
  --ink-soft: #4a4e52;
  --ink-muted: #787e86;
  --line: rgba(26, 28, 30, 0.1);
  --line-strong: rgba(26, 28, 30, 0.18);
  --brand: #041197;
  --brand-soft: #1c2fc0;
  --gold: #c9a227;
  --gold-bright: #e8d48b;
  --gold-deep: #8a6f14;
  --bronze: #8f5a33;
  --bronze-bright: #c08a55;
  --bronze-deep: #5c3a22;
  --silver: #8b929a;
  --silver-bright: #d0d5db;
  --silver-deep: #5c636b;
  --white: #faf8f4;
  --success: #3d5c45;
  --danger: #8a2a2a;
  --font-display: "Bricolage Grotesque", system-ui, sans-serif;
  --font-body: "Source Sans 3", system-ui, sans-serif;
  --metal-gold: linear-gradient(135deg, var(--gold-bright) 0%, var(--gold) 38%, var(--gold-deep) 62%, var(--gold-bright) 100%);
  --metal-bronze: linear-gradient(135deg, var(--bronze-bright) 0%, var(--bronze) 42%, var(--bronze-deep) 68%, var(--bronze-bright) 100%);
  --metal-silver: linear-gradient(135deg, var(--silver-bright) 0%, var(--silver) 40%, var(--silver-deep) 65%, var(--silver-bright) 100%);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --header-h: 4.75rem;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(1100px 520px at 8% -8%, rgba(201, 162, 39, 0.1), transparent 55%),
    radial-gradient(900px 480px at 96% 4%, rgba(143, 90, 51, 0.07), transparent 50%),
    radial-gradient(700px 400px at 50% 100%, rgba(139, 146, 154, 0.08), transparent 55%),
    var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
::selection { background: color-mix(in srgb, var(--gold) 32%, transparent); color: var(--ink); }

.container { width: min(1100px, calc(100% - 2.5rem)); margin-inline: auto; }
.display {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.02;
}
.eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--bronze);
}
.lede { margin: 0; max-width: 38rem; color: var(--ink-soft); font-size: 1.125rem; }
.muted, .small-note { color: var(--ink-muted); }
.hidden { display: none !important; }

.metal-text-gold {
  background: var(--metal-gold);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.metal-text-bronze {
  background: var(--metal-bronze);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.metal-bar-gold {
  height: 0.2rem;
  width: 6rem;
  border-radius: 999px;
  background: var(--metal-gold);
  box-shadow: 0 0 18px rgba(201, 162, 39, 0.35);
}

.btn, .primary, .secondary, .admin-table button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 3rem;
  padding: 0.75rem 1.4rem;
  border-radius: 0.35rem;
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition:
    transform 0.35s var(--ease-out),
    background 0.35s var(--ease-out),
    color 0.35s var(--ease-out),
    border-color 0.35s var(--ease-out),
    box-shadow 0.35s var(--ease-out);
}
.btn:hover, .primary:hover, .secondary:hover { transform: translateY(-1px); }
.btn:disabled, .primary:disabled, .secondary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.btn-primary, .primary {
  border: 0;
  background: var(--brand);
  color: #fff;
  box-shadow: 0 10px 24px rgba(4, 17, 151, 0.18);
}
.btn-primary:hover, .primary:hover { background: var(--brand-soft); }

.btn-ghost, .secondary {
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink);
}
.btn-ghost:hover, .secondary:hover {
  border-color: var(--bronze);
  background: var(--bg-elevated);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: blur(12px);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: var(--header-h);
}
.brand-name {
  display: block;
  font-size: 1.35rem;
  line-height: 1;
}
.brand-place {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.header-actions { display: flex; align-items: center; gap: 1rem; }
.header-tool { font-size: 0.92rem; font-weight: 500; color: var(--ink-soft); }
.header-actions .btn { min-height: 2.5rem; padding: 0.5rem 1rem; font-size: 0.875rem; }

.page {
  flex: 1;
  padding: clamp(2.5rem, 5vw, 4rem) 0 4.5rem;
}
.page-hero { margin-bottom: 2rem; }
.page-hero h1 {
  margin: 0.75rem 0 0;
  font-size: clamp(2.6rem, 7vw, 4.4rem);
}
.page-hero .metal-bar-gold { margin-top: 1.15rem; }
.page-hero .lede { margin-top: 1.35rem; }

.panel {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  padding: 1.75rem 1.75rem 1.85rem;
  margin-top: 1.15rem;
}
.step-head { display: flex; gap: 1rem; align-items: flex-start; margin-bottom: 1.5rem; }
.step-no {
  flex: 0 0 2.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  height: 2.25rem;
  border: 1px solid color-mix(in srgb, var(--silver) 45%, transparent);
  background: linear-gradient(160deg, color-mix(in srgb, var(--silver-bright) 55%, white) 0%, color-mix(in srgb, var(--silver) 25%, var(--bg-elevated)) 100%);
  color: var(--silver-deep);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.step-head h2, .admin-toolbar h2 {
  margin: 0 0 0.2rem;
  font-family: var(--font-display);
  font-size: 1.55rem;
  letter-spacing: -0.03em;
}
.step-head p { margin: 0; color: var(--ink-soft); }

.mode-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.85rem; }
.mode-card {
  appearance: none;
  text-align: left;
  border: 1px solid var(--line);
  background: var(--bg-elevated);
  padding: 1.25rem;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  transition: border-color 0.25s var(--ease-out), background 0.25s var(--ease-out), transform 0.25s var(--ease-out);
}
.mode-card:hover { border-color: color-mix(in srgb, var(--gold) 45%, transparent); transform: translateY(-1px); }
.mode-card.active {
  border-color: color-mix(in srgb, var(--gold) 55%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--bronze) 18%, transparent);
  background: #fff;
}
.mode-card strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin-bottom: 0.4rem;
}
.mode-card span { display: block; color: var(--ink-soft); line-height: 1.45; }
.mode-card:disabled { cursor: not-allowed; opacity: 0.65; transform: none; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.1rem; }
label > span {
  display: block;
  margin: 0 0 0.4rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink-soft);
}
input, select {
  width: 100%;
  border: 1px solid var(--line-strong);
  background: var(--bg-elevated);
  border-radius: 0;
  min-height: 3rem;
  padding: 0.75rem 1rem;
  color: var(--ink);
  font: inherit;
  outline: none;
  transition: border-color 0.25s var(--ease-out);
}
input:focus, select:focus { border-color: var(--brand); }
.unit-input { position: relative; }
.unit-input input { padding-right: 3.4rem; }
.unit-input > span {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.85rem;
  font-weight: 600;
}

.terms-check { display: flex; align-items: flex-start; gap: 0.7rem; margin-top: 1.25rem; max-width: 46rem; }
.terms-check input { width: 1.1rem; min-height: 1.1rem; height: 1.1rem; margin: 0.2rem 0 0; flex: 0 0 1.1rem; }
.terms-check > span { margin: 0; font-weight: 500; line-height: 1.45; color: var(--ink-soft); }

.primary, .auth-form .primary { margin-top: 1.25rem; }
.error, .message, .success {
  margin-top: 1.15rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
}
.error, .error-message { border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); background: #f8eeee; color: var(--danger); }
.success, .success-message { border-color: color-mix(in srgb, var(--success) 35%, var(--line)); background: #eef4ef; color: var(--success); }

.result-panel { border-top: 3px solid var(--gold); }
.quote-reference { margin: -0.4rem 0 1.1rem 3.25rem; color: var(--ink-muted); font-size: 0.9rem; }
.option-list { display: grid; gap: 0.85rem; }
.price-card { border: 1px solid var(--line); background: #fff; }
.price-card-head { padding: 1.25rem; display: flex; justify-content: space-between; gap: 1.25rem; align-items: flex-start; }
.option-kicker { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.14em; font-weight: 700; color: var(--bronze); }
.price-card h3 { margin: 0.3rem 0 0.3rem; font-family: var(--font-display); font-size: 1.25rem; }
.price-card p { margin: 0; color: var(--ink-soft); }
.bore-pill {
  border: 1px solid color-mix(in srgb, var(--gold) 40%, transparent);
  background: var(--bg);
  padding: 0.45rem 0.75rem;
  font-weight: 700;
  white-space: nowrap;
  font-size: 0.85rem;
}
.price-grid { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); background: var(--bg); }
.price-grid > div { padding: 1.1rem 1.25rem; }
.price-grid > div + div { border-left: 1px solid var(--line); }
.price-grid span, .spec-box span { display: block; font-size: 0.78rem; color: var(--ink-muted); margin-bottom: 0.25rem; }
.price-grid strong { font-family: var(--font-display); font-size: 1.55rem; letter-spacing: -0.03em; }
.spec-box {
  margin-top: 1.1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem 1.75rem;
  padding: 1rem 1.15rem;
  background: var(--bg);
  border: 1px solid var(--line);
}
.spec-box strong { font-size: 0.95rem; }
.review-note { margin: 1.1rem 0 0.35rem; color: var(--ink-muted); font-size: 0.9rem; }
.vat-note { margin: 0; font-weight: 700; font-size: 0.9rem; }

.email-gate {
  margin-top: 1.35rem;
  padding: 1.25rem;
  border: 1px solid var(--line);
  background: var(--bg);
}
.email-gate h3 { margin: 0 0 0.35rem; font-family: var(--font-display); font-size: 1.25rem; }
.email-gate p { margin: 0; color: var(--ink-soft); }
.email-actions { display: flex; gap: 0.7rem; flex-wrap: wrap; margin-top: 1rem; }
.email-actions .primary, .email-actions .secondary { margin-top: 0; }

.auth-tabs { display: flex; gap: 0.5rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.auth-tab {
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink);
  border-radius: 0.35rem;
  padding: 0.55rem 0.95rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.auth-tab.active {
  border-color: color-mix(in srgb, var(--gold) 55%, transparent);
  color: var(--ink);
  background: #fff;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--bronze) 14%, transparent);
}

.signed-in-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.25rem;
}
.signed-in-bar div { display: flex; flex-direction: column; gap: 0.15rem; }
.signed-in-bar strong { font-family: var(--font-display); font-size: 1.2rem; }
.signed-in-bar span { color: var(--ink-soft); font-size: 0.92rem; }
.signed-in-bar .secondary { margin-top: 0; min-height: 2.75rem; }

.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--line);
  background: var(--bg-elevated);
}
.footer-grid {
  display: grid;
  gap: 2.5rem;
  padding: clamp(3rem, 5.5vw, 4.5rem) 0 1.5rem;
}
@media (min-width: 800px) {
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; }
}
.footer-name { margin: 0; font-size: 1.85rem; }
.footer-blurb { margin: 0.75rem 0 0; max-width: 22rem; color: var(--ink-soft); }
.footer-line { margin: 1.15rem 0 0; font-size: 0.95rem; font-weight: 600; }
.footer-list { list-style: none; margin: 0; padding: 0; }
.footer-list li { margin: 0 0 0.45rem; color: var(--ink-soft); }
.footer-list a:hover { color: var(--brand); }
.footer-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
  border-top: 1px solid var(--line);
  padding: 1.15rem 0 1.5rem;
  font-size: 0.875rem;
  color: var(--ink-muted);
}

.admin-title {
  margin: 0 0 0.4rem;
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  letter-spacing: -0.035em;
}
.admin-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 1.25rem;
  align-items: flex-start;
  margin-bottom: 1.15rem;
}
.admin-toolbar .secondary { margin-top: 0; }
.table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td {
  text-align: left;
  padding: 0.85rem 0.7rem;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.admin-table th {
  color: var(--ink-muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.admin-table button { min-height: 2.25rem; padding: 0 0.8rem; font-size: 0.85rem; }
.status {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--bg-soft);
}
.status-approved { background: #eef4ef; color: var(--success); }
.status-pending { background: #f7f0dc; color: var(--gold-deep); }
.status-suspended { background: #f8eeee; color: var(--danger); }

.version-tag {
  position: fixed;
  bottom: 0.5rem;
  right: 0.75rem;
  font-size: 0.72rem;
  color: var(--ink-muted);
  z-index: 20;
}

@media (max-width: 680px) {
  .header-tool { display: none; }
  .brand-name { font-size: 1.2rem; }
  .page { padding-top: 1.75rem; }
  .panel { padding: 1.25rem; }
  .mode-grid, .form-grid, .price-grid { grid-template-columns: 1fr; }
  .price-grid > div + div { border-left: 0; border-top: 1px solid var(--line); }
  .price-card-head, .signed-in-bar, .admin-toolbar { flex-direction: column; align-items: stretch; }
  .quote-reference { margin-left: 0; }
  .version-tag { display: none; }
}
