/* KeyForge – Password Generator | privotools.com */
/* mobile-first, responsive */

:root {
  --bg: #0f0f12;
  --surface: #1a1a1f;
  --border: #2d2d35;
  --text: #e8e8ec;
  --text-muted: #9a9aa3;
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --accent-dim: rgba(99, 102, 241, 0.12);
  --error: #f87171;
  --radius: 12px;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

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

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

/* Navigation */
.container {
  width: min(100% - 2rem, 1080px);
  margin: 0 auto;
}

.site-nav {
  background: #121218;
  border-bottom: 1px solid var(--border);
}

.site-nav-inner {
  min-height: 48px;
  max-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.wordmark {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
  white-space: nowrap;
  color: var(--text);
}

.wordmark:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 8px;
}

.nav-tagline {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Header */
.header {
  padding: 1.5rem 1rem;
  text-align: center;
}

.title {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.title-accent {
  color: var(--accent);
}

.tagline {
  margin: 0.25rem 0 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.privacy-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  padding: 0.5rem 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Main */
.main {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 1rem 2rem;
}

/* ── Type Tabs ─────────────────────────────────────────────────────────── */
.type-tabs {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.tab-btn {
  flex: 1;
  min-width: 80px;
  padding: 0.5rem 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.875rem;
  font-family: inherit;
  font-weight: 500;
  color: var(--text-muted);
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

.tab-btn.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

/* ── Config Panels ─────────────────────────────────────────────────────── */
.config-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.config-panel.hidden {
  display: none;
}

/* Slider */
.slider-row {
  margin-bottom: 0.35rem;
}

.slider-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.5rem;
}

.slider-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.slider-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
  min-width: 2rem;
  text-align: right;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: var(--border);
  outline: none;
  cursor: pointer;
  margin-bottom: 0.25rem;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

input[type="range"]:hover::-webkit-slider-thumb {
  background: var(--accent-hover);
  transform: scale(1.1);
}

input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: none;
}

/* Checkboxes */
.options-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 1rem 0 0.6rem;
}

.options-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.4rem;
}

.check-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0.4rem 0.5rem;
  border-radius: 6px;
  transition: background 0.1s;
}

.check-label:hover {
  background: var(--bg);
}

input[type="checkbox"] {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
  cursor: pointer;
  flex-shrink: 0;
}

.warn-text {
  margin: 0.75rem 0 0;
  font-size: 0.8rem;
  color: var(--error);
}

/* Separator Buttons */
.sep-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.6rem;
}

.sep-group {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.sep-btn {
  padding: 0.4rem 0.85rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  font-family: 'Courier New', Courier, monospace;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-muted);
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.sep-btn:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

.sep-btn.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

/* Toggle Switch */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.toggle-label-text {
  font-size: 0.9rem;
  color: var(--text);
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--border);
  border-radius: 22px;
  transition: background 0.2s;
}

.toggle-slider::before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s;
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--accent);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(18px);
}

/* PIN note */
.panel-note {
  margin: 0.75rem 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
  background: var(--bg);
  border-radius: 6px;
  padding: 0.5rem 0.65rem;
  border-left: 3px solid var(--border);
}

/* ── Password Output ───────────────────────────────────────────────────── */
.output-section {
  margin-bottom: 1.25rem;
}

.output-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  transition: border-color 0.2s;
}

.output-row:focus-within {
  border-color: var(--accent);
}

.pwd-display {
  flex: 1;
  min-width: 0;
  font-family: 'Courier New', Courier, monospace;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  background: transparent;
  border: none;
  outline: none;
  letter-spacing: 0.05em;
}

.pwd-display::placeholder {
  color: var(--text-muted);
  font-weight: 400;
  font-size: 0.88rem;
  letter-spacing: 0;
}

