/* Password Entropy & Pattern Analyzer - dark security-instrument theme */

:root {
  --bg: #0b0e13;
  --bg-panel: #12161f;
  --bg-inset: #0d1118;
  --border: #232a38;
  --text: #d7dde8;
  --text-dim: #8b94a7;
  --text-faint: #5b6475;
  --accent: #6ea8fe;
  --mono: "SFMono-Regular", "JetBrains Mono", "Fira Code", Consolas, "Liberation Mono", Menlo, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --c-idle: #4a5261;
  --c-critical: #ff4d5e;
  --c-bad: #ff7a45;
  --c-ok: #f5c542;
  --c-good: #9ecb45;
  --c-great: #3ecf8e;
  --c-max: #2dd4bf;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  overflow-x: hidden;
}

.wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 24px 16px 96px;
}

/* ---------- header ---------- */
.masthead { padding: 28px 0 8px; }
.masthead h1 {
  font-size: clamp(1.5rem, 4.5vw, 2.1rem);
  margin: 0 0 6px;
  letter-spacing: -0.02em;
}
.masthead .sub { color: var(--text-dim); margin: 0 0 14px; max-width: 60ch; }

.privacy-badge {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: rgba(62, 207, 142, 0.08);
  border: 1px solid rgba(62, 207, 142, 0.35);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 0.92rem;
}
.privacy-badge .dot { color: var(--c-great); font-size: 1.1rem; line-height: 1.3; }
.privacy-badge strong { color: var(--c-great); }

/* ---------- input ---------- */
.input-block { margin: 26px 0 8px; }
.input-block label { display: block; font-weight: 600; margin-bottom: 8px; }
.pw-row { display: flex; gap: 8px; }
#pw-input {
  flex: 1;
  min-width: 0;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 1.15rem;
  padding: 14px 16px;
  outline: none;
  transition: border-color 120ms;
}
#pw-input:focus { border-color: var(--accent); }
.pw-row .btn { flex-shrink: 0; }
#pw-input::placeholder { color: var(--text-faint); }

