:root {
  color-scheme: light;
  --bg: #f6f8fb;
  --panel: #ffffff;
  --ink: #171412;
  --muted: #5f6977;
  --line: #d7dde7;
  --accent: #0b6b58;
  --accent-ink: #ffffff;
  --warning: #b65424;
  --radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(15, 23, 42, 0.06) 1px, transparent 1px),
    linear-gradient(0deg, rgba(15, 23, 42, 0.05) 1px, transparent 1px),
    var(--bg);
  background-size: 36px 36px;
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

a {
  color: var(--accent);
}

.shell {
  width: min(1040px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px 0 18px;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 18px;
}

.generator {
  align-self: center;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: 24px;
  padding: 28px;
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 24px 80px rgba(36, 30, 22, 0.11);
}

.topbar {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--ink);
  color: var(--panel);
  font-size: 0.78rem;
  letter-spacing: 0;
}

.language,
.field select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 0 12px;
}

.intro {
  align-self: center;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 0.86rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1 {
  max-width: 12ch;
  margin: 0;
  font-size: 5rem;
  line-height: 0.95;
  letter-spacing: 0;
}

.intro p:last-child {
  max-width: 42rem;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.5;
}

.password-panel {
  display: grid;
  gap: 10px;
}

.password-output {
  width: 100%;
  min-height: 78px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fff;
  color: var(--ink);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 1.45rem;
  letter-spacing: 0;
  text-align: center;
}

.password-output[data-size="md"] {
  font-size: 1.18rem;
}

.password-output[data-size="sm"] {
  font-size: 0.94rem;
}

.password-output[data-size="xs"] {
  font-size: 0.62rem;
}

.password-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

button {
  min-height: 44px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}

button:hover {
  border-color: var(--accent);
}

.primary-button {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 800;
}

.generate {
  width: 100%;
}

.countdown {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  text-align: center;
}

.metrics {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.metrics div {
  min-height: 82px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.metrics span {
  display: block;
  color: var(--muted);
  font-size: 0.86rem;
}

.metrics strong {
  display: block;
  margin-top: 8px;
  font-size: 1.15rem;
}

.controls {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: end;
}

.field {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 700;
}

.length-field input {
  width: 100%;
  accent-color: var(--accent);
}

.checks {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.checks label {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: center;
  font-weight: 700;
}

.checks input {
  accent-color: var(--accent);
}

.footer {
  display: flex;
  justify-content: center;
  gap: 18px;
  color: var(--muted);
  font-size: 0.92rem;
}

.privacy-page {
  display: block;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

[data-strength="weak"] .metrics strong {
  color: var(--warning);
}

[data-strength="excellent"] .metrics strong,
[data-strength="strong"] .metrics strong {
  color: var(--accent);
}

@media (max-width: 760px) {
  .shell {
    width: min(100% - 20px, 520px);
    padding-top: 10px;
  }

  .generator {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  h1 {
    max-width: 10ch;
    font-size: 3.2rem;
  }

  .password-output {
    font-size: 1.02rem;
  }

  .password-output[data-size="md"] {
    font-size: 0.82rem;
  }

  .password-output[data-size="sm"] {
    font-size: 0.64rem;
  }

  .password-output[data-size="xs"] {
    font-size: 0.43rem;
  }

  .metrics,
  .controls,
  .checks {
    grid-template-columns: 1fr;
  }

  .checks label {
    justify-content: flex-start;
  }
}
