﻿:root {
  --color-bg-dark: #14151a;
  --color-bg-dark-soft: #1d1f26;
  --color-accent: #f5a623;
  --color-accent-dark: #d6900f;
  --color-text-light: #f5f5f5;
  --color-text-muted: #9a9da6;
  --color-bg-light: #ffffff;
  --color-bg-muted: #f6f6f4;
  --color-text-dark: #1a1a1a;
  --radius: 10px;
  --container-width: 1100px;
}

* {
  box-sizing: border-box;
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  margin: 0;
  color: var(--color-text-dark);
  background: var(--color-bg-light);
  line-height: 1.6;
  font-size: 18px;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
.button:focus-visible,
.button-outline:focus-visible {
  outline: 3px solid var(--color-accent-dark);
  outline-offset: 2px;
}

.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.prose {
  max-width: 700px;
  margin: 0 auto;
}

.page-content h1 {
  margin-top: 0;
}

.page-content h2 {
  margin-top: 2rem;
}

a {
  color: var(--color-accent-dark);
}

h1, h2, h3 {
  line-height: 1.2;
}

[id] {
  scroll-margin-top: 90px;
}

/* ---- Header ---- */

.site-header {
  background: var(--color-bg-dark);
  color: var(--color-text-light);
  position: sticky;
  top: 0;
  z-index: 10;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.9rem;
  padding-bottom: 0.9rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.1rem;
  text-decoration: none;
  color: var(--color-text-light);
}

.brand-accent {
  color: var(--color-accent);
}

.brand-icon {
  width: 28px;
  height: 28px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.site-nav a {
  color: var(--color-text-light);
  text-decoration: none;
  font-size: 0.95rem;
}

.site-nav a:hover {
  color: var(--color-accent);
}

.account-link {
  color: var(--color-text-light);
  font-size: 0.9rem;
  text-decoration: none;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  cursor: pointer;
  padding: 0;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-text-light);
  margin: 0 auto;
}

/* ---- Buttons ---- */

.button {
  display: inline-block;
  background: var(--color-accent);
  color: #1a1a1a;
  padding: 0.85rem 1.6rem;
  border-radius: 999px;
  border: none;
  text-decoration: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 1.05rem;
  min-height: 44px;
}

.button:hover {
  background: var(--color-accent-dark);
}

.button-secondary {
  display: inline-block;
  background: transparent;
  color: var(--color-text-light);
  padding: 0.85rem 1.6rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  text-decoration: none;
  font-weight: 600;
  font-size: 1.05rem;
  min-height: 44px;
}

.button-outline {
  display: inline-block;
  background: transparent;
  color: var(--color-text-dark);
  padding: 0.85rem 1.6rem;
  border-radius: 999px;
  border: 2px solid #999;
  text-decoration: none;
  font-weight: 600;
  font-size: 1.05rem;
  min-height: 44px;
}

.button-outline:hover {
  border-color: var(--color-accent-dark);
  color: var(--color-accent-dark);
}

/* ---- Hero ---- */

.hero {
  background: var(--color-bg-dark);
  color: var(--color-text-light);
  padding: 4rem 0 3.5rem;
}

.hero-content {
  max-width: 640px;
}

.hero-badge {
  display: inline-block;
  border: 1px solid rgba(245, 166, 35, 0.5);
  color: var(--color-accent);
  border-radius: 999px;
  padding: 0.3rem 0.9rem;
  font-size: 0.8rem;
  margin-bottom: 1.25rem;
}

.hero h1 {
  font-size: 2.75rem;
  margin: 0 0 0.5rem;
}

.hero-subhead {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--color-accent);
  margin: 0 0 1rem;
}

.hero p {
  color: var(--color-text-muted);
  font-size: 1.05rem;
  margin-bottom: 1.75rem;
}

/* ---- Generic sections ---- */

.section {
  padding: 3.5rem 0;
}

.section-muted {
  background: var(--color-bg-muted);
}

.section-dark {
  background: var(--color-bg-dark);
  color: var(--color-text-light);
}

.section-intro {
  max-width: 640px;
  margin-bottom: 2rem;
}

.section-intro p {
  color: var(--color-text-muted);
}

.section-light .section-intro p {
  color: #555;
}

/* ---- Grids ---- */

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

.whatyouneed {
  background: var(--color-bg-muted);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
  max-width: 640px;
}

.whatyouneed h3 {
  margin-top: 0;
}

.whatyouneed ul {
  margin: 0;
  padding-left: 1.25rem;
}

.step-card {
  background: var(--color-bg-light);
  border: 1px solid #eee;
  border-radius: var(--radius);
  padding: 1.5rem;
}

.step-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--color-bg-dark);
  color: var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.75rem;
  font-size: 1.1rem;
}

.step-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #888;
}

.device-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.device-card {
  background: var(--color-bg-light);
  border: 1px solid #e3e3e3;
  border-radius: var(--radius);
  padding: 1.25rem;
}

.device-image-placeholder {
  margin-bottom: 1rem;
  text-align: center;
}

.device-image-placeholder img {
  width: 100%;
  max-width: 160px;
  aspect-ratio: 1 / 1;
  display: block;
  margin: 0 auto;
}

.device-image-placeholder-large img {
  max-width: 220px;
}

.device-image-caption {
  display: block;
  font-size: 0.75rem;
  color: #888;
  font-style: italic;
  margin-top: 0.4rem;
}

