*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #041823;
  --bg-elevated: #0b1b2b;
  --card-bg: rgba(10, 24, 39, 0.92);
  --border: rgba(255, 255, 255, 0.08);
  --border-gold: rgba(185, 151, 91, 0.2);
  --border-focus: rgba(185, 151, 91, 0.5);
  --text: #e8efff;
  --text-strong: #f3e5c9;
  --muted: #8592b0;
  --accent: #d6b86b;
  --accent-strong: #b9975b;
  --success: #4ade80;
  --success-bg: rgba(74, 222, 128, 0.12);
  --success-border: rgba(74, 222, 128, 0.3);
  --danger: #f87171;
  --danger-bg: rgba(239, 68, 68, 0.12);
  --danger-border: rgba(239, 68, 68, 0.3);
  --radius-sm: 10px;
  --radius-lg: 16px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

html, body {
  background:
    radial-gradient(circle at top, rgba(185, 151, 91, 0.16), transparent 30%),
    radial-gradient(circle at 25% 15%, rgba(255, 219, 153, 0.08), transparent 22%),
    linear-gradient(180deg, #081926 0%, #04121d 100%);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
}

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

/* ── Header ── */
header {
  width: min(880px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(6, 20, 32, 0.82);
  backdrop-filter: blur(10px);
  border-radius: 0 0 18px 18px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, #b9975b, #d6b86b);
  display: grid;
  place-items: center;
  color: #041823;
  font-weight: 800;
  font-size: 0.85rem;
}

.header-brand h1 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-strong);
}

.tagline-pill {
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--border-gold);
  border-radius: 999px;
  padding: 0.4rem 0.75rem;
  white-space: nowrap;
}

/* ── Layout ── */
main {
  width: min(880px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 3rem;
  flex: 1;
}

.hero {
  text-align: center;
  padding: 2.5rem 0.5rem 2rem;
}

.eyebrow {
  color: var(--accent);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.hero h2 {
  font-size: clamp(1.6rem, 4vw, 2.25rem);
  color: var(--text-strong);
  line-height: 1.2;
  margin-bottom: 0.85rem;
  font-weight: 650;
}

.hero p {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.55;
  max-width: 34rem;
  margin: 0 auto;
}

/* ── Cards / grid ── */
.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 1.5rem 0 2rem;
}

.feature {
  background: var(--card-bg);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}

.feature .icon {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.feature h3 {
  color: var(--text-strong);
  font-size: 0.95rem;
  margin-bottom: 0.4rem;
}

.feature p {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.panel {
  background: var(--card-bg);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
}

.panel h3 {
  color: var(--text-strong);
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
}

.panel .lede {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 1.25rem;
}

.why-list {
  list-style: none;
  display: grid;
  gap: 0.75rem;
}

.why-list li {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.45;
}

.why-list .bullet {
  flex-shrink: 0;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 50%;
  background: rgba(185, 151, 91, 0.2);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 700;
  margin-top: 0.1rem;
}

/* ── Form ── */
.form-grid {
  display: grid;
  gap: 1rem;
}

label {
  display: grid;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-strong);
}

label .hint {
  font-weight: 400;
  color: var(--muted);
  font-size: 0.8rem;
}

input[type="tel"],
input[type="text"],
input[type="email"] {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(185, 151, 91, 0.28);
  background: rgba(4, 24, 35, 0.7);
  color: var(--text);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input::placeholder { color: #5c6a84; }

input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(185, 151, 91, 0.15);
}

input.invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.12);
}

.address-note {
  margin: -0.4rem 0 0;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--muted);
}

.consent {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.45;
  font-weight: 400;
}

.consent input {
  margin-top: 0.2rem;
  accent-color: var(--accent-strong);
  width: 1.05rem;
  height: 1.05rem;
  flex-shrink: 0;
}

.consent strong { color: var(--text); font-weight: 600; }

.consent .consent-text {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.45;
  font-weight: 400;
  cursor: pointer;
}

.consent input.invalid { outline: 2px solid var(--danger); outline-offset: 2px; }

footer .footer-links { margin-top: 0.4rem; }
footer .footer-links a { color: var(--accent); text-decoration: none; }
footer .footer-links a:hover { text-decoration: underline; }

/* ── Legal pages ── */
.legal h2 { color: var(--text-strong); font-size: 1.6rem; margin-bottom: 0.35rem; }
.legal .updated { color: var(--muted); font-size: 0.8rem; margin-bottom: 1.25rem; }
.legal h3 { margin-top: 1.4rem; }
.legal p, .legal li { color: var(--text); font-size: 0.93rem; line-height: 1.6; margin-bottom: 0.6rem; }
.legal ul { padding-left: 1.25rem; margin-bottom: 0.6rem; }
.legal .callout {
  border: 1px solid var(--border-gold);
  background: rgba(185, 151, 91, 0.08);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  margin: 0.75rem 0 1rem;
}

.actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.25rem;
}

