/* PawPlan · Pet Adoption Fee Financing Planner */
:root {
  --bg: #fdf8f3;
  --surface: #ffffff;
  --surface-alt: #fef3e2;
  --border: #e8dcc8;
  --text: #2d2a26;
  --text-muted: #6b6560;
  --primary: #f97316;
  --primary-hover: #ea580c;
  --primary-light: #fff7ed;
  --accent: #16a34a;
  --accent-light: #f0fdf4;
  --danger: #dc2626;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.10);
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --max-width: 1120px;
  --container-padding: 1.5rem;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 0.5em; }
h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 700; }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); font-weight: 700; }
h3 { font-size: 1.1rem; font-weight: 600; }
p { margin: 0 0 1em; color: var(--text-muted); }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

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

/* Header */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
  gap: 1rem;
}
.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
}
.logo:hover { text-decoration: none; }
nav { display: flex; gap: 1.25rem; flex-wrap: wrap; }
nav a {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
}
nav a:hover { color: var(--text); border-bottom-color: var(--primary); text-decoration: none; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.15s ease;
  text-decoration: none;
  line-height: 1.3;
}
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); text-decoration: none; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }

/* Hero */
.hero {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 3rem;
  padding: 3.5rem 0 2.5rem;
  align-items: start;
}
.hero-text { max-width: 560px; }
.eyebrow {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary);
  margin-bottom: 0.5rem;
}
.lead { font-size: 1.1rem; color: var(--text); margin-bottom: 1.5rem; }
.hero-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }

.hero-stat {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}
.stat-num { font-size: 1.5rem; font-weight: 700; color: var(--primary); }
.stat-label { font-size: 0.85rem; color: var(--text-muted); }

/* Sections */
section { padding: 2.5rem 0; }
.section-intro { max-width: 640px; margin-bottom: 1.5rem; }

/* Planner */
.planner-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.75rem;
}
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
}
.panel h3 { margin-bottom: 1.25rem; }

fieldset { border: none; padding: 0; margin: 0 0 1rem; }
fieldset legend { font-size: 0.85rem; font-weight: 600; margin-bottom: 0.5rem; color: var(--text-muted); }

.preset-row { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.preset-btn {
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: 2px solid var(--border);
  background: var(--surface);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.preset-btn:hover { border-color: var(--primary); }
.preset-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.field { display: flex; flex-direction: column; margin-bottom: 1rem; }
.field span { font-size: 0.85rem; font-weight: 600; margin-bottom: 0.35rem; color: var(--text-muted); }
.field input {
  padding: 0.6rem 0.85rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: var(--font);
  background: var(--surface);
  transition: border-color 0.15s;
}
.field input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(249,115,22,0.15); }

.btn-row { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.5rem; }
.hint { font-size: 0.8rem; color: var(--accent); margin-top: 0.5rem; min-height: 1.2em; }

/* Results */
.result-big {
  text-align: center;
  padding: 1.5rem;
  background: var(--primary-light);
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
}
.result-amount { font-size: 2.4rem; font-weight: 800; color: var(--primary); display: block; }
.result-period { font-size: 0.9rem; color: var(--text-muted); }

.result-summary { margin-bottom: 1.5rem; }
.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.summary-row:last-child { border-bottom: none; }
.summary-row strong { color: var(--text); }

.progress-wrap { margin-bottom: 1.5rem; }
.progress-bar {
  height: 12px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.4s ease;
  width: 0%;
}
.progress-label { font-size: 0.8rem; margin-top: 0.35rem; color: var(--text-muted); text-align: center; }

.weekly-breakdown { margin-bottom: 1.25rem; }
.weekly-breakdown h4 { font-size: 0.9rem; margin-bottom: 0.5rem; }
.weekly-list {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}
.weekly-list li {
  padding: 0.4rem 0.75rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
}
.weekly-list li:last-child { border-bottom: none; }
.weekly-list li:nth-child(even) { background: var(--surface-alt); }

.result-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* Checklist */
.checklist-categories {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}
.checklist-cat h3 { color: var(--primary); margin-bottom: 0.75rem; }
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { margin-bottom: 0.5rem; }
.checklist label { font-size: 0.9rem; cursor: pointer; }
.checklist input[type="checkbox"] { margin-right: 0.5rem; accent-color: var(--primary); }

.checklist-total {
  background: var(--accent-light);
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
}
.checklist-total strong { font-size: 1.1rem; color: var(--accent); }

/* Scenarios */
.scenario-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.scenario-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}
.scenario-tag {
  display: inline-block;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  margin-bottom: 0.75rem;
}
.scenario-card h3 { margin-bottom: 0.5rem; font-size: 1.05rem; }
.scenario-card ul { padding-left: 1.25rem; margin-bottom: 0.75rem; font-size: 0.9rem; }
.scenario-card ul li { margin-bottom: 0.2rem; }
.scenario-note { font-size: 0.85rem; color: var(--text-muted); font-style: italic; }