.icon-btn {
  flex-shrink: 0;
  padding: 0.3rem 0.65rem;
  font-size: 0.8rem;
  font-family: inherit;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.icon-btn:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

.icon-btn.copied {
  color: var(--accent);
  border-color: var(--accent);
}

.output-hint {
  margin: 0.4rem 0 0;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ── Strength Indicator ────────────────────────────────────────────────── */
.strength-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
}

.strength-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.strength-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.strength-label {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-muted);
  transition: color 0.3s;
}

.strength-bar-track {
  height: 8px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 0.9rem;
}

.strength-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.4s ease, background-color 0.4s ease;
}

.strength-stats {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}

.strength-stat {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.strength-stat-value {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.strength-stat-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ── Generate Button ───────────────────────────────────────────────────── */
.generate-btn {
  display: block;
  width: 100%;
  padding: 0.9rem 1rem;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: background 0.15s, transform 0.1s;
  margin-bottom: 2.5rem;
}

.generate-btn:hover {
  background: var(--accent-hover);
}

.generate-btn:active {
  transform: scale(0.99);
}

/* ── About / SEO Section ───────────────────────────────────────────────── */
#about {
  max-width: 640px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 2rem;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.95rem;
}

#about h2 {
  margin: 1.75rem 0 0.5rem;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
}

#about h2:first-of-type {
  margin-top: 0;
}

#about p {
  margin: 0.4rem 0 0.75rem;
  line-height: 1.65;
}

#about ol,
#about ul {
  margin: 0.25rem 0 0.85rem;
  padding-left: 1.25rem;
}

#about li {
  margin-bottom: 0.4rem;
  line-height: 1.6;
}

#about strong {
  color: var(--text);
}

#about .faq-item {
  padding: 0.75rem 0;
  border-top: 1px solid var(--border);
}

#about .faq-item:last-child {
  border-bottom: 1px solid var(--border);
}

#about .faq-item h3 {
  margin: 0 0 0.4rem;
  font-size: 0.97rem;
  font-weight: 600;
  color: var(--text);
}

#about .faq-item p {
  margin: 0;
}

#about table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.75rem 0 1rem;
  font-size: 0.88rem;
  overflow-x: auto;
  display: block;
}

#about th,
#about td {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}

#about th {
  background: #13131a;
  color: var(--text);
  font-weight: 600;
}

#about tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.01);
}

/* ── Footer ────────────────────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  padding: 1rem 1.5rem 1.5rem;
  margin-top: 2rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
  margin-bottom: 0.25rem;
}

.footer a {
  color: var(--text-muted);
  text-decoration: none;
}

.footer a:hover {
  color: var(--text);
  text-decoration: underline;
}

.footer-copy {
  margin: 0;
  text-align: center;
}

/* ── How to Use Guide ──────────────────────────────────────────────────── */
.guide-section {
  max-width: 640px;
  margin: 0 auto 1.5rem;
  padding: 1.5rem 1.5rem 1.75rem;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.guide-title {
  margin: 0 0 1.25rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.guide-steps {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.guide-step {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
}

.guide-step-num {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
  margin-top: 0.1rem;
}

.guide-step strong {
  display: block;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.2rem;
}

.guide-step p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.guide-step kbd {
  display: inline-block;
  padding: 0.1em 0.4em;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.82rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
}

.guide-sub {
  margin: 1.5rem 0 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.guide-body {
  margin: 0 0 0.5rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.65;
}

.guide-cases {
  margin: 0.25rem 0 1rem;
  padding-left: 1.2rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.guide-cases li {
  margin-bottom: 0.5rem;
}

.guide-cases strong {
  color: var(--text);
}

.guide-cases code {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.85em;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.1em 0.35em;
  color: var(--text);
}

.guide-blog-link {
  margin: 0.25rem 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 0.75rem 1rem;
  background: var(--bg);
  border-radius: 8px;
  border-left: 3px solid var(--accent);
  line-height: 1.5;
}

.guide-blog-link a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.guide-blog-link a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}