:root {
  color-scheme: light;
  font-family: Inter, "Segoe UI", "Microsoft YaHei", sans-serif;
  color: #17231f;
  background: #edf2ee;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(90deg, rgba(16, 60, 42, 0.035) 1px, transparent 1px),
    linear-gradient(rgba(16, 60, 42, 0.035) 1px, transparent 1px),
    #edf2ee;
  background-size: 28px 28px;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 32px 20px;
}

.generator {
  width: min(100%, 720px);
  overflow: hidden;
  border: 1px solid #c8d4cd;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 50px rgba(23, 48, 38, 0.12);
}

.page-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 26px 30px 22px;
  border-bottom: 1px solid #dbe3de;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 8px;
  color: #ffffff;
  background: #175c3f;
  font-size: 30px;
  line-height: 1;
}

.eyebrow {
  margin: 0 0 3px;
  color: #587066;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
}

h1 {
  margin: 0;
  font-size: clamp(24px, 5vw, 32px);
  line-height: 1.2;
  letter-spacing: 0;
}

.password-display {
  padding: 24px 30px;
  color: #eef7f1;
  background: #10231c;
}

.password-display > label {
  display: block;
  margin-bottom: 9px;
  color: #a8beb4;
  font-size: 13px;
  font-weight: 700;
}

.password-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 10px;
}

.password {
  display: flex;
  align-items: center;
  min-height: 54px;
  overflow-x: auto;
  padding: 10px 14px;
  border: 1px solid #365248;
  border-radius: 6px;
  color: #ffffff;
  background: #172e25;
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: clamp(17px, 4vw, 22px);
  white-space: nowrap;
  scrollbar-width: thin;
}

.icon-button {
  min-width: 72px;
  padding: 0 14px;
  border: 1px solid #67b38f;
  border-radius: 6px;
  color: #eafff3;
  background: #1c6b4a;
  font-weight: 700;
}

.icon-button:hover,
.icon-button:focus-visible {
  background: #247b58;
}

.strength-row {
  display: grid;
  grid-template-columns: minmax(90px, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  margin-top: 13px;
  color: #b9ccc3;
  font-size: 12px;
}

.strength-track {
  height: 6px;
  overflow: hidden;
  border-radius: 3px;
  background: #33483f;
}

.strength-track span {
  display: block;
  width: 75%;
  height: 100%;
  border-radius: inherit;
  background: #56c78a;
  transition: width 180ms ease, background 180ms ease;
}

.controls {
  display: grid;
  gap: 24px;
  padding: 28px 30px 22px;
}

.control-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.control-heading label,
legend {
  color: #263b32;
  font-size: 14px;
  font-weight: 800;
}

#length-number {
  width: 70px;
  height: 38px;
  border: 1px solid #b9c9c0;
  border-radius: 6px;
  color: #174f38;
  background: #f7faf8;
  text-align: center;
  font-weight: 800;
}

#length-range {
  width: 100%;
  accent-color: #19754f;
}

.range-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 5px;
  color: #71857b;
  font-size: 11px;
}

fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

legend {
  margin-bottom: 13px;
}

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

.option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid #d0dbd4;
  border-radius: 6px;
  background: #f9fbfa;
}

.option:has(input:checked) {
  border-color: #6fa68e;
  background: #f0f8f3;
}

.option input,
.preference input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: #19754f;
}

.option span {
  min-width: 0;
  font-size: 13px;
  font-weight: 700;
}

.option code {
  color: #587066;
  font-size: 11px;
}

.symbol-options {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px 14px;
  margin-top: 12px;
  padding: 14px;
  border: 1px solid #d0dbd4;
  border-radius: 6px;
  background: #f7faf8;
}

.symbol-options[hidden] {
  display: none;
}

.symbol-options label {
  color: #263b32;
  font-size: 13px;
  font-weight: 800;
}

.symbol-options input {
  width: 100%;
  min-width: 0;
  height: 40px;
  padding: 0 11px;
  border: 1px solid #b9c9c0;
  border-radius: 6px;
  color: #174f38;
  background: #ffffff;
  font-family: "Cascadia Code", Consolas, monospace;
}

.symbol-options small {
  grid-column: 2;
  color: #6f8178;
  font-size: 11px;
}

.preference-list {
  border-top: 1px solid #dce4df;
}

.preference {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 2px;
  border-bottom: 1px solid #dce4df;
}

.preference span {
  display: grid;
  gap: 3px;
}

.preference strong {
  font-size: 13px;
}

.preference small {
  color: #6f8178;
  font-size: 11px;
}

.form-error {
  margin: -8px 0 0;
  padding: 10px 12px;
  border-left: 3px solid #b13b3b;
  color: #7e2424;
  background: #fff3f2;
  font-size: 13px;
}

.generate-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 50px;
  border: 0;
  border-radius: 6px;
  color: #ffffff;
  background: #176c49;
  font-weight: 800;
  box-shadow: 0 6px 15px rgba(23, 108, 73, 0.2);
}

.generate-button:hover,
.generate-button:focus-visible {
  background: #12583c;
}

.generate-button span {
  font-size: 20px;
}

.privacy-note {
  margin: 0;
  padding: 0 30px 24px;
  color: #73847c;
  font-size: 11px;
  text-align: center;
}

button:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(41, 142, 98, 0.3);
  outline-offset: 2px;
}

@media (max-width: 560px) {
  .app-shell {
    padding: 0;
  }

  .generator {
    min-height: 100vh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .page-header,
  .password-display,
  .controls {
    padding-right: 20px;
    padding-left: 20px;
  }

  .option-grid {
    grid-template-columns: 1fr;
  }

  .symbol-options {
    grid-template-columns: 1fr;
  }

  .symbol-options small {
    grid-column: 1;
  }

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

  .strength-track {
    grid-column: 1 / -1;
  }

  .privacy-note {
    padding-right: 20px;
    padding-left: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