.device-card .price {
  color: var(--color-accent-dark);
  font-weight: 700;
}

.device-card .price-note {
  font-size: 0.8rem;
  color: #888;
  margin-top: -0.5rem;
}

/* ---- Forms (unchanged structurally, restyled) ---- */

input, select, textarea {
  font-size: 1rem;
  font-family: inherit;
}

.help {
  font-size: 1rem;
}

fieldset {
  border: 1px solid #ddd;
  border-radius: var(--radius);
  margin-bottom: 1rem;
}

.field {
  margin-bottom: 1rem;
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

input[type="checkbox"] {
  display: inline;
  width: auto;
  margin-right: 0.5rem;
}

.help {
  font-size: 0.95rem;
  color: #444;
  margin: 0.25rem 0;
}

.error {
  color: #b00020;
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0.25rem 0;
}

.optional-callout {
  background: #fff8ec;
  border: 1px solid var(--color-accent);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin: 0.75rem 0;
}

.optional-callout-label {
  text-transform: uppercase;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--color-accent-dark);
  margin: 0 0 0.4rem;
}

.optional-callout p:last-child {
  margin-bottom: 0;
}

.visually-hidden-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.visually-hidden-file-input:focus-visible + label.button {
  outline: 3px solid var(--color-accent-dark);
  outline-offset: 2px;
}

.files-selected-list {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0;
  font-size: 0.9rem;
}

.files-selected-list:not(:empty) {
  padding-bottom: 0.75rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid #ddd;
}

.files-selected-list li {
  padding: 0.2rem 0;
}

.disclaimer {
  font-size: 0.8rem;
  font-style: italic;
  color: #555;
}

.personalization-note {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text-dark);
  background: var(--color-bg-muted);
  border-radius: var(--radius);
  padding: 0.85rem 1.1rem;
  margin: 1rem 0;
}

/* ---- Measurement diagrams ---- */

.measurement-field {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  flex-wrap: wrap;
}

.measurement-diagram {
  flex: 0 0 176px;
  background: var(--color-bg-muted);
  border: 1px solid #e3e3e3;
  border-radius: 8px;
  padding: 0.65rem;
  text-align: center;
}

.measurement-diagram img {
  display: block;
  width: 100%;
  height: auto;
  margin-bottom: 0.5rem;
}

.visual-rule {
  font-size: 1.1rem;
  font-weight: 700;
  color: #a35a00;
  margin: 0;
  line-height: 1.4;
}

.visual-rule::before {
  content: "▸ ";
}

.measurement-inputs {
  flex: 1 1 260px;
  min-width: 220px;
}

.measurement-diagram-multi {
  flex-basis: 100%;
  background: none;
  border: none;
  padding: 0;
  text-align: left;
}

.measurement-diagram-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.6rem;
}

.measurement-diagram-item {
  flex: 0 0 140px;
  margin: 0;
  background: var(--color-bg-muted);
  border: 1px solid #e3e3e3;
  border-radius: 8px;
  padding: 0.5rem;
  text-align: center;
}

.measurement-diagram-item img {
  display: block;
  width: 100%;
  height: auto;
}

.measurement-diagram-item figcaption {
  font-weight: 700;
  font-size: 1rem;
  margin-top: 0.4rem;
}

@media (max-width: 480px) {
  .measurement-diagram {
    flex-basis: 140px;
  }

  .measurement-diagram-item {
    flex-basis: 110px;
  }
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-top: 1.5rem;
}

.faq dt {
  font-weight: 600;
  margin-top: 1rem;
}

.faq dd {
  margin: 0.25rem 0 0;
  color: #333;
}

.faq dd a {
  color: var(--color-accent-dark);
}

/* ---- Footer ---- */

.site-footer {
  background: var(--color-bg-dark);
  color: var(--color-text-muted);
  margin-top: 0;
  padding: 2.5rem 0;
  font-size: 0.9rem;
}

.site-footer .brand {
  margin-bottom: 1rem;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-bottom: 1rem;
}

.site-footer nav a {
  color: var(--color-text-muted);
}

.site-footer nav a:hover {
  color: var(--color-accent);
}

/* ---- Scroll-to-top ---- */

.scroll-top-btn {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--color-accent);
  color: #1a1a1a;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  z-index: 20;
}

.scroll-top-btn.visible {
  display: flex;
}

/* ---- Page content wrapper (non-homepage pages) ---- */

.page-content {
  padding: 2.5rem 0 3.5rem;
}

/* ---- Responsive ---- */

@media (max-width: 860px) {
  .grid,
  .device-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .hero {
    padding: 2.75rem 0 2.25rem;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .grid,
  .device-list {
    grid-template-columns: 1fr;
  }

  .section {
    padding: 2.5rem 0;
  }
}

/* ---- Mobile/tablet nav (hamburger) ---- */

@media (max-width: 900px) {
  .nav-toggle {
    display: flex;
  }

  .site-nav {
    display: none;
    flex-direction: column;
    align-items: flex-start;
    flex-basis: 100%;
    width: 100%;
    gap: 0.9rem;
    padding: 1rem 0 1.25rem;
  }

  .site-nav.open {
    display: flex;
  }

  .site-nav .button {
    margin-top: 0.5rem;
  }

  .site-nav a:not(.button):not(.account-link) {
    font-size: 1.1rem;
    padding: 0.4rem 0;
    width: 100%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .site-nav .account-link {
    padding: 0.4rem 0;
    width: 100%;
  }
}