/* Tips */
.tips-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}
.tip-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  border-top: 3px solid var(--primary);
}
.tip-card h3 { font-size: 1rem; margin-bottom: 0.5rem; }
.tip-card p { font-size: 0.9rem; margin-bottom: 0; }

/* Assumptions */
.assumptions-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.assumptions-grid p { font-size: 0.9rem; }

/* FAQ */
.faq { margin: 0; }
.faq dt {
  font-weight: 700;
  margin-top: 1.25rem;
  color: var(--text);
  font-size: 0.95rem;
}
.faq dd {
  margin-left: 0;
  margin-bottom: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.faq dt:first-child { margin-top: 0; }

/* CTA */
.cta-section {
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
  margin: 2.5rem 0;
}
.cta-section h2 { margin-bottom: 0.5rem; }
.cta-section p { max-width: 500px; margin: 0 auto 1.5rem; }

/* Footer */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  margin-top: 2rem;
}
.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: center;
  text-align: center;
}
.footer-brand { display: flex; flex-direction: column; }
.footer-brand strong { font-size: 1.1rem; }
.footer-brand span { font-size: 0.85rem; color: var(--text-muted); }
.footer-inner nav { display: flex; gap: 1rem; flex-wrap: wrap; justify-content: center; }
.footer-inner nav a { font-size: 0.85rem; }
.footer-meta { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 0; }

/* Focus styles */
:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Print */
@media print {
  .site-header, .site-footer, .btn-row, .result-actions, .hero-actions { display: none; }
  .panel { break-inside: avoid; box-shadow: none; border: 1px solid #ccc; }
  body { background: #fff; }
}

/* Responsive */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 1.5rem; padding: 2rem 0; }
  .hero-stat { flex-direction: row; flex-wrap: wrap; }
  .stat-card { flex: 1 1 120px; }
  .planner-grid { grid-template-columns: 1fr; }
  .checklist-categories { grid-template-columns: 1fr 1fr; }
  .scenario-grid { grid-template-columns: 1fr; }
  .tips-grid { grid-template-columns: 1fr 1fr; }
  .assumptions-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .header-inner { flex-direction: column; gap: 0.5rem; }
  nav { justify-content: center; gap: 0.75rem; }
  .hero-stat { flex-direction: column; }
  .checklist-categories { grid-template-columns: 1fr; }
  .tips-grid { grid-template-columns: 1fr; }
  .panel { padding: 1.25rem; }
  .result-amount { font-size: 1.8rem; }
  .btn { padding: 0.55rem 1rem; font-size: 0.85rem; }
  section { padding: 1.5rem 0; }
  .cta-section { padding: 1.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a1816;
    --surface: #252220;
    --surface-alt: #2d2926;
    --border: #3d3833;
    --text: #e8e4de;
    --text-muted: #a09a93;
    --primary-light: #3d2515;
    --accent-light: #1a2e1f;
  }
  .field input { color: var(--text); }
}


/* Factory-injected deployment helpers. The AI owns the site design above this block. */
.ad-unit {
  width: min(100%, 720px);
  min-height: 120px;
  margin: 24px auto;
  display: block;
}

.legal-page {
  width: min(900px, calc(100% - 32px));
  margin: 40px auto;
}

.factory-fallback-nav {
  width: min(900px, calc(100% - 32px));
  margin: 24px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  font-size: 0.95rem;
}

.factory-fallback-nav a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}
