/* LVToolbox.com — shared styles */
:root {
  --bg: #0b1220;
  --bg-card: #121c30;
  --bg-input: #0e1626;
  --border: #24334f;
  --border-strong: #54688c;  /* >=3:1 vs input bg — WCAG 1.4.11 */
  --text: #e6edf7;
  --text-dim: #9db0cc;
  --accent: #35c7a4;
  --accent-dark: #2aa387;
  --warn: #f2b84b;
  --danger: #f26d6d;
  --radius: 12px;
  --maxw: 1060px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Header */
header {
  border-bottom: 1px solid var(--border);
  background: rgba(11, 18, 32, 0.92);
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(8px);
}
.nav {
  max-width: var(--maxw); margin: 0 auto; padding: 0.8rem 1.2rem;
  display: flex; align-items: center; gap: 1.4rem; flex-wrap: wrap;
}
.logo { font-weight: 700; font-size: 1.15rem; color: var(--text); letter-spacing: 0.2px; }
.logo:hover { text-decoration: none; }
.logo .tld { color: var(--accent); }
.logo .shield { margin-right: 0.45rem; }
.nav-links { display: flex; gap: 0.4rem 0.95rem; flex-wrap: wrap; margin-left: auto; }
.nav-links a { color: var(--text-dim); font-size: 0.87rem; }
.nav-links a:hover, .nav-links a.active { color: var(--text); text-decoration: none; }

/* Layout */
main { max-width: var(--maxw); margin: 0 auto; padding: 2.2rem 1.2rem 3rem; }
.hero { text-align: center; padding: 2.2rem 0 1.6rem; }
.hero h1 { font-size: clamp(1.7rem, 4vw, 2.6rem); line-height: 1.2; margin-bottom: 0.8rem; }
.hero p.sub { color: var(--text-dim); max-width: 640px; margin: 0 auto; font-size: 1.06rem; }
.hero .accent { color: var(--accent); }

h1 { font-size: clamp(1.5rem, 3.5vw, 2.1rem); margin-bottom: 0.5rem; }
.page-intro { color: var(--text-dim); max-width: 760px; margin-bottom: 1.8rem; }

/* Cards / grid */
.tool-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.1rem; margin: 1.1rem 0 2rem; }
.cat-title { font-size: 1.05rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent); margin-top: 2.2rem; }
.card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.4rem;
  transition: border-color 0.15s ease, transform 0.15s ease;
  display: block; color: var(--text);
}
a.card:hover { border-color: var(--accent); transform: translateY(-2px); text-decoration: none; }
.card .icon { font-size: 1.7rem; display: block; margin-bottom: 0.55rem; }
.card h2, .card h3 { font-size: 1.12rem; margin-bottom: 0.4rem; }
.card p { color: var(--text-dim); font-size: 0.93rem; }

/* Calculator layout */
.calc-wrap { display: grid; grid-template-columns: 1.15fr 1fr; gap: 1.4rem; align-items: start; }
@media (max-width: 860px) { .calc-wrap { grid-template-columns: 1fr; } }
.panel { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; }
.panel h2 { font-size: 1.05rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-dim); margin-bottom: 1.1rem; }

.field { margin-bottom: 1.05rem; }
.field label { display: block; font-size: 0.9rem; color: var(--text-dim); margin-bottom: 0.35rem; }
.field input[type="number"], .field select {
  width: 100%; padding: 0.6rem 0.7rem;
  background: var(--bg-input); border: 1px solid var(--border-strong);
  border-radius: 8px; color: var(--text); font-size: 1rem;
}
.field input:focus-visible, .field select:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem; }
@media (max-width: 480px) { .field-row { grid-template-columns: 1fr; } }
.hint { font-size: 0.8rem; color: var(--text-dim); margin-top: 0.3rem; }

/* Results */
.result-big {
  font-size: 2.2rem; font-weight: 700; color: var(--accent);
  line-height: 1.15; margin-bottom: 0.15rem; word-break: break-word;
}
.result-label { color: var(--text-dim); font-size: 0.9rem; margin-bottom: 1.1rem; }
.result-rows { border-top: 1px solid var(--border); margin-top: 0.8rem; }
.result-row {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: 0.55rem 0; border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}
.result-row span:first-child { color: var(--text-dim); }
.result-row strong { text-align: right; }
.badge {
  display: inline-block; padding: 0.15rem 0.6rem; border-radius: 999px;
  font-size: 0.8rem; font-weight: 600;
}
.badge.ok { background: rgba(53, 199, 164, 0.15); color: var(--accent); }
.badge.warn { background: rgba(242, 184, 75, 0.15); color: var(--warn); }
.badge.bad { background: rgba(242, 109, 109, 0.15); color: var(--danger); }
.note-box {
  margin-top: 1rem; padding: 0.8rem 1rem; border-left: 3px solid var(--accent);
  background: rgba(53, 199, 164, 0.07); border-radius: 0 8px 8px 0;
  font-size: 0.88rem; color: var(--text-dim);
}
.note-box.warn { border-left-color: var(--warn); background: rgba(242, 184, 75, 0.07); }

