/* ==========================================================================
   Code Doctor | codedoctor.infanodes.com
   Family look: warm paper, ink text, green accent, white cards. This matches
   tools.infanodes.com, mortgage.infanodes.com, and
   infinite-banking.infanodes.com. Dark mode stays available as an opt-in
   toggle. Note: --orange is mapped to the family green so every inherited
   brand-chrome spot stays in the same palette.
   ========================================================================== */

:root{
  /* surface */
  --bg:#faf7f1;
  --bg2:#f1ebdd;
  --panel:#ffffff;
  --panel2:#f6f1e6;
  --line:#e7e0d2;
  --line-soft:#efe9da;

  /* ink */
  --text:#1c1a16;
  --text2:#57534a;
  --text3:#8a8474;

  /* brand chrome, mapped to the family green */
  --orange:#1d6b4f;
  --orange-bright:#2a7f5f;
  --orange-ink:#ffffff;

  /* tool accent (family green) */
  --teal:#1d6b4f;
  --teal-dim:rgba(29,107,79,0.12);
  --teal-ink:#ffffff;

  /* utility */
  --green:#1e6b46;
  --red:#b23a2e;
  --amber:#b45309;

  /* type */
  --display:'Archivo','Helvetica Neue',Arial,sans-serif;
  --body:'Inter',system-ui,-apple-system,'Segoe UI',Roboto,sans-serif;
  --mono:ui-monospace,SFMono-Regular,'SF Mono',Menlo,Consolas,monospace;

  /* geometry */
  --r-sm:8px;
  --r-md:12px;
  --r-lg:16px;
  --maxw:1200px;
  --gutter:28px;
}

:root[data-theme="dark"]{
  --bg:#0a0a0b;
  --bg2:#0f0f12;
  --panel:#15151a;
  --panel2:#1b1b21;
  --line:rgba(255,255,255,0.09);
  --line-soft:rgba(255,255,255,0.06);
  --text:#f7f7f5;
  --text2:#b9b9bf;
  --text3:#83838c;
  --orange:#f5a73a;
  --orange-bright:#ffb94d;
  --orange-ink:#1a1206;
  --teal:#2dd4bf;
  --teal-dim:rgba(45,212,191,0.14);
  --teal-ink:#062a26;
  --green:#4ec78f;
  --red:#ff7a6b;
  --amber:#f5a73a;
}

*{ box-sizing:border-box; margin:0; padding:0; }
html{ scroll-behavior:smooth; -webkit-text-size-adjust:100%; }
body{
  font-family:var(--body);
  background:var(--bg);
  color:var(--text);
  font-size:17px;
  line-height:1.65;
  -webkit-font-smoothing:antialiased;
}
img{ max-width:100%; display:block; }
a{ color:inherit; }
.wrap{ max-width:var(--maxw); margin:0 auto; padding:0 var(--gutter); }
.narrow{ max-width:820px; margin:0 auto; }

/* --------------------------------------------------------------------------
   Typography
   -------------------------------------------------------------------------- */
h1,h2{
  font-family:var(--display);
  text-transform:uppercase;
  letter-spacing:-0.015em;
  line-height:1.02;
  font-weight:800;
  font-stretch:80%;
  font-variation-settings:'wdth' 80,'wght' 800;
  color:var(--text);
  text-wrap:balance;
}
h1{ font-size:clamp(38px,6vw,68px); }
h2{ font-size:clamp(26px,3.4vw,38px); margin-bottom:14px; }
h3,h4{ font-family:var(--body); letter-spacing:-0.015em; line-height:1.25; }
h3{ font-size:20px; }
.lead{ font-size:19px; color:var(--text2); max-width:640px; }
.kicker{
  display:inline-block;
  font-size:13px; font-weight:700; letter-spacing:0.08em; text-transform:uppercase;
  color:var(--teal); margin-bottom:14px;
}
.section-sub{ color:var(--text2); max-width:680px; margin-bottom:34px; }
.accent{ color:var(--teal); }
code{ font-family:var(--mono); font-size:0.9em; }

/* --------------------------------------------------------------------------
   Parent strip + nav
   -------------------------------------------------------------------------- */
