:root {
  color-scheme: light;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  color: #202124;
  background: #ffffff;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at top, #f7f7f7 0, #ffffff 42rem);
}

button,
input {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.page {
  width: 100%;
  min-height: 100vh;
  padding: 72px clamp(32px, 6vw, 96px) 88px;
}

.site-header,
.generator,
.privacy-note,
.security-guide {
  width: min(100%, 960px);
  margin-right: auto;
  margin-left: auto;
}

.site-header {
  position: relative;
  margin-bottom: 38px;
}

.generator {
  padding: clamp(24px, 5vw, 48px);
  border: 1px solid #dedede;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.07);
}

.share-button {
  position: absolute;
  top: 0;
  right: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 13px;
  border: 1px solid #d2d2d2;
  border-radius: 11px;
  color: #343434;
  background: #ffffff;
  font-size: 0.88rem;
  font-weight: 650;
  cursor: pointer;
  transition:
    background-color 160ms ease,
    border-color 160ms ease;
}

.share-button svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.share-button:hover {
  border-color: #a7a7a7;
  background: #f4f4f4;
}

.share-button:active {
  background: #eaeaea;
}

.eyebrow {
  margin: 0 0 16px;
  padding-right: 130px;
  color: #686868;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(3.4rem, 6vw, 5rem);
  line-height: 1;
  letter-spacing: -0.055em;
}

@media (min-width: 561px) {
  h1 {
    white-space: nowrap;
  }
}

.subtitle {
  max-width: 850px;
  margin: 24px 0 0;
  color: #626262;
  font-size: 1.08rem;
  line-height: 1.65;
}

.result {
  display: flex;
  gap: 10px;
}

.result__input {
  min-width: 0;
  flex: 1;
  height: 56px;
  padding: 0 16px;
  border: 1px solid #cfcfcf;
  border-radius: 12px;
  color: #202124;
  background: #f7f7f7;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1rem;
}

.copy-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 56px;
  padding: 0 18px;
  border: 1px solid #cfcfcf;
  border-radius: 12px;
  color: #292929;
  background: #ffffff;
  font-weight: 650;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease;
}

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

.copy-button:hover {
  border-color: #9c9c9c;
  background: #f4f4f4;
}

.status {
  min-height: 22px;
  margin: 7px 2px 5px;
  color: #555555;
  font-size: 0.85rem;
}

.length-control {
  margin: 24px 0 28px;
}

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

.control-heading output {
  display: grid;
  place-items: center;
  min-width: 44px;
  height: 36px;
  padding: 0 8px;
  border-radius: 9px;
  color: #ffffff;
  background: #292929;
  font-variant-numeric: tabular-nums;
}

input[type="range"] {
  width: 100%;
  height: 24px;
  margin: 0;
  accent-color: #333333;
  cursor: pointer;
}

.range-limits {
  display: flex;
  justify-content: space-between;
  color: #777777;
  font-size: 0.78rem;
}

fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

legend {
  margin-bottom: 12px;
  padding: 0;
  font-weight: 650;
}

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

.option {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 34px;
  cursor: pointer;
  user-select: none;
}

.option span {
  line-height: 1.25;
}

.option input {
  display: grid;
  flex: 0 0 30px;
  place-content: center;
  width: 30px;
  height: 30px;
  margin: 0;
  appearance: none;
  border: 3px solid #1f1f1f;
  border-radius: 8px;
  background: #ffffff;
  cursor: pointer;
}

.option input::before {
  width: 14px;
  height: 8px;
  border-bottom: 3px solid #ffffff;
  border-left: 3px solid #ffffff;
  content: "";
  opacity: 0;
  transform: translateY(-2px) rotate(-45deg);
}

.option input:checked {
  background: #1f1f1f;
}

.option input:checked::before {
  opacity: 1;
}

.error {
  min-height: 18px;
  margin: 5px 2px 0;
  color: #8c2525;
  font-size: 0.85rem;
}

