:root {
  color-scheme: light;
  --ink: #10212b;
  --muted: #61717a;
  --paper: #f2f6fa;
  --card: #ffffff;
  --line: #dbe4e9;
  --line-strong: #c7d4db;
  --navy: #12232e;
  --blue: #2e63f5;
  --blue-deep: #204bc4;
  --blue-soft: #e9efff;
  --symbol-blue: #7da6ff;
  --mint: #79e5cf;
  --mint-soft: #e4faf5;
  --success: #187456;
  --warning: #9a6511;
  --danger: #ad4936;
  --shadow: 0 28px 80px rgba(26, 53, 67, 0.13);
  --radius-xl: 34px;
  --radius-lg: 24px;
  --radius-md: 17px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 50% -4%, rgba(46, 99, 245, 0.14), transparent 32rem),
    radial-gradient(circle at 8% 44%, rgba(121, 229, 207, 0.14), transparent 26rem),
    linear-gradient(rgba(16, 33, 43, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 33, 43, 0.025) 1px, transparent 1px),
    var(--paper);
  background-size: auto, auto, 32px 32px, 32px 32px, auto;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button,
a,
input,
label {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(46, 99, 245, 0.3);
  outline-offset: 3px;
}

.page-shell {
  width: min(100%, 1280px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 0 48px;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 94px;
}

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

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 13px;
  background: linear-gradient(145deg, var(--blue), #4f7cff);
  color: white;
  box-shadow: 0 8px 20px rgba(46, 99, 245, 0.24);
}

.brand-mark svg {
  width: 25px;
  height: 25px;
  fill: currentColor;
}

.brand-name {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.045em;
}

.brand-name span {
  color: var(--blue);
}

.hero {
  max-width: 900px;
  margin: 0 auto;
  padding: 72px 0 54px;
  text-align: center;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.hero h1 {
  margin-bottom: 25px;
  font-size: clamp(54px, 6.2vw, 86px);
  line-height: 0.98;
  letter-spacing: -0.065em;
}

.hero h1 span {
  position: relative;
  z-index: 0;
}

.hero h1 span::after {
  position: absolute;
  z-index: -1;
  right: -8px;
  bottom: 5px;
  left: -8px;
  height: 0.24em;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--mint), #a8f0e2);
  content: "";
  transform: rotate(-0.8deg);
}

.hero p {
  max-width: 650px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.65;
}

.generator-section {
  position: relative;
  max-width: 1020px;
  margin: 0 auto;
}

.generator-section::before {
  position: absolute;
  z-index: -1;
  top: 20px;
  right: -12px;
  bottom: -14px;
  left: 12px;
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, var(--blue), #5d84f7 62%, var(--mint));
  content: "";
  transform: rotate(0.65deg);
}

.generator-card {
  padding: clamp(25px, 3.4vw, 43px);
  border: 1px solid rgba(16, 33, 43, 0.11);
  border-radius: var(--radius-xl);
  background: var(--card);
  box-shadow: var(--shadow);
}

.generator-header,
.control-heading,
.generate-button,
.privacy-note {
  display: flex;
  align-items: center;
}

.generator-header {
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 25px;
}

.section-label {
  color: var(--blue);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.section-label {
  margin-bottom: 7px;
}

.generator-header h2 {
  margin-bottom: 0;
  font-size: 28px;
  letter-spacing: -0.04em;
}

.strength-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  transition: color 160ms ease, background 160ms ease;
}

.strength-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.strength-chip[data-strength="very-strong"] {
  background: var(--mint-soft);
  color: var(--success);
}

.strength-chip[data-strength="strong"] {
  background: #eef6d4;
  color: #5f7415;
}

.strength-chip[data-strength="good"] {
  background: #fff2cc;
  color: var(--warning);
}

.strength-chip[data-strength="basic"] {
  background: #ffe8e2;
  color: var(--danger);
}

.password-display {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  min-height: 126px;
  padding: 20px 20px 20px 28px;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 92% 16%, rgba(121, 229, 207, 0.16), transparent 12rem),
    var(--navy);
  color: #f8fbfc;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

#passwordOutput {
  min-width: 0;
  overflow: hidden;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: clamp(23px, 3vw, 36px);
  font-weight: 750;
  letter-spacing: 0.015em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.password-symbol {
  color: var(--symbol-blue);
}

.copy-button,
.generate-button {
  border: 0;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.copy-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 13px 17px;
  border-radius: 15px;
  background: #f5f8ff;
  color: var(--blue-deep);
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.16);
}

.copy-button svg,
.generate-icon svg,
.privacy-icon svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.copy-button svg {
  width: 18px;
  height: 18px;
}

.copy-button:hover,
.generate-button:hover {
  transform: translateY(-2px);
}

.copy-button:active,
.generate-button:active {
  transform: translateY(0);
}