.parent-strip{
  background:var(--bg2); border-bottom:1px solid var(--line-soft);
  font-size:13.5px; color:var(--text3);
}
.parent-strip .wrap{ display:flex; align-items:center; gap:10px; padding:11px 28px; flex-wrap:wrap; }
.parent-strip b{ color:var(--text2); font-weight:600; }
.parent-strip a{ color:var(--orange); text-decoration:none; }
.parent-strip a:hover{ color:var(--orange-bright); }

nav.site-nav{ position:sticky; top:0; z-index:70; background:color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter:blur(10px); border-bottom:1px solid var(--line-soft); }
.nav{ display:flex; align-items:center; justify-content:space-between; padding-top:12px; padding-bottom:12px; }
.brand{ display:flex; align-items:center; gap:10px; text-decoration:none; font-weight:700; font-size:18px; }
.brand img{ width:30px; height:30px; border-radius:8px; }
.brand span{ letter-spacing:-0.01em; }

.theme-toggle{ display:flex; gap:4px; background:var(--panel); border:1px solid var(--line); border-radius:999px; padding:3px; }
.theme-toggle button{
  appearance:none; border:0; background:transparent; color:var(--text3);
  font-family:var(--body); font-size:12.5px; font-weight:600;
  padding:6px 12px; border-radius:999px; cursor:pointer;
  transition:background .15s ease, color .15s ease;
}
.theme-toggle button:hover{ color:var(--text); }
.theme-toggle button[aria-pressed="true"]{ background:rgba(29,107,79,0.12); color:var(--teal); }
:root[data-theme="dark"] .theme-toggle button[aria-pressed="true"]{ background:rgba(245,167,58,0.14); color:var(--orange); }

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn{
  appearance:none; border:0; cursor:pointer;
  display:inline-flex; align-items:center; gap:9px;
  background:var(--teal); color:var(--teal-ink);
  font-family:var(--body); font-weight:700; font-size:16px;
  padding:14px 26px; border-radius:var(--r-md);
  transition:transform .15s ease, box-shadow .15s ease, background .15s ease;
  text-decoration:none;
}
.btn:hover{ transform:translateY(-1px); box-shadow:0 8px 22px rgba(29,107,79,0.28); }
:root[data-theme="dark"] .btn:hover{ box-shadow:0 8px 22px rgba(45,212,191,0.25); }
.btn:active{ transform:translateY(0); }
.btn--lg{ padding:17px 30px; font-size:17px; }
.btn--block{ width:100%; justify-content:center; }
.btn--ghost{
  background:transparent; color:var(--text);
  border:1px solid var(--line);
}
.btn--ghost:hover{ background:rgba(29,107,79,0.06); border-color:rgba(29,107,79,0.35); box-shadow:none; }
:root[data-theme="dark"] .btn--ghost:hover{ background:rgba(255,255,255,0.05); border-color:rgba(255,255,255,0.2); }
.btn[disabled]{ opacity:0.55; cursor:wait; transform:none; box-shadow:none; }
.btn svg{ width:15px; height:15px; flex:0 0 15px; }
.btn-text{
  appearance:none; border:0; background:none; cursor:pointer;
  color:var(--text3); font-family:var(--body); font-size:14.5px; font-weight:600;
  padding:8px 4px;
}
.btn-text:hover{ color:var(--text); }

/* --------------------------------------------------------------------------
   Layout shell + hero
   -------------------------------------------------------------------------- */