.strength {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 9px 16px;
  margin: 21px 0 24px;
  color: #656565;
  font-size: 0.9rem;
}

#strength-label {
  font-weight: 650;
  transition: color 180ms ease;
}

.strength__track {
  grid-column: 1 / -1;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5e5e5;
}

.strength__track span {
  display: block;
  width: 75%;
  height: 100%;
  border-radius: inherit;
  transition: width 180ms ease, background-color 180ms ease;
}

.strength[data-strength="low"] #strength-label {
  color: #b42318;
}

.strength[data-strength="low"] .strength__track span {
  background: #d04437;
}

.strength[data-strength="medium"] #strength-label {
  color: #946200;
}

.strength[data-strength="medium"] .strength__track span {
  background: #d99a00;
}

.strength[data-strength="high"] #strength-label {
  color: #287a46;
}

.strength[data-strength="high"] .strength__track span {
  background: #32945a;
}

.generate-button {
  width: 100%;
  min-height: 58px;
  padding: 14px 20px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: #ffffff;
  font-weight: 700;
  cursor: pointer;
  transition:
    color 160ms ease,
    transform 120ms ease,
    background-color 160ms ease,
    border-color 160ms ease;
}

#generator-form[data-strength="low"] .generate-button {
  border-color: #b42318;
  background: #d04437;
}

#generator-form[data-strength="low"] .generate-button:hover {
  background: #b9362b;
}

#generator-form[data-strength="low"] .generate-button:active {
  background: #9f2e25;
}

#generator-form[data-strength="medium"] .generate-button {
  border-color: #946200;
  color: #29200d;
  background: #d99a00;
}

#generator-form[data-strength="medium"] .generate-button:hover {
  background: #c48a00;
}

#generator-form[data-strength="medium"] .generate-button:active {
  background: #ae7a00;
}

#generator-form[data-strength="high"] .generate-button {
  border-color: #287a46;
  background: #32945a;
}

#generator-form[data-strength="high"] .generate-button:hover {
  background: #287a46;
}

#generator-form[data-strength="high"] .generate-button:active {
  background: #22683c;
}

.generate-button:active {
  transform: translateY(1px);
}

:focus-visible {
  outline: 3px solid #8a8a8a;
  outline-offset: 3px;
}

.privacy-note {
  margin-top: 16px;
  color: #777777;
  font-size: 0.8rem;
  text-align: center;
}

.security-guide {
  display: grid;
  gap: 24px;
  margin-top: 64px;
}

.guide-section,
.warning-note {
  border: 1px solid #dedede;
  border-radius: 24px;
  background: #ffffff;
}

.guide-section {
  padding: clamp(28px, 5vw, 48px);
}

.guide-section__eyebrow {
  margin: 0 0 10px;
  color: #287a46;
  font-size: 0.75rem;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.guide-section h2,
.warning-note h2 {
  margin: 0;
  font-size: clamp(1.55rem, 4vw, 2.25rem);
  line-height: 1.15;
  letter-spacing: -0.035em;
}

.guide-section__lead {
  max-width: 760px;
  margin: 18px 0 0;
  color: #585858;
  font-size: 1.05rem;
  line-height: 1.7;
}

.security-points {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 32px;
}

.security-point {
  padding: 22px;
  border-radius: 16px;
  background: #f5f5f5;
}

.security-point__number {
  color: #929292;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  font-weight: 700;
}

.security-point h3,
.manager-card h3 {
  margin: 14px 0 8px;
  font-size: 1rem;
  line-height: 1.35;
}

.security-point p,
.manager-card p,
.storage-section__content > p:last-child,
.warning-note p {
  margin: 0;
  color: #606060;
  line-height: 1.6;
}

.guide-section__heading {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
  gap: 40px;
  align-items: end;
}

.guide-section__heading > p {
  margin: 0;
  color: #676767;
  line-height: 1.6;
}

.recommendations {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 28px;
  margin: 30px 0 0;
  padding: 0;
  list-style: none;
}

.recommendations li {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  align-items: start;
  padding: 14px 0;
  border-top: 1px solid #e5e5e5;
}

.recommendations li > span {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  color: #ffffff;
  background: #32945a;
  font-size: 0.8rem;
  font-weight: 800;
}

.recommendations p {
  margin: 1px 0 0;
  color: #5e5e5e;
  line-height: 1.5;
}

.recommendations strong {
  color: #292929;
}

.storage-section {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: clamp(28px, 6vw, 64px);
  align-items: center;
}

.storage-section__content > p:last-child {
  margin-top: 18px;
  font-size: 1.02rem;
}

.manager-card {
  padding: 24px;
  border: 1px solid #d8d8d8;
  border-radius: 16px;
  background: #f5f5f5;
}

.manager-card h3 {
  margin-top: 0;
}

.manager-card ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 18px;
  padding: 0;
  list-style: none;
}