.btn {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 0.95rem;
  font-family: var(--sans);
  cursor: pointer;
  min-height: 48px;
  touch-action: manipulation;
  transition: border-color 120ms, background 120ms;
}
.btn:hover { border-color: var(--accent); }
.btn:active { background: var(--bg-inset); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #0b0e13; font-weight: 600; }
.btn.primary:hover { filter: brightness(1.1); }

.hint { color: var(--text-faint); font-size: 0.85rem; margin: 8px 0 0; }

/* ---------- gauge ---------- */
.gauge-block { margin: 18px 0 6px; text-align: center; }
.gauge-svg { width: 100%; max-width: 420px; height: auto; display: block; margin: 0 auto; }
.gauge-track { fill: none; stroke: var(--bg-inset); stroke-width: 18; stroke-linecap: round; }
.gauge-fill {
  fill: none;
  stroke: var(--c-idle);
  stroke-width: 18;
  stroke-linecap: round;
  transition: stroke-dashoffset 260ms cubic-bezier(.22,.8,.35,1), stroke 260ms;
}
.gauge-ticks text { fill: var(--text-faint); font-size: 9px; font-family: var(--mono); }
.gauge-bits {
  font-family: var(--mono);
  font-size: 2.6rem;
  font-weight: 700;
  fill: var(--text);
}
.gauge-bits-label { fill: var(--text-faint); font-size: 0.8rem; font-family: var(--mono); letter-spacing: 0.08em; }
.gauge-penalty { fill: var(--c-bad); font-size: 0.78rem; font-family: var(--mono); }

.verdict {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 2px 0 2px;
  transition: color 260ms;
}
.verdict.c-idle { color: var(--c-idle); }
.verdict.c-critical { color: var(--c-critical); }
.verdict.c-bad { color: var(--c-bad); }
.verdict.c-ok { color: var(--c-ok); }
.verdict.c-good { color: var(--c-good); }
.verdict.c-great { color: var(--c-great); }
.verdict.c-max { color: var(--c-max); }

/* ---------- scenarios ---------- */
.scenarios { margin: 14px 0 4px; }
.scenario-tabs { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.scenario-tab {
  flex: 1 1 0;
  min-width: 140px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  color: var(--text-dim);
  border-radius: 10px;
  padding: 10px 8px;
  cursor: pointer;
  font-size: 0.88rem;
  min-height: 48px;
  touch-action: manipulation;
}
.scenario-tab[aria-pressed="true"] {
  border-color: var(--accent);
  color: var(--text);
  background: rgba(110, 168, 254, 0.1);
}
.scenario-tab .t { display: block; font-family: var(--mono); font-size: 1.05rem; font-weight: 700; color: var(--text); margin-top: 2px; }
.scenario-blurb { text-align: center; color: var(--text-faint); font-size: 0.82rem; margin: 8px 0 0; }

/* ---------- pool math ---------- */
.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  margin: 22px 0;
}
.panel h2 {
  margin: 0 0 4px;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}
.panel .panel-sub { color: var(--text-faint); font-size: 0.85rem; margin: 0 0 14px; }

.pool-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.pool-chip {
  font-family: var(--mono);
  font-size: 0.82rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px;
  color: var(--text-faint);
  background: var(--bg-inset);
}
.pool-chip.on { color: var(--text); border-color: var(--accent); background: rgba(110, 168, 254, 0.08); }

.math-line {
  font-family: var(--mono);
  font-size: 0.95rem;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  overflow-x: auto;
  white-space: nowrap;
}
@media (max-width: 560px) {
  .math-line { white-space: normal; word-break: break-word; line-height: 1.9; }
}
.math-line .op { color: var(--text-faint); }
.math-line .num { color: var(--accent); }
.math-line .res { color: var(--text); font-weight: 700; }
.math-line .pen { color: var(--c-bad); }

/* ---------- findings ---------- */
.findings-list { display: flex; flex-direction: column; gap: 12px; }
.finding {
  border: 1px solid var(--border);
  border-left: 3px solid var(--c-bad);
  border-radius: 10px;
  background: var(--bg-inset);
  padding: 14px 16px;
  animation: finding-in 240ms cubic-bezier(.22,.8,.35,1) both;
}
@keyframes finding-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.finding-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.finding-label { font-weight: 700; font-size: 0.95rem; }
.finding-penalty { font-family: var(--mono); font-size: 0.85rem; color: var(--c-bad); white-space: nowrap; }
.finding-detail { font-family: var(--mono); font-size: 0.9rem; color: var(--text); margin: 6px 0; word-break: break-all; }
.finding-why { color: var(--text-dim); font-size: 0.88rem; margin: 0 0 10px; }
.finding-suggestion {
  border-top: 1px dashed var(--border);
  padding-top: 10px;
  font-size: 0.88rem;
}
.finding-suggestion .sug-label { color: var(--c-great); font-weight: 600; }
.finding-suggestion code {
  display: block;
  font-family: var(--mono);
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  margin-top: 6px;
  word-break: break-all;
  color: var(--c-great);
}
.findings-empty { color: var(--c-great); font-size: 0.92rem; }
.findings-idle { color: var(--text-faint); font-size: 0.92rem; }

/* ---------- generator ---------- */
.gen-modes { display: flex; gap: 8px; margin-bottom: 16px; }
.gen-modes .btn { flex: 1; }
.gen-modes .btn[aria-pressed="true"] { border-color: var(--accent); background: rgba(110,168,254,0.1); }

.gen-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; margin-bottom: 14px; }
.gen-controls .ctl { display: flex; flex-direction: column; gap: 6px; font-size: 0.88rem; color: var(--text-dim); }
.gen-controls .ctl.full { grid-column: 1 / -1; }
.gen-controls input[type="number"], .gen-controls input[type="text"] {
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--mono);
  padding: 10px 12px;
  font-size: 1rem;
  min-height: 44px;
}
.checks { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.checks label { display: flex; align-items: center; gap: 8px; min-height: 44px; cursor: pointer; }
.checks input { width: 20px; height: 20px; accent-color: var(--accent); }

.gen-output {
  display: flex;
  gap: 8px;
  align-items: stretch;
  margin: 6px 0 8px;
}
#gen-value {
  flex: 1;
  min-width: 0;
  font-family: var(--mono);
  font-size: 1.05rem;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  word-break: break-all;
  color: var(--c-great);
  display: flex;
  align-items: center;
  min-height: 48px;
}
.gen-meta { font-family: var(--mono); font-size: 0.85rem; color: var(--text-dim); margin: 0 0 12px; }
.gen-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- methodology ---------- */
.methodology h2 { margin-top: 0; }
.methodology h3 { font-size: 0.95rem; margin: 18px 0 6px; color: var(--text); }
.methodology p, .methodology li { color: var(--text-dim); font-size: 0.92rem; }
.methodology code { font-family: var(--mono); font-size: 0.85em; background: var(--bg-inset); padding: 1px 5px; border-radius: 4px; }
.methodology table { border-collapse: collapse; width: 100%; font-size: 0.88rem; display: block; overflow-x: auto; }
.methodology thead, .methodology tbody { display: table; width: 100%; min-width: 340px; }
.methodology th, .methodology td { border: 1px solid var(--border); padding: 8px 10px; text-align: left; }
.methodology th { color: var(--text); background: var(--bg-inset); }
.methodology td { color: var(--text-dim); font-family: var(--mono); }

footer { color: var(--text-faint); font-size: 0.8rem; text-align: center; margin-top: 48px; }

/* ---------- responsive ---------- */
@media (max-width: 560px) {
  .wrap { padding: 16px 12px 80px; }
  .gen-controls { grid-template-columns: 1fr; }
  .scenario-tab { min-width: 100px; font-size: 0.8rem; }
  .scenario-tab .t { font-size: 0.95rem; }
  #pw-input { font-size: 1rem; }
  .gauge-bits { font-size: 2.1rem; }
}
