:root {
  color-scheme: light;
  --bg: #f7f8fb;
  --bg-deep: #eaf0ee;
  --panel: #ffffff;
  --panel-soft: #f3f6f8;
  --panel-alt: #eef7f3;
  --text: #111827;
  --muted: #647084;
  --line: #dde3ea;
  --line-strong: #c8d1dc;
  --accent: #0f766e;
  --accent-dark: #0b5f59;
  --accent-soft: #dff4ef;
  --ink: #1f2937;
  --danger: #b42318;
  --shadow: 0 24px 70px rgba(17, 24, 39, 0.14);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(145deg, rgba(15, 118, 110, 0.12), transparent 34%),
    linear-gradient(315deg, rgba(214, 107, 61, 0.12), transparent 38%),
    linear-gradient(180deg, #ffffff 0%, var(--bg-deep) 100%),
    var(--bg);
  color: var(--text);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.28);
  outline-offset: 2px;
}

.page {
  width: min(1180px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 44px 0;
  display: grid;
  align-items: center;
}

.app {
  display: grid;
  grid-template-columns: minmax(300px, 0.82fr) minmax(340px, 1.18fr);
  gap: 32px;
  align-items: start;
}

.intro {
  padding: 10px 12px 0 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 34px;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.22), transparent 46%),
    var(--accent);
  color: #fff;
  font-weight: 900;
  box-shadow: 0 12px 24px rgba(15, 118, 110, 0.24);
}

h1 {
  margin: 0;
  max-width: 9ch;
  font-size: 5.35rem;
  line-height: 0.93;
  letter-spacing: 0;
}

.intro p {
  max-width: 32rem;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.65;
}

.character-strip {
  max-width: 34rem;
  margin-top: 30px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.character-strip span {
  min-width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  box-shadow: 0 8px 18px rgba(17, 24, 39, 0.06);
  font-family:
    "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.92rem;
  font-weight: 800;
}

.privacy-note {
  margin-top: 22px;
  padding: 14px 16px;
  border: 1px solid rgba(15, 118, 110, 0.2);
  border-radius: 8px;
  background: rgba(223, 244, 239, 0.7);
  color: #24534f;
  line-height: 1.45;
}

.generator {
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.generator-header {
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.8)),
    var(--panel-soft);
}

.generator-header h2 {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.2;
  letter-spacing: 0;
}

.generator-header p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.local-badge {
  flex: 0 0 auto;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(15, 118, 110, 0.18);
  border-radius: 8px;
  padding: 0 12px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 0.82rem;
  font-weight: 850;
}

.controls {
  padding: 24px;
  display: grid;
  gap: 24px;
  border-bottom: 1px solid var(--line);
}

.control-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

label,
legend {
  display: block;
  margin-bottom: 8px;
  color: #2d3748;
  font-size: 0.92rem;
  font-weight: 800;
}

.character-groups {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

input[type="number"] {
  width: 100%;
  height: 50px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 0 14px;
  background: #fbfcfe;
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.help-text {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.toggles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.toggle {
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 11px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fbfcfe;
  color: var(--ink);
  font-weight: 780;
  transition:
    border-color 140ms ease,
    background-color 140ms ease,
    box-shadow 140ms ease;
}

.toggle:has(input:checked) {
  border-color: rgba(15, 118, 110, 0.42);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px rgba(15, 118, 110, 0.08);
}

.toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.generate-row {
  display: flex;
  gap: 12px;
  align-items: center;
  padding-top: 2px;
}

.primary-button,
.copy-button {
  border: 0;
  border-radius: 8px;
  font-weight: 800;
  transition:
    background-color 140ms ease,
    transform 140ms ease;
}

.primary-button {
  min-height: 52px;
  padding: 0 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), transparent),
    var(--accent);
  color: #fff;
  box-shadow: 0 14px 24px rgba(15, 118, 110, 0.22);
}

.primary-button:hover {
  background: var(--accent-dark);
}

.primary-button:active,
.copy-button:active {
  transform: translateY(1px);
}

.status {
  min-height: 1.35em;
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.status.error {
  color: var(--danger);
  font-weight: 700;
}

.results {
  min-height: 300px;
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.34), transparent),
    var(--panel-alt);
  display: grid;
  gap: 10px;
}

.password-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 13px;
  border: 1px solid rgba(15, 118, 110, 0.14);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(17, 24, 39, 0.06);
}

.password {
  min-width: 0;
  overflow-wrap: anywhere;
  user-select: all;
  font-family:
    "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 1.05rem;
  line-height: 1.45;
}

.copy-button {
  min-width: 82px;
  min-height: 40px;
  padding: 0 12px;
  background: var(--ink);
  color: #fff;
  font-size: 0.9rem;
}

.copy-button:hover {
  background: #111a27;
}

.copy-button.copied {
  background: var(--accent);
}

.empty {
  min-height: 240px;
  display: grid;
  place-items: center;
  border: 1px dashed #afc3bc;
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
  padding: 24px;
  background: rgba(255, 255, 255, 0.42);
}

@media (max-width: 820px) {
  .page {
    width: min(100% - 24px, 620px);
    padding: 24px 0;
    align-items: start;
  }

  .app,
  .control-grid,
  .toggles {
    grid-template-columns: 1fr;
  }

  .intro {
    padding: 0;
  }

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

  .generator-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .password-row {
    grid-template-columns: 1fr;
  }

  .generate-row {
    align-items: stretch;
    flex-direction: column;
  }

  .primary-button,
  .copy-button {
    width: 100%;
  }
}