.shell{ max-width:var(--maxw); margin:0 auto; padding:0 var(--gutter); }
section{ padding:64px 0; }
.hero{ padding:72px 0 56px; }
.hero h1{ margin-bottom:20px; max-width:820px; }
.hero-cta{ display:flex; gap:12px; margin-top:30px; flex-wrap:wrap; }
.trust-line{ margin-top:22px; color:var(--text3); font-size:15px; display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.trust-line .dot{ width:8px; height:8px; border-radius:50%; background:var(--teal); flex:0 0 8px; }
.stat-row{ display:grid; grid-template-columns:repeat(3,1fr); gap:14px; margin-top:40px; max-width:720px; }
.stat{ background:var(--panel); border:1px solid var(--line); border-radius:var(--r-md); padding:18px; }
.stat b{
  display:block; font-family:var(--display); font-size:28px; font-weight:800;
  font-stretch:80%; font-variation-settings:'wdth' 80,'wght' 800;
  color:var(--teal); line-height:1;
}
.stat span{ display:block; font-size:13px; color:var(--text3); margin-top:7px; }

/* --------------------------------------------------------------------------
   Tool
   -------------------------------------------------------------------------- */
.tool-shell{
  background:var(--panel); border:1px solid var(--line);
  border-radius:var(--r-lg); padding:clamp(20px,4vw,40px);
  box-shadow:0 24px 60px rgba(28,26,22,0.10);
}
:root[data-theme="dark"] .tool-shell{ box-shadow:0 24px 60px rgba(0,0,0,0.25); }
.tool-step{ margin-bottom:30px; }
.tool-step:last-child{ margin-bottom:0; }
.step-head{ display:flex; align-items:baseline; gap:12px; margin-bottom:14px; flex-wrap:wrap; }
.step-num{
  display:inline-flex; align-items:center; justify-content:center;
  width:30px; height:30px; border-radius:50%;
  background:var(--teal-dim); color:var(--teal);
  font-weight:800; font-size:15px; flex:0 0 30px;
}
.step-head h3{ font-size:19px; }
.step-head .hint{ margin-left:auto; font-size:13.5px; color:var(--text3); }
.step-head .hint a{ color:var(--teal); }

.field-row{ display:flex; gap:10px; flex-wrap:wrap; }
input[type="password"], input[type="text"], textarea{
  font-family:var(--body); font-size:15.5px; color:var(--text);
  background:var(--bg2); border:1px solid var(--line); border-radius:var(--r-md);
  padding:13px 15px; width:100%;
  transition:border-color .15s ease;
}
input[type="password"]:focus, input[type="text"]:focus, textarea:focus{
  outline:none; border-color:var(--teal);
}
.field-row input{ flex:1 1 280px; }
.field-row .btn{ flex:0 0 auto; }
.status-line{ margin-top:10px; font-size:14px; min-height:22px; color:var(--text3); }
.status-line.ok{ color:var(--green); }
.status-line.err{ color:var(--red); }
.status-line.busy{ color:var(--teal); }

textarea.code-box{
  font-family:var(--mono); font-size:13.5px; line-height:1.55;
  min-height:220px; resize:vertical;
}
.code-tools{ display:flex; gap:10px; margin-top:10px; flex-wrap:wrap; align-items:center; }
.char-count{ margin-left:auto; font-size:13px; color:var(--text3); font-variant-numeric:tabular-nums; }

.progress{ display:none; margin:26px 0 6px; padding:18px 20px; background:var(--bg2); border:1px solid var(--line-soft); border-radius:var(--r-md); }
.progress.on{ display:block; }
.progress-line{ display:flex; gap:10px; align-items:center; font-size:15px; color:var(--text2); padding:5px 0; }
.progress-line .spin{
  width:16px; height:16px; border-radius:50%; flex:0 0 16px;
  border:2px solid var(--line); border-top-color:var(--teal);
  animation:spin 0.9s linear infinite;
}
.progress-line.done{ color:var(--text3); }
.progress-line.done .spin{ animation:none; border:0; }
.progress-line.done .spin::after{ content:"\2713"; color:var(--green); font-size:14px; font-weight:700; }
@keyframes spin{ to{ transform:rotate(360deg); } }

.error-box{
  display:none; margin-top:18px; padding:16px 18px;
  background:rgba(178,58,46,0.07); border:1px solid rgba(178,58,46,0.32);
  border-radius:var(--r-md); font-size:14.5px;
}
:root[data-theme="dark"] .error-box{ background:rgba(255,122,107,0.08); border-color:rgba(255,122,107,0.35); }
.error-box.on{ display:block; }
.error-box b{ color:var(--red); }
.error-box pre{
  margin-top:10px; font-family:var(--mono); font-size:12.5px; line-height:1.5;
  white-space:pre-wrap; word-break:break-word; color:var(--text2);
  max-height:220px; overflow:auto;
}

/* --------------------------------------------------------------------------
   Report card
   -------------------------------------------------------------------------- */
.report{ display:none; margin-top:26px; border-top:1px solid var(--line-soft); padding-top:26px; }
.report.on{ display:block; }
.report-top{ display:flex; gap:22px; align-items:center; margin-bottom:8px; flex-wrap:wrap; }
.grade-badge{
  width:96px; height:96px; border-radius:24px; flex:0 0 96px;
  display:flex; align-items:center; justify-content:center;
  font-family:var(--display); font-size:52px; font-weight:800;
  font-stretch:80%; font-variation-settings:'wdth' 80,'wght' 800;
  color:#0a0a0b;
}
.grade-A{ background:#4ec78f; }
.grade-B{ background:#a3d65c; }
.grade-C{ background:#f5c73a; }
.grade-D{ background:#f59a3a; }
.grade-F{ background:#ff7a6b; }
.verdict{ font-size:19px; font-weight:600; max-width:560px; }
.report-actions{ display:flex; gap:10px; margin:18px 0 8px; flex-wrap:wrap; }

.finding-group{ margin-top:22px; }
.finding-group > h4{
  font-size:13px; font-weight:700; letter-spacing:0.08em; text-transform:uppercase;
  margin-bottom:12px; display:flex; align-items:center; gap:8px;
}
.finding-group > h4 .pill{
  display:inline-flex; align-items:center; justify-content:center;
  min-width:26px; height:26px; padding:0 8px; border-radius:999px;
  font-size:12.5px; color:#0a0a0b;
}
.group-critical > h4{ color:var(--red); }
.group-critical > h4 .pill{ background:var(--red); }
.group-warning > h4{ color:var(--amber); }
.group-warning > h4 .pill{ background:var(--amber); }
.group-ok > h4{ color:var(--green); }
.group-ok > h4 .pill{ background:var(--green); }

.finding{
  background:var(--bg2); border:1px solid var(--line-soft);
  border-radius:var(--r-md); padding:18px 20px; margin-bottom:12px;
}
.finding h5{ font-size:16.5px; margin-bottom:6px; }
.finding .loc{ font-family:var(--mono); font-size:12.5px; color:var(--text3); margin-bottom:10px; }
.finding .quote{
  font-family:var(--mono); font-size:13px; line-height:1.55;
  background:rgba(29,107,79,0.05); border-left:3px solid var(--red);
  padding:10px 14px; margin:10px 0; white-space:pre-wrap; word-break:break-word;
}
:root[data-theme="dark"] .finding .quote{ background:rgba(255,255,255,0.04); }
.finding .why{ font-size:15px; color:var(--text2); margin:8px 0; }
.finding .why b{ color:var(--text); }
.fix-head{ font-size:13px; font-weight:700; letter-spacing:0.06em; text-transform:uppercase; color:var(--teal); margin:14px 0 8px; }
.fix-wrap{ position:relative; }
.fix-wrap pre{
  font-family:var(--mono); font-size:13px; line-height:1.55;
  background:#0d0d10; color:#d7f5ef;
  border:1px solid var(--line-soft); border-radius:var(--r-sm);
  padding:14px 16px; padding-right:96px;
  white-space:pre-wrap; word-break:break-word;
  max-height:320px; overflow:auto;
}
/* code blocks stay dark in both themes: readable against paper, matches the tool's editor feel */
.copy-btn{
  position:absolute; top:8px; right:8px;
  appearance:none; border:1px solid var(--line); background:var(--panel2);
  color:var(--text2); font-family:var(--body); font-size:12.5px; font-weight:600;
  padding:6px 12px; border-radius:var(--r-sm); cursor:pointer;
}
.copy-btn:hover{ color:var(--text); border-color:var(--teal); }
.ok-line{ display:flex; gap:10px; align-items:flex-start; font-size:15px; color:var(--text2); padding:8px 0; }
.ok-line .tick{ color:var(--green); font-weight:700; flex:0 0 auto; }
.report-fallback pre{
  font-family:var(--mono); font-size:13.5px; line-height:1.6;
  white-space:pre-wrap; word-break:break-word;
  background:var(--bg2); border:1px solid var(--line-soft); border-radius:var(--r-md);
  padding:20px; margin-top:14px;
}

/* --------------------------------------------------------------------------
   Cards, checks grid, steps, funnel
   -------------------------------------------------------------------------- */
.checks-grid{ display:grid; grid-template-columns:repeat(auto-fit,minmax(300px,1fr)); gap:16px; }
.card{
  background:var(--panel); border:1px solid var(--line);
  border-radius:var(--r-md); padding:24px;
  transition:transform .15s ease, border-color .15s ease;
}
.card:hover{ border-color:rgba(29,107,79,0.45); transform:translateY(-2px); }
:root[data-theme="dark"] .card:hover{ border-color:rgba(245,167,58,0.4); }
.card h3{ margin-bottom:10px; }
.card p{ font-size:15.5px; line-height:1.62; color:var(--text2); }
.card .check-num{
  display:inline-flex; align-items:center; justify-content:center;
  width:34px; height:34px; border-radius:10px; margin-bottom:14px;
  background:var(--teal-dim); color:var(--teal); font-weight:800; font-size:16px;
}
.card--funnel{ display:flex; flex-direction:column; }
.card--funnel .btn{ margin-top:auto; align-self:flex-start; }
.card--funnel p{ margin-bottom:18px; }
.card--funnel .price{ font-weight:700; color:var(--text); }

.steps{ display:grid; grid-template-columns:repeat(auto-fit,minmax(240px,1fr)); gap:16px; counter-reset:step; }
.step-card{
  background:var(--panel); border:1px solid var(--line);
  border-radius:var(--r-md); padding:24px; position:relative;
}
.step-card::before{
  counter-increment:step; content:counter(step);
  display:inline-flex; align-items:center; justify-content:center;
  width:30px; height:30px; border-radius:50%; margin-bottom:14px;
  background:var(--teal-dim); color:var(--teal); font-weight:800; font-size:15px;
}
.step-card h3{ margin-bottom:8px; }
.step-card p{ font-size:15.5px; color:var(--text2); }
.privacy-note{
  margin-top:26px; padding:18px 22px;
  background:var(--teal-dim); border:1px solid rgba(29,107,79,0.3);
  border-radius:var(--r-md); font-size:15px; color:var(--text2);
}
:root[data-theme="dark"] .privacy-note{ border-color:rgba(45,212,191,0.3); }
.privacy-note b{ color:var(--teal); }

/* --------------------------------------------------------------------------
   Footer + toast
   -------------------------------------------------------------------------- */
footer{ border-top:1px solid var(--line-soft); margin-top:40px; }
footer .wrap{ display:grid; grid-template-columns:2fr 1fr 1fr; gap:32px; padding-top:44px; padding-bottom:28px; }
.f-brand .row{ display:flex; align-items:center; gap:10px; margin-bottom:12px; }
.f-brand img{ width:28px; height:28px; border-radius:8px; }
.f-brand .nm{ font-weight:700; }
.f-brand p{ font-size:14.5px; color:var(--text3); max-width:340px; }
footer h5{ font-size:13px; letter-spacing:0.08em; text-transform:uppercase; color:var(--text3); margin-bottom:14px; }
footer ul{ list-style:none; }
footer li{ margin-bottom:8px; }
footer li a{ text-decoration:none; font-size:15px; color:var(--text2); }
footer li a:hover{ color:var(--orange); }
.f-bottom{
  display:flex; justify-content:space-between; gap:12px; flex-wrap:wrap;
  border-top:1px solid var(--line-soft); padding-top:20px; padding-bottom:26px;
}
.f-bottom p{ font-size:13.5px; color:var(--text3); }

.toast{
  position:fixed; bottom:26px; left:50%; transform:translateX(-50%) translateY(20px);
  background:var(--panel2); border:1px solid var(--teal); color:var(--text);
  font-size:14.5px; font-weight:600; padding:12px 22px; border-radius:999px;
  opacity:0; pointer-events:none; transition:opacity .2s ease, transform .2s ease;
  z-index:100; max-width:90vw; text-align:center;
}
.toast.on{ opacity:1; transform:translateX(-50%) translateY(0); }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width:900px){
  footer .wrap{ grid-template-columns:1fr 1fr; }
}
@media (max-width:600px){
  .shell{ padding:0 20px; }
  .wrap{ padding:0 20px; }
  section{ padding:48px 0; }
  .stat-row{ grid-template-columns:1fr; }
  footer .wrap{ grid-template-columns:1fr; }
  .field-row .btn{ width:100%; justify-content:center; }
  .grade-badge{ width:76px; height:76px; flex-basis:76px; font-size:42px; }
  .step-head .hint{ margin-left:0; width:100%; }
}
