:root {
  --bg: #0f1419;
  --surface: #1a222d;
  --surface2: #232d3b;
  --border: #344054;
  --text: #e8edf4;
  --muted: #9aa8bc;
  --accent: #3d9aed;
  --accent-dim: #2563a8;
  --success: #34d399;
  --warn: #fbbf24;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg) 100%);
}

.site-brand {
  margin: 0 0 0.85rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.15rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-align: center;
}

.brand-pdpm {
  color: var(--text);
}

.brand-org {
  color: #6dc9b4;
}

header h1 {
  margin: 0 0 0.35rem;
  font-size: 1.35rem;
  font-weight: 650;
}

header p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  max-width: 72ch;
}

header p + p {
  margin-top: 0.65rem;
}

header p.tool-scope-note {
  font-size: 0.82rem;
  opacity: 0.92;
}

.tabs {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.tabs button {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 0.45rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.92rem;
}

.tabs button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #051018;
  font-weight: 600;
}

main {
  padding: 1.25rem 1.5rem 3rem;
  max-width: 1200px;
  margin: 0 auto;
}

.panel {
  display: none;
}

.panel.active {
  display: block;
}

.section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.15rem;
  margin-bottom: 1rem;
}

.section h2 {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--accent);
}

.section h3 {
  margin: 1rem 0 0.5rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.65rem 1.25rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.field label {
  font-size: 0.78rem;
  color: var(--muted);
}

.field small {
  font-size: 0.72rem;
  color: var(--muted);
  opacity: 0.85;
}

select,
input[type="number"] {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  font-size: 0.88rem;
}

input[type="checkbox"] {
  accent-color: var(--accent);
}

.cb-row {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  font-size: 0.86rem;
}

.cb-row label {
  cursor: pointer;
}

.results {
  position: sticky;
  bottom: 0;
  background: linear-gradient(180deg, transparent, var(--bg) 12%);
  padding-top: 1rem;
}

.results-inner {
  background: var(--surface2);
  border: 1px solid var(--accent-dim);
  border-radius: 12px;
  padding: 1rem 1.15rem;
}

.results-inner h2 {
  margin: 0 0 0.65rem;
  font-size: 1rem;
  color: var(--success);
}

.score-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.5rem;
}

.score-pill {
  background: var(--surface);
  border-radius: 8px;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--border);
}

.score-pill strong {
  display: block;
  font-size: 1.05rem;
  color: var(--text);
}

.score-pill span {
  font-size: 0.72rem;
  color: var(--muted);
}

.disclaimer {
  margin-top: 0.75rem;
  font-size: 0.72rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  padding-top: 0.65rem;
}

details.raw {
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: var(--muted);
}

details.raw pre {
  margin: 0.5rem 0 0;
  padding: 0.65rem;
  background: var(--bg);
  border-radius: 8px;
  overflow: auto;
  font-size: 0.72rem;
  color: #cbd5e1;
}

.mono {
  font-family: ui-monospace, "Cascadia Code", monospace;
}

.site-footer {
  padding: 1.25rem 1.5rem 2rem;
  border-top: 1px solid var(--border);
  background: var(--surface);
  text-align: center;
}

.site-footer p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.site-footer a {
  color: #5eb89e;
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

/* Gate / contact form (index.html before tool.html) */
.gate-intro {
  max-width: 62ch;
  margin: 0 auto;
}

.gate-layout {
  padding: 1.25rem 1.5rem 3rem;
  max-width: 520px;
  margin: 0 auto;
}

.gate-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem 1.35rem 1.5rem;
}

.gate-card h2 {
  margin: 0 0 0.65rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--accent);
}

.gate-muted {
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.gate-muted:last-child {
  margin-bottom: 0;
}

.gate-before-form {
  margin-bottom: 1rem;
}

.gate-form .gate-field {
  margin-bottom: 0.85rem;
}

.gate-form label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--text);
}

.gate-form .req {
  color: var(--warn);
  font-weight: 700;
}

.gate-form .opt {
  font-weight: 400;
  color: var(--muted);
}

.gate-form input[type="text"],
.gate-form input[type="email"],
.gate-form input[type="tel"] {
  width: 100%;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font-size: 0.95rem;
}

.gate-form input:focus {
  outline: 2px solid var(--accent-dim);
  outline-offset: 1px;
}

.gate-honey {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.gate-check {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  font-size: 0.88rem;
  color: var(--muted);
  cursor: pointer;
  margin: 0.5rem 0 1rem;
  line-height: 1.45;
}

.gate-check input {
  margin-top: 0.2rem;
  flex-shrink: 0;
}

.gate-error {
  min-height: 1.25rem;
  margin: 0 0 0.65rem;
  font-size: 0.88rem;
  color: #f87171;
}

.gate-submit {
  width: 100%;
  padding: 0.65rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--accent-dim);
  background: var(--accent);
  color: #051018;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
}

.gate-submit:hover:not(:disabled) {
  filter: brightness(1.06);
}

.gate-submit:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.gate-layout-wide {
  max-width: 560px;
}

.gate-tabs-nav {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.gate-tab {
  flex: 1;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.92rem;
}

.gate-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #051018;
  font-weight: 600;
}

.gate-banner {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  border: 1px solid #f87171;
  background: rgba(248, 113, 113, 0.08);
}

.gate-banner code {
  font-size: 0.82em;
}

.gate-success {
  min-height: 1.25rem;
  margin: 0 0 0.65rem;
  font-size: 0.88rem;
  color: var(--success);
}

.gate-hint {
  margin: 0.25rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}

#gate-main input[readonly] {
  opacity: 0.88;
  cursor: default;
}

.gate-forgot-row {
  margin: -0.25rem 0 0.5rem;
}

.gate-text-btn {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  color: var(--accent);
  font: inherit;
  font-size: 0.88rem;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.gate-text-btn:hover {
  color: #6eb8f7;
}

.forgot-panel {
  padding: 0.85rem 0 0;
  margin: 0 0 0.35rem;
  border-top: 1px solid var(--border);
}

.gate-submit-secondary {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent-dim);
}

.gate-submit-secondary:hover:not(:disabled) {
  background: var(--surface2);
}