button.cta {
  appearance: none;
  border: none;
  cursor: pointer;
  border-radius: 999px;
  padding: 0.95rem 1.5rem;
  font-size: 1rem;
  font-weight: 700;
  color: #041823;
  background: linear-gradient(135deg, #b9975b, #d6b86b);
  transition: transform 0.15s ease, filter 0.15s ease;
}

button.cta:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

button.cta:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.privacy-note {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.4;
}

.form-error {
  display: none;
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  color: var(--danger);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  font-size: 0.88rem;
  line-height: 1.4;
}

.form-error.visible { display: block; }

.form-error ul {
  margin: 0.35rem 0 0 1.1rem;
}

/* ── Success ── */
#signup-form.hidden,
#success-state.hidden { display: none; }

#success-state {
  text-align: center;
  padding: 1rem 0.5rem;
}

.success-badge {
  width: 56px;
  height: 56px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  color: var(--success);
  display: grid;
  place-items: center;
  font-size: 1.5rem;
}

#success-state h3 {
  color: var(--text-strong);
  margin-bottom: 0.5rem;
}

#success-state p {
  color: var(--muted);
  line-height: 1.5;
  max-width: 28rem;
  margin: 0 auto 1.25rem;
}

button.linkish {
  appearance: none;
  background: transparent;
  border: 1px solid var(--border-gold);
  color: var(--text-strong);
  border-radius: 999px;
  padding: 0.65rem 1.2rem;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
}

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

/* ── Context strip ── */
.context {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.5;
  border-left: 2px solid var(--accent-strong);
  padding-left: 1rem;
  margin-top: 0.5rem;
}

/* ── Footer ── */
footer {
  width: min(880px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.25rem 0.5rem 2rem;
  color: var(--muted);
  font-size: 0.78rem;
  text-align: center;
  line-height: 1.5;
}

footer .mono {
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  font-size: 0.65rem;
  margin-bottom: 0.4rem;
}

@media (max-width: 720px) {
  .features { grid-template-columns: 1fr; }
  .tagline-pill { display: none; }
  .hero { padding: 1.75rem 0 1.25rem; }
  .panel { padding: 1.25rem; }
}

/* ── Building history (post-signup membership hook) ── */
.history-panel {
  text-align: left;
  margin: 1.25rem auto 1.5rem;
  max-width: 32rem;
  padding: 1rem 1.1rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-gold);
  background: rgba(185, 151, 91, 0.06);
}

.history-panel.hidden { display: none; }

.history-panel h4 {
  color: var(--text-strong);
  font-size: 1.05rem;
  margin-bottom: 0.45rem;
  text-align: center;
}

.history-disclaimer {
  font-size: 0.78rem !important;
  color: var(--muted) !important;
  line-height: 1.45 !important;
  margin: 0 0 0.75rem !important;
  max-width: none !important;
  border-left: 2px solid var(--accent-strong);
  padding-left: 0.75rem;
}

.history-summary {
  font-size: 0.9rem !important;
  color: var(--text) !important;
  margin: 0 0 0.75rem !important;
  max-width: none !important;
  font-weight: 600;
}

.history-empty {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0;
}

.history-empty.hidden { display: none; }

.history-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin: 0;
  padding: 0;
  max-height: 22rem;
  overflow-y: auto;
}

.history-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.8rem;
  background: rgba(10, 24, 39, 0.65);
}

.history-item.open {
  border-color: rgba(74, 222, 128, 0.28);
}

.history-item.closed {
  border-color: rgba(133, 146, 176, 0.25);
}

