:root {
  --navy: #0B2545;
  --navy-soft: #16335E;
  --blue: #2E6FF2;
  --blue-dark: #1B54D6;
  --bg: #F5F7FA;
  --white: #FFFFFF;
  --green: #1FA97A;
  --green-bg: #E9F8F2;
  --text: #16233D;
  --muted: #64748B;
  --border: #E2E8F0;
  --warn-bg: #FFF8EA;
  --warn-border: #F2C879;
  --warn-text: #7A5A0A;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(11, 37, 69, 0.06), 0 8px 24px rgba(11, 37, 69, 0.06);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; }

:focus-visible {
  outline: 2.5px solid var(--blue);
  outline-offset: 2px;
}

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

.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.persona-toggle {
  display: flex;
  gap: 2px;
  background: var(--bg-alt, #F1F5F9);
  border-radius: 999px;
  padding: 3px;
}

.persona-btn {
  border: none;
  background: none;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}

.persona-btn.active {
  background: var(--navy);
  color: #fff;
}

@media (max-width: 480px) {
  .persona-btn { padding: 6px 9px; font-size: 11.5px; }
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.brand-word {
  font-weight: 800;
  font-size: 19px;
  color: var(--navy);
  letter-spacing: -0.01em;
}

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

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

.main-wrap {
  padding-top: 28px;
  padding-bottom: 40px;
}

.hero h1 {
  font-size: 28px;
  line-height: 1.2;
  font-weight: 800;
  color: var(--navy);
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}

.subhead {
  color: var(--muted);
  font-size: 15.5px;
  margin: 0 0 22px;
  line-height: 1.45;
}

/* ---------- Card ---------- */

.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

.estimator-card { display: flex; flex-direction: column; gap: 20px; }

.field { display: flex; flex-direction: column; gap: 6px; }

.field label {
  font-weight: 700;
  font-size: 14.5px;
  color: var(--navy);
}

.optional { font-weight: 400; color: var(--muted); }

textarea, input[type="text"] {
  font-family: var(--font);
  font-size: 16px; /* prevents iOS zoom on focus */
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--text);
  width: 100%;
  resize: vertical;
}

textarea:focus, input[type="text"]:focus {
  border-color: var(--blue);
}

.char-count {
  align-self: flex-end;
  font-size: 12px;
  color: var(--muted);
}

.field-hint {
  font-size: 12.5px;
  color: var(--muted);
}

/* ---------- Photos ---------- */

.photo-previews {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.photo-thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg);
}

.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.photo-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(11, 37, 69, 0.75);
  color: white;
  border: none;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.btn-full { width: 100%; }

.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--blue);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 16.5px;
  padding: 15px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.05s ease;
}

.btn-primary:hover { background: var(--blue-dark); }
.btn-primary:active { transform: scale(0.99); }
.btn-primary:disabled { opacity: 0.65; cursor: not-allowed; }

.btn-large { min-height: 54px; }

.btn-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--white);
  color: var(--navy);
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14.5px;
  padding: 12px;
  cursor: pointer;
}

.btn-secondary:hover { border-color: var(--blue); color: var(--blue); }

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--white);
  color: var(--navy);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 14.5px;
  padding: 12px 16px;
  cursor: pointer;
}

.btn-outline:hover { border-color: var(--blue); }

/* ---------- Disclaimer / free note ---------- */

.disclaimer {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}

.free-note {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  margin-top: 18px;
}

/* ---------- Result section ---------- */

.result-section { display: flex; flex-direction: column; gap: 16px; margin-top: 24px; }

.result-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: var(--green);
  font-size: 15px;
}

.result-status svg { flex-shrink: 0; }

.result-meta { color: var(--muted); font-size: 13.5px; margin: -8px 0 0; }

.price-tiers {
  display: grid;
  grid-template-columns: 1fr 1.3fr 1fr;
  gap: 8px;
}

.price-tier {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 8px;
  text-align: center;
  background: var(--white);
}

.price-tier .tier-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--muted);
  text-transform: uppercase;
}