.copy-button:disabled {
  background: #c8d0d4;
  color: #66747b;
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

.controls-grid {
  display: grid;
  grid-template-columns: minmax(240px, 0.72fr) minmax(0, 1.28fr);
  gap: 14px;
  margin-top: 14px;
}

.control-panel {
  min-width: 0;
  margin: 0;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fbfdfe;
}

.control-heading {
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  min-height: 42px;
  margin-bottom: 25px;
}

.control-heading h3 {
  margin-bottom: 0;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.025em;
}

#lengthValue {
  display: grid;
  min-width: 48px;
  height: 42px;
  place-items: center;
  border-radius: 13px;
  background: var(--blue-soft);
  color: var(--blue-deep);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 16px;
  font-weight: 850;
}

.range-wrap {
  margin-top: 41px;
}

input[type="range"] {
  width: 100%;
  height: 6px;
  margin: 0;
  border-radius: 999px;
  appearance: none;
  background: linear-gradient(
    90deg,
    var(--blue) var(--range-progress, 31.25%),
    #dbe3e8 var(--range-progress, 31.25%)
  );
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  width: 23px;
  height: 23px;
  border: 5px solid white;
  border-radius: 50%;
  appearance: none;
  background: var(--blue);
  box-shadow: 0 0 0 1px var(--blue), 0 5px 12px rgba(26, 53, 67, 0.19);
}

input[type="range"]::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border: 5px solid white;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 1px var(--blue), 0 5px 12px rgba(26, 53, 67, 0.19);
}

.range-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 13px;
  color: #88969d;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 11px;
  font-weight: 700;
}

.options-panel {
  border: 1px solid var(--line);
}

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

.option-card {
  position: relative;
  display: grid;
  grid-template-columns: 37px minmax(0, 1fr) 35px;
  gap: 10px;
  align-items: center;
  min-height: 66px;
  padding: 11px;
  border: 1px solid #e3e9ed;
  border-radius: 15px;
  background: white;
  cursor: pointer;
  transition: border-color 150ms ease, transform 150ms ease;
}

.option-card:hover {
  border-color: #bfcbd1;
  transform: translateY(-1px);
}

.option-icon {
  display: grid;
  width: 37px;
  height: 37px;
  place-items: center;
  border-radius: 11px;
  background: #edf3f6;
  color: #52656f;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  font-weight: 850;
}

.option-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.option-text {
  min-width: 0;
}

.option-text strong,
.option-text small {
  display: block;
}

.option-text strong {
  margin-bottom: 3px;
  font-size: 12px;
}

.option-text small {
  overflow: hidden;
  color: #87949b;
  font-size: 9.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.option-card input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.toggle {
  position: relative;
  width: 35px;
  height: 21px;
  border-radius: 999px;
  background: #d6dfe3;
  transition: background 150ms ease;
}

.toggle::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 2px 5px rgba(16, 33, 43, 0.2);
  content: "";
  transition: transform 150ms ease;
}

.option-card input:checked + .toggle {
  background: var(--blue);
}

.option-card input:checked + .toggle::after {
  transform: translateX(14px);
}

.option-card input:focus-visible + .toggle {
  outline: 3px solid rgba(46, 99, 245, 0.26);
  outline-offset: 3px;
}

.generate-button {
  justify-content: space-between;
  width: 100%;
  min-height: 62px;
  margin-top: 14px;
  padding: 9px 10px 9px 24px;
  border-radius: 18px;
  background: var(--blue);
  color: white;
  font-size: 15px;
  font-weight: 850;
  box-shadow: 0 10px 25px rgba(46, 99, 245, 0.24);
}

.generate-button:hover {
  background: var(--blue-deep);
  box-shadow: 0 13px 29px rgba(46, 99, 245, 0.29);
}

.generate-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 13px;
  background: var(--mint);
  color: var(--ink);
}

.generate-icon svg {
  width: 21px;
  height: 21px;
}

.privacy-note {
  justify-content: center;
  gap: 12px;
  max-width: 680px;
  margin: 48px auto 58px;
  color: var(--muted);
  text-align: center;
}

.privacy-note p {
  margin-bottom: 0;
  font-size: 13px;
  line-height: 1.5;
}

.privacy-note strong {
  color: var(--ink);
}

.privacy-icon {
  display: grid;
  flex: 0 0 auto;
  width: 35px;
  height: 35px;
  place-items: center;
  border-radius: 11px;
  background: var(--mint-soft);
  color: var(--success);
}

.privacy-icon svg {
  width: 20px;
  height: 20px;
}

.password-advice {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 34px;
  max-width: 1020px;
  margin: 0 auto 84px;
  padding: 42px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 20px 60px rgba(18, 37, 48, 0.07);
}

.advice-copy {
  align-self: center;
}

.advice-copy .section-label {
  margin-bottom: 12px;
}

.advice-copy h2 {
  margin-bottom: 20px;
  font-size: clamp(29px, 3.2vw, 42px);
  letter-spacing: -0.045em;
}

