:root {
  color-scheme: light dark;
  --bg: #f5f6fa;
  --surface: #ffffff;
  --text: #1a1d29;
  --muted: #5b6072;
  --border: #e2e4ea;
  --accent: #4f5bff;
  --accent-contrast: #ffffff;
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --radius: 14px;
  --weak: #e0525f;
  --fair: #e0a541;
  --good: #4caf6b;
  --strong: #2f9e58;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14151d;
    --surface: #1d1f2b;
    --text: #eceef5;
    --muted: #9aa0b4;
    --border: #2c2f3e;
    --accent: #7c86ff;
    --accent-contrast: #0d0e14;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
}

.wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 20px 64px;
}

header.site {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
  text-decoration: none;
}

.brand svg { flex: none; }

.lang-switch a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 999px;
}

.lang-switch a:hover { border-color: var(--accent); color: var(--accent); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

h1 {
  font-size: 1.7rem;
  margin: 4px 0 6px;
}

.lede {
  color: var(--muted);
  margin: 0 0 24px;
  font-size: 0.98rem;
}

.output-row {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

#password-output {
  flex: 1;
  font-family: var(--mono);
  font-size: 1.15rem;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  letter-spacing: 0.02em;
  overflow-x: auto;
  white-space: nowrap;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  border-radius: 10px;
}

.icon-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  width: 48px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
}

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

.strength {
  margin-bottom: 22px;
}

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

.strength-bar span {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 999px;
  transition: width 0.2s ease, background 0.2s ease;
}

.strength-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 6px;
}

.field {
  margin-bottom: 18px;
}

.field-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 0.95rem;
}

.field-row strong { font-variant-numeric: tabular-nums; }

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.checks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

.check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  user-select: none;
}

.check input { accent-color: var(--accent); width: 17px; height: 17px; }

.generate-btn {
  width: 100%;
  background: var(--accent);
  color: var(--accent-contrast);
  font-weight: 600;
  font-size: 1rem;
  padding: 14px;
  border-radius: 10px;
}

.generate-btn:hover { filter: brightness(1.05); }

.warning {
  color: var(--weak);
  font-size: 0.85rem;
  margin-top: 8px;
  min-height: 1em;
}

.trust {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 22px;
  padding: 14px 16px;
  background: var(--bg);
  border-radius: 10px;
  font-size: 0.88rem;
  color: var(--muted);
}

.trust svg { flex: none; margin-top: 2px; color: var(--good); }

section.info {
  margin-top: 48px;
}

section.info h2 {
  font-size: 1.25rem;
  margin: 0 0 10px;
}

section.info p { color: var(--muted); }

.faq-item {
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
}

.faq-item:last-child { border-bottom: none; }

.faq-item h3 {
  margin: 0 0 6px;
  font-size: 1.02rem;
}

.faq-item p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

footer.site {
  margin-top: 48px;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}

footer.site a { color: var(--muted); }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 12px);
  background: var(--text);
  color: var(--bg);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 0.9rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 480px) {
  .checks { grid-template-columns: 1fr; }
  .card { padding: 20px; }
  #password-output { font-size: 1rem; }
}