/* Device table (PoE / bandwidth) */
table.device-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
table.device-table th {
  text-align: left; color: var(--text-dim); font-weight: 600;
  padding: 0.4rem 0.5rem 0.4rem 0; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.05em;
}
table.device-table td { padding: 0.35rem 0.5rem 0.35rem 0; }
table.device-table input, table.device-table select {
  width: 100%; padding: 0.45rem 0.5rem;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 6px; color: var(--text); font-size: 0.92rem;
}
.btn {
  display: inline-block; cursor: pointer; border: none;
  background: var(--accent); color: #06251d; font-weight: 700;
  padding: 0.6rem 1.2rem; border-radius: 8px; font-size: 0.95rem;
}
.btn:hover { background: var(--accent-dark); }
.btn.ghost { background: transparent; border: 1px solid var(--border); color: var(--text-dim); font-weight: 500; }
.btn.ghost:hover { border-color: var(--accent); color: var(--text); }
.btn-remove { background: transparent; border: none; color: var(--danger); cursor: pointer; font-size: 1.05rem; padding: 0.2rem 0.4rem; }

/* Content sections */
.content-section { margin-top: 2.6rem; max-width: 800px; }
.content-section h2 { font-size: 1.35rem; margin-bottom: 0.7rem; }
.content-section h3 { font-size: 1.08rem; margin: 1.2rem 0 0.4rem; }
.content-section p, .content-section li { color: var(--text-dim); font-size: 0.97rem; }
.content-section ul, .content-section ol { padding-left: 1.3rem; margin: 0.5rem 0 0.9rem; }
.content-section table { width: 100%; border-collapse: collapse; margin: 0.8rem 0 1.2rem; font-size: 0.92rem; }
.content-section table th, .content-section table td { border: 1px solid var(--border); padding: 0.5rem 0.7rem; text-align: left; }
.content-section table th { background: var(--bg-card); }

/* FAQ */
details.faq {
  border: 1px solid var(--border); border-radius: 10px;
  padding: 0.85rem 1.1rem; margin-bottom: 0.7rem; background: var(--bg-card);
}
details.faq summary { cursor: pointer; font-weight: 600; font-size: 0.98rem; }
details.faq p { margin-top: 0.6rem; color: var(--text-dim); font-size: 0.94rem; }

/* CTA */
.cta-box {
  margin: 2.6rem 0 0; padding: 1.6rem; text-align: center;
  background: linear-gradient(135deg, rgba(53,199,164,0.12), rgba(53,199,164,0.03));
  border: 1px solid rgba(53,199,164,0.35); border-radius: var(--radius);
}
.cta-box h2 { font-size: 1.25rem; margin-bottom: 0.4rem; }
.cta-box p { color: var(--text-dim); margin-bottom: 1rem; font-size: 0.95rem; }
.cta-box .brand {
  color: var(--accent); font-weight: 600; white-space: nowrap;
  text-decoration: none; border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease;
}
.cta-box a.brand:hover { border-bottom-color: var(--accent); }

/* Ad slots (placeholders — activate after AdSense approval) */
.ad-slot {
  margin: 1.6rem 0; min-height: 90px; display: flex; align-items: center; justify-content: center;
  border: 1px dashed var(--border); border-radius: 8px; color: #8296b8;  /* was #3d5074 (2.3:1) */ font-size: 0.8rem;
}

/* Mobile refinements */
@media (max-width: 640px) {
  main { padding: 1.5rem 0.9rem 2.4rem; }
  .nav { padding: 0.7rem 0.9rem; gap: 0.6rem 1rem; }
  .nav-links { gap: 0.3rem 0.85rem; }
  .panel { padding: 1.1rem; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table.device-table { min-width: 460px; }   /* readable columns; panel scrolls sideways instead of squeezing */
  .content-section table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; }
  .result-big { font-size: 1.8rem; }
  .cta-box { padding: 1.2rem 1rem; }
  .field input[type="number"], .field select { font-size: 16px; }  /* prevents iOS auto-zoom on focus */
}

/* Footer */
footer { border-top: 1px solid var(--border); margin-top: 3rem; }
.footer-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 1.8rem 1.2rem;
  display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between;
  color: var(--text-dim); font-size: 0.86rem;
}
.footer-links { display: flex; gap: 1rem; flex-wrap: wrap; }
.disclaimer { font-size: 0.78rem; color: #5b6f92; max-width: var(--maxw); margin: 0 auto; padding: 0 1.2rem 1.6rem; }

/* --- accessibility additions --- */
a:focus-visible, button:focus-visible, summary:focus-visible,
input:focus-visible, select:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 3px;
}
.btn.ghost { color: var(--text); }  /* stronger than text-dim for control labels */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  a.card:hover { transform: none; }
}


/* Dual-path result CTA (P0-C) — visitor's next-step choice after a result */
.dp-cta { margin: 2.4rem 0 0; }
.dp-cta-title { font-size: 1.2rem; margin-bottom: 1rem; text-align: center; }
.dp-cta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
@media (max-width: 760px) { .dp-cta-grid { grid-template-columns: 1fr; } }
.dp-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.3rem; }
.dp-card-pro { border-color: rgba(53,199,164,0.45); }
.dp-eyebrow { font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-dim); margin-bottom: 0.4rem; font-weight: 700; }
.dp-card h3 { font-size: 1.08rem; margin-bottom: 0.45rem; color: var(--text); }
.dp-card p { color: var(--text-dim); font-size: 0.93rem; margin-bottom: 1rem; }
.dp-card .btn { text-decoration: none; }
.dp-btn-outline { background: transparent; border: 1px solid var(--border-strong); color: var(--text); }
.dp-btn-outline:hover { border-color: var(--accent); color: var(--text); background: transparent; }
.dp-card a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