.manager-card li {
  padding: 7px 10px;
  border: 1px solid #d5d5d5;
  border-radius: 999px;
  background: #ffffff;
  font-size: 0.86rem;
  font-weight: 650;
}

.manager-card p {
  font-size: 0.88rem;
}

.warning-note {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 18px;
  align-items: start;
  padding: 28px 32px;
  background: #f7f7f7;
}

.warning-note__mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  color: #ffffff;
  background: #353535;
  font-size: 1.3rem;
  font-weight: 800;
}

.warning-note h2 {
  font-size: 1.2rem;
}

.warning-note p {
  margin-top: 8px;
}

.toast {
  position: fixed;
  z-index: 1000;
  top: 50%;
  left: 50%;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100vw - 32px);
  min-height: 48px;
  padding: 12px 17px;
  border-radius: 12px;
  color: #ffffff;
  background: #292929;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.2);
  font-size: 0.94rem;
  font-weight: 650;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, calc(-50% + 10px));
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.toast[hidden] {
  display: none;
}

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

.toast__icon {
  display: grid;
  flex: 0 0 24px;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: #1f4f30;
  background: #8fdda9;
}

.toast[data-type="error"] .toast__icon {
  color: #64251f;
  background: #f0a59e;
}

.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;
}

@media (max-width: 560px) {
  .page {
    padding: 24px 12px 36px;
  }

  .site-header {
    margin-bottom: 24px;
    padding: 0 6px;
  }

  .generator {
    padding: 24px 18px;
    border-radius: 18px;
    box-shadow: none;
  }

  h1 {
    font-size: clamp(2.2rem, 12vw, 3rem);
    white-space: normal;
  }

  .subtitle {
    margin-top: 16px;
    font-size: 0.98rem;
  }

  .eyebrow {
    margin-bottom: 28px;
    padding-right: 50px;
  }

  .share-button {
    top: 0;
    right: 6px;
    width: 42px;
    min-height: 42px;
    padding: 0;
  }

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

  .result {
    display: grid;
  }

  .copy-button {
    width: 100%;
    min-height: 50px;
  }

  .options {
    gap: 12px;
    font-size: 0.92rem;
  }

  .security-guide {
    gap: 16px;
    margin-top: 42px;
  }

  .guide-section,
  .warning-note {
    border-radius: 18px;
  }

  .guide-section {
    padding: 26px 20px;
  }

  .security-points,
  .guide-section__heading,
  .recommendations,
  .storage-section {
    grid-template-columns: 1fr;
  }

  .security-points {
    gap: 10px;
    margin-top: 24px;
  }

  .security-point {
    padding: 18px;
  }

  .guide-section__heading {
    gap: 14px;
  }

  .recommendations {
    gap: 0;
    margin-top: 22px;
  }

  .storage-section {
    gap: 24px;
  }

  .manager-card {
    padding: 20px;
  }

  .warning-note {
    grid-template-columns: 38px 1fr;
    gap: 14px;
    padding: 22px 20px;
  }

  .warning-note__mark {
    width: 36px;
    height: 36px;
    border-radius: 10px;
  }
}

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