.history-item-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.history-status {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

.history-item.open .history-status { color: var(--success); }
.history-item.closed .history-status { color: var(--muted); }

.history-date {
  font-size: 0.75rem;
  color: var(--muted);
}

.history-id {
  font-size: 0.82rem;
  color: var(--text-strong);
  font-weight: 600;
}

.history-addr {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

.history-sum {
  font-size: 0.78rem !important;
  color: var(--muted) !important;
  line-height: 1.4 !important;
  margin: 0.4rem 0 0 !important;
  max-width: none !important;
}

/* STROfile report page (mobile-first) */
.header-nav { display: flex; gap: 0.25rem; margin-left: auto; }
.header-nav a { color: var(--accent); text-decoration: none; font-weight: 600; font-size: 0.95rem; padding: 0.7rem 0.6rem; min-height: 44px; display: inline-flex; align-items: center; }
.header-nav a[aria-current="page"], .header-nav a:hover { text-decoration: underline; }
.hidden { display: none !important; }
.demo-banner { background: #7a5b00; color: #fff; padding: 0.75rem 1rem; border-radius: 10px; margin-bottom: 1rem; font-weight: 700; }
.strofile main { width: min(880px, calc(100% - 1.5rem)); }
.strofile .panel { padding: 1.1rem; }
.strofile .safety { border-left: 4px solid var(--accent); }
.strofile .safety p { font-size: 0.95rem; line-height: 1.5; }
.strofile .form-grid { display: grid; gap: 0.9rem; }
.strofile .row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.strofile label { display: flex; flex-direction: column; gap: 0.35rem; font-size: 1rem; }
.strofile input[type="text"], .strofile select, .strofile input[type="file"] {
  width: 100%; min-height: 48px; padding: 0.7rem 0.8rem; border-radius: 10px; border: 1px solid #33415c;
  background: rgba(255,255,255,0.04); color: inherit; font-size: 16px; /* 16px stops iOS zoom */
}
.strofile select option { color: #000; }
.strofile input[type="file"] { padding: 0.6rem; }
.strofile input[type="file"]::file-selector-button { min-height: 40px; margin-right: 0.75rem; border-radius: 8px; border: 0; padding: 0 1rem; font-weight: 700; background: var(--accent); color: #061420; }
.map-row { border: 1px solid #33415c; border-radius: 12px; padding: 0.8rem; margin: 0 0 0.75rem; display: grid; gap: 0.6rem; }
.map-row legend { font-weight: 700; padding: 0 0.3rem; overflow-wrap: anywhere; }
.strofile button.cta { width: 100%; min-height: 52px; font-size: 1.05rem; }
.strofile button.cta.secondary { background: transparent; border: 2px solid var(--accent); color: var(--accent); margin-top: 0.5rem; }
.strofile button.cta.danger { background: #b3261e; color: #fff; }
.strofile .actions.stack { display: flex; flex-direction: column; gap: 0.6rem; margin: 1rem 0; }
.warn { color: #ffb74d; font-weight: 600; }
.lic-cards { display: grid; gap: 0.9rem; margin: 0.75rem 0; }
.lic-card { border: 1px solid #33415c; border-radius: 14px; padding: 1rem; }
.lic-card dl { display: grid; gap: 0.6rem; margin: 0 0 0.5rem; }
.lic-card dl > div { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; border-bottom: 1px dashed #33415c; padding-bottom: 0.4rem; }
.lic-card dt { color: var(--muted); font-size: 0.9rem; }
.lic-card dd { margin: 0; font-weight: 700; text-align: right; overflow-wrap: anywhere; }
.lic-card dd.big { font-size: 1.6rem; color: var(--accent); }
#print-area { display: none; }
@media (min-width: 640px) {
  .lic-cards { grid-template-columns: 1fr 1fr; }
  .map-row { grid-template-columns: 2fr 1fr; }
  .map-row legend { grid-column: 1 / -1; }
  .strofile button.cta { width: auto; }
}
@media print {
  header, footer, main, .demo-banner { display: none !important; }
  body { background: #fff !important; color: #000 !important; }
  body.printing #print-area { display: block !important; font: 12pt/1.4 Georgia, serif; color: #000; }
  #print-area h1 { font-size: 16pt; margin: 0 0 0.3rem; }
  #print-area table { width: 100%; border-collapse: collapse; margin-top: 0.8rem; }
  #print-area th, #print-area td { border: 1px solid #999; padding: 4pt 6pt; text-align: left; }
  #print-area .pfoot { margin-top: 1rem; font-size: 9pt; color: #444; }
}

/* STROfile: Locke Industries header, how-to, license typeahead */
.header-by { margin-left: auto; color: var(--muted); font-size: 0.85rem; font-weight: 600; }
.howto { border: 1px solid #33415c; border-radius: 12px; padding: 0 0.9rem; }
.howto summary { min-height: 48px; display: flex; align-items: center; font-weight: 700; cursor: pointer; color: var(--accent); }
.howto ol { margin: 0 0 0.6rem 1.1rem; padding: 0; line-height: 1.5; font-size: 0.95rem; }
.howto li { margin-bottom: 0.35rem; }
.combo { position: relative; display: flex; flex-direction: column; gap: 0.35rem; }
.strofile input[type="search"] { width: 100%; min-height: 48px; padding: 0.7rem 0.8rem; border-radius: 10px; border: 1px solid #33415c; background: rgba(255,255,255,0.04); color: inherit; font-size: 16px; -webkit-appearance: none; appearance: none; }
.lic-list { position: absolute; top: 100%; left: 0; right: 0; z-index: 50; margin: 4px 0 0; padding: 0; list-style: none; background: #0d2234; border: 1px solid var(--accent); border-radius: 10px; max-height: 60vh; overflow-y: auto; box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
.lic-list li { min-height: 48px; padding: 0.6rem 0.8rem; display: flex; flex-direction: column; justify-content: center; border-bottom: 1px solid #22344d; cursor: pointer; font-size: 16px; }
.lic-list li span { color: var(--muted); font-size: 0.85rem; overflow-wrap: anywhere; }
.lic-list li.active, .lic-list li[role="option"]:hover { background: rgba(255,255,255,0.08); }
.lic-list li.lic-empty { color: var(--muted); cursor: default; }
.chosen { margin: 0; font-size: 0.95rem; overflow-wrap: anywhere; }
.manual-toggle { min-height: 44px; text-align: left; }
.manual { display: grid; gap: 0.6rem; }
@media (min-width: 640px) { .map-row { grid-template-columns: 1fr; } .manual { grid-template-columns: 2fr 1fr; } }