.advice-copy > p:not(.section-label) {
  max-width: 640px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.72;
}

.advice-copy > p:last-child {
  margin-bottom: 0;
}

.advice-stat {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 290px;
  padding: 32px;
  border-radius: 22px;
  background: var(--navy);
  color: white;
}

.advice-stat > strong {
  margin-bottom: 18px;
  color: #7ce4d2;
  font-size: clamp(58px, 7vw, 82px);
  line-height: 0.9;
  letter-spacing: -0.07em;
}

.advice-stat p {
  margin-bottom: 22px;
  color: #d5dfe4;
  font-size: 13px;
  line-height: 1.62;
}

.advice-stat a {
  align-self: flex-start;
  color: white;
  font-size: 11px;
  font-weight: 750;
  text-underline-offset: 4px;
  text-decoration-color: rgba(124, 228, 210, 0.72);
}

.advice-stat a:hover {
  color: #7ce4d2;
}

footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 80px;
  padding: 24px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.footer-brand {
  margin-bottom: 0;
  color: var(--ink);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-weight: 800;
}

.footer-meta,
.developer-credit {
  display: flex;
  align-items: center;
}

.footer-meta {
  gap: 28px;
}

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

.developer-credit {
  gap: 10px;
  color: var(--muted);
  text-decoration: none;
  transition: transform 150ms ease, color 150ms ease;
}

.developer-credit:hover {
  color: var(--ink);
  transform: translateY(-1px);
}

.developer-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 3px;
  background: #cd3040;
  color: white;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 15px;
  font-weight: 850;
  letter-spacing: -0.08em;
  box-shadow: 0 6px 16px rgba(205, 48, 64, 0.18);
}

.developer-copy > span,
.developer-copy strong {
  display: block;
}

.developer-copy > span {
  margin-bottom: 2px;
  color: #89959b;
  font-size: 9px;
  line-height: 1;
}

.developer-copy strong {
  color: var(--ink);
  font-size: 11px;
  line-height: 1.15;
}

.toast {
  position: fixed;
  z-index: 20;
  bottom: 24px;
  left: 50%;
  padding: 13px 18px;
  border-radius: 999px;
  background: var(--navy);
  color: white;
  font-size: 13px;
  font-weight: 750;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 14px);
  transition: opacity 170ms ease, transform 170ms ease;
}

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

@media (max-width: 860px) {
  .page-shell {
    padding: 0 28px;
  }

  .hero {
    padding: 58px 0 46px;
  }

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

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

  .range-wrap {
    margin-top: 28px;
  }
}

@media (max-width: 600px) {
  .page-shell {
    padding: 0 17px;
  }

  .site-header {
    min-height: 78px;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 12px;
  }

  .brand-name {
    font-size: 17px;
  }

  .hero {
    padding: 47px 0 38px;
  }

  .hero h1 {
    margin-bottom: 21px;
    font-size: clamp(43px, 13.2vw, 61px);
  }

  .hero p {
    font-size: 15px;
  }

  .generator-section::before {
    right: -6px;
    bottom: -9px;
    left: 7px;
    border-radius: 25px;
  }

  .generator-card {
    padding: 21px 16px 20px;
    border-radius: 25px;
  }

  .generator-header {
    align-items: flex-start;
    gap: 12px;
  }

  .generator-header h2 {
    font-size: 22px;
  }

  .strength-chip {
    padding: 7px 9px;
    font-size: 10px;
    white-space: nowrap;
  }

  .password-display {
    grid-template-columns: minmax(0, 1fr) 48px;
    min-height: 96px;
    padding: 15px 13px 15px 18px;
    border-radius: 19px;
  }

  #passwordOutput {
    font-size: 19px;
  }

  .copy-button {
    min-width: 48px;
    min-height: 48px;
    padding: 0;
  }

  .copy-button span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }

  .control-panel {
    padding: 20px 16px;
    border-radius: 19px;
  }

  .control-heading {
    margin-bottom: 20px;
  }

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

  .generate-button {
    padding-left: 18px;
    font-size: 14px;
  }

  .privacy-note {
    margin: 39px auto 44px;
    text-align: left;
  }

  .password-advice {
    gap: 26px;
    margin-bottom: 58px;
    padding: 27px 20px 20px;
    border-radius: 23px;
  }

  .advice-copy h2 {
    margin-bottom: 17px;
    font-size: 30px;
  }

  .advice-copy > p:not(.section-label) {
    font-size: 14px;
    line-height: 1.68;
  }

  .advice-stat {
    min-height: 0;
    padding: 25px 22px;
    border-radius: 18px;
  }

  .advice-stat > strong {
    font-size: 64px;
  }

  footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .footer-meta {
    justify-content: space-between;
    width: 100%;
    gap: 16px;
  }

  .footer-tagline {
    max-width: 150px;
    text-align: right;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