.price-tier .tier-value {
  font-size: 20px;
  font-weight: 800;
  color: var(--navy);
  margin-top: 4px;
}

.price-tier.recommended {
  background: var(--navy);
  border-color: var(--navy);
  transform: scale(1.04);
}

.price-tier.recommended .tier-label { color: #9EC1FF; }
.price-tier.recommended .tier-value { color: var(--white); font-size: 26px; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.stat-box {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
}

.stat-box .stat-label { font-size: 11.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; }
.stat-box .stat-value { font-size: 16px; font-weight: 700; color: var(--navy); margin-top: 3px; }

.why-box {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}

.why-box h3 { margin: 0 0 6px; font-size: 14.5px; color: var(--navy); }
.why-box p { margin: 0; font-size: 14px; line-height: 1.55; color: var(--text); }

.task-list { margin: 10px 0 0; padding-left: 18px; font-size: 13.5px; color: var(--muted); }

.warn-box {
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex;
  gap: 10px;
}

.warn-box svg { flex-shrink: 0; color: var(--warn-text); margin-top: 1px; }
.warn-box h3 { margin: 0 0 4px; font-size: 14px; color: var(--warn-text); }
.warn-box p { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--warn-text); }

.followup-box {
  background: #EEF4FF;
  border: 1px solid #C9DBFC;
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}

.followup-box h3 { margin: 0 0 8px; font-size: 14px; color: var(--navy); }
.followup-box ul { margin: 0; padding-left: 18px; font-size: 13.5px; color: var(--navy-soft); }

.action-row { display: flex; flex-direction: column; gap: 10px; }

/* Quote box */

.quote-box {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
}

.quote-box h3 { margin: 0 0 10px; font-size: 14.5px; color: var(--navy); }
.quote-text {
  white-space: pre-wrap;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin: 0 0 12px;
}

/* Materials */

.materials-box { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px; }
.materials-box h3 { margin: 0 0 4px; font-size: 14.5px; color: var(--navy); }
.materials-box .materials-sub { font-size: 12.5px; color: var(--muted); margin: 0 0 10px; }
.material-row { display: flex; justify-content: space-between; font-size: 13.5px; padding: 6px 0; border-top: 1px solid var(--border); }
.material-row:first-of-type { border-top: none; }

/* Feedback */

.feedback-box { text-align: center; }
.feedback-box p { font-weight: 700; color: var(--navy); margin: 0 0 10px; font-size: 14.5px; }
.feedback-buttons { display: flex; gap: 10px; justify-content: center; }
.feedback-btn {
  font-size: 22px;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 50%;
  width: 52px;
  height: 52px;
  cursor: pointer;
}
.feedback-btn.selected { border-color: var(--blue); background: #EEF4FF; }
.feedback-followup { margin-top: 12px; display: flex; gap: 8px; }

.feedback-thanks { color: var(--green); font-weight: 700; font-size: 14px; }

/* Ad slots — dormant, take up zero space when disabled */
.ad-slot { display: none; }
.ad-slot.enabled { display: block; margin-top: 14px; }

/* Affiliate material links */
.affiliate-links { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.affiliate-link {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--blue);
  text-decoration: none;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.affiliate-link:hover { background: #EEF4FF; border-color: var(--blue); }

/* Loading */

.loading-box {
  text-align: center;
  padding: 32px 20px;
  color: var(--navy);
  font-weight: 600;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--blue);
  border-radius: 50%;
  margin: 0 auto 14px;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Error */

.error-box {
  background: #FDEDED;
  border: 1px solid #F5C2C2;
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  color: #9B2C2C;
  font-size: 14px;
}

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

.site-footer {
  border-top: 1px solid var(--border);
  padding: 20px 0 32px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
  font-weight: 700;
}

.footer-nav { display: flex; gap: 16px; }
.footer-nav a { text-decoration: none; color: var(--muted); font-weight: 500; }
.footer-nav a:hover { color: var(--blue); }

/* ---------- Desktop ---------- */

@media (min-width: 640px) {
  .wrap { max-width: 620px; }
  .hero h1 { font-size: 32px; }
  .card { padding: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
