:root {
  --ink: #071d2b;
  --muted: #496071;
  --line: #d9e3eb;
  --blue: #0877f2;
  --blue-dark: #005fcc;
  --orange: #ff7a00;
  --shadow: 0 14px 28px rgba(9, 42, 72, .12);
}

* { box-sizing: border-box; }

html {
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #fff;
}

body {
  margin: 0;
  min-width: 320px;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.site-header {
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.nav {
  max-width: 1360px;
  min-height: 78px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  text-decoration: none;
  font-size: 24px;
  font-weight: 850;
  white-space: nowrap;
}

.brand-logo {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center;
  background: #fff;
  border: 1px solid #f0d1dc;
  flex: 0 0 auto;
}

.nav-links,
.nav-actions {
  display: flex;
  align-items: center;
  gap: 26px;
  color: #172b3c;
  font-size: 15px;
}

.nav-links a,
.nav-actions a {
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}

.nav-links .active {
  color: #0968ff;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.language-control,
.footer-language {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #c8d8e4;
  border-radius: 999px;
  padding: 9px 13px;
  color: var(--ink);
  background: #fff;
  position: relative;
}

.language-control::after,
.footer-language::after {
  content: "";
  width: 18px;
  height: 18px;
  background: currentColor;
  mask: url("../images/arrow-down.svg") center / contain no-repeat;
  -webkit-mask: url("../images/arrow-down.svg") center / contain no-repeat;
  pointer-events: none;
}

.language-flag {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .08);
  flex: 0 0 auto;
}

.language-control select,
.footer-language select {
  appearance: none;
  border: 0;
  min-width: 94px;
  background: transparent;
  color: inherit;
  font-weight: 650;
  padding: 0;
  outline: none;
}

.main {
  padding: 56px 24px 46px;
  min-height: calc(100vh - 139px);
}

.hero {
  max-width: 1120px;
  margin: 0 auto;
}

.headline {
  text-align: center;
  margin-bottom: 42px;
}

h1 {
  margin: 0;
  font-size: clamp(34px, 4vw, 52px);
  line-height: 1.08;
  font-weight: 850;
  letter-spacing: 0;
}

.headline p {
  margin: 18px 0 0;
  font-size: 17px;
  color: #182f40;
}

.generator {
  display: grid;
  grid-template-columns: minmax(280px, 400px) minmax(430px, 1fr);
  gap: clamp(28px, 5vw, 62px);
  align-items: center;
}

.scene-wrap {
  min-height: 260px;
  display: grid;
  place-items: center;
}

.scene {
  width: min(100%, 390px);
  aspect-ratio: 1.25;
  transition: opacity .18s ease, transform .22s ease;
}

.scene.is-changing {
  opacity: .2;
  transform: translateX(-8px);
}

.panel {
  display: grid;
  gap: 34px;
  align-content: center;
}

.password-row {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 98px;
  gap: 18px;
  align-items: center;
}

.password-shell {
  min-height: 56px;
  border: 1px solid #c5d5e1;
  border-radius: 28px;
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 0 14px 0 24px;
  box-shadow: inset 0 2px 5px rgba(8, 43, 71, .06);
  overflow: hidden;
  background: #fff;
  position: relative;
}

@keyframes ripple {
  from { translate: -120% 0; }
  to { translate: 120% 0; }
}

.password-text {
  min-width: 0;
  font-size: 18px;
  color: #101010;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.password-text span {
  display: inline-block;
  opacity: 0;
  transform: translateY(8px);
  animation: charWave .36s cubic-bezier(.2, .7, .1, 1) forwards;
}

@keyframes charWave {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.strength {
  border-radius: 8px;
  padding: 6px 11px;
  min-width: 68px;
  font-size: 13px;
  font-weight: 850;
  text-align: center;
  color: #081b28;
  white-space: nowrap;
}

.strength.very-weak { background: #e52e13; color: #fff; }
.strength.weak { background: #ffa561; }
.strength.good { background: #ffdcbc; }
.strength.strong { background: #ccf89b; }
.strength.very-strong { background: #85e52c; }

.reload {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  display: grid;
  place-items: center;
  transition: background .18s ease, transform .18s ease;
}

.reload svg,
.round svg {
  width: 22px;
  height: 22px;
}

.reload:hover {
  background: #eef6ff;
  transform: rotate(24deg);
}

.copy {
  min-height: 56px;
  border: 0;
  border-radius: 28px;
  background: var(--blue);
  color: #fff;
  font-size: 18px;
  font-weight: 850;
  box-shadow: var(--shadow);
  transition: background .18s ease, transform .18s ease;
}

.copy:hover {
  background: var(--blue-dark);
  transform: translateY(-1px);
}

.control-row,
.characters {
  display: grid;
  grid-template-columns: 210px 1fr;
  align-items: center;
  gap: 24px;
}

.label {
  font-size: 18px;
  color: #142d3f;
}

.label strong {
  font-weight: 850;
  color: var(--ink);
}

.length-control {
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  align-items: center;
  gap: 12px;
}

.round {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1.5px solid var(--ink);
  background: #fff;
  color: var(--ink);
  display: grid;
  place-items: center;
}

.round:disabled {
  border-color: #bfc9d2;
  color: #aeb9c1;
  cursor: not-allowed;
}

.slider-wrap {
  position: relative;
  display: grid;
  align-items: center;
}

input[type="range"] {
  appearance: none;
  width: 100%;
  height: 12px;
  background: transparent;
  position: relative;
  z-index: 2;
  margin: 0;
}

.range-track {
  position: absolute;
  left: 0;
  right: 0;
  height: 12px;
  border: 1px solid #bfd2e1;
  border-radius: 999px;
  overflow: hidden;
  background: #f7fbff;
}

.range-track span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--blue);
  transition: width .18s ease;
}

input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid #0968ff;
  background: #fff;
  box-shadow: 0 4px 12px rgba(8, 84, 170, .13);
  cursor: grab;
  background-size: 18px 18px;
  background-position: center;
  background-repeat: no-repeat;
}

input[type="range"]::-moz-range-thumb {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid #0968ff;
  background: #fff;
  cursor: grab;
}

.checks {
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 18px;
  font-weight: 850;
  color: var(--ink);
  cursor: pointer;
  user-select: none;
}

.check input {
  appearance: none;
  width: 25px;
  height: 25px;
  border-radius: 7px;
  border: 1.5px solid #c7d8e5;
  box-shadow: inset 0 2px 6px rgba(5, 38, 64, .13);
  display: grid;
  place-items: center;
  margin: 0;
  cursor: pointer;
}

.check input::before {
  content: "";
  width: 13px;
  height: 7px;
  border-left: 2.3px solid var(--blue);
  border-bottom: 2.3px solid var(--blue);
  rotate: -45deg;
  translate: 0 -2px;
  opacity: 0;
  transition: opacity .12s ease;
}

.check input:checked {
  border-color: var(--blue);
  background: #f6fbff;
}

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

.site-footer {
  background: #061e2b;
  color: #d7e4ec;
  padding: 64px 24px 42px;
  margin-top: 22px;
}

.footer-inner {
  max-width: 1360px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(240px, 1.35fr) repeat(4, minmax(150px, 1fr));
  gap: clamp(34px, 5vw, 78px);
  align-items: start;
}

.footer-brand {
  display: grid;
  gap: 30px;
}

.footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
  font-size: 24px;
  font-weight: 850;
}

.footer-logo img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
}

.footer-language {
  width: fit-content;
  border-color: #365b70;
  background: transparent;
  color: #fff;
  min-width: 250px;
  justify-content: flex-start;
  padding: 13px 16px;
}

.footer-language select {
  min-width: 174px;
}

.socials {
  display: flex;
  align-items: center;
  gap: 28px;
  color: #c6d8e4;
  font-size: 26px;
  font-weight: 850;
}

.footer-column {
  display: grid;
  gap: 15px;
}

.footer-column h2 {
  margin: 0 0 18px;
  color: #fff;
  font-size: 18px;
  line-height: 1.2;
}

.footer-column a {
  color: #b9cad5;
  text-decoration: none;
  font-size: 16px;
}

.footer-column a:hover {
  color: #fff;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 160px;
  translate: -50% 18px;
  opacity: 0;
  background: #0E9A49;
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  box-shadow: var(--shadow);
  pointer-events: none;
  transition: opacity .2s ease, translate .2s ease;
}

.toast.show {
  opacity: 1;
  translate: -50% 0;
}

@media (max-width: 980px) {
  .nav {
    grid-template-columns: 1fr auto;
    min-height: auto;
    padding: 18px 20px;
  }

  .nav-links {
    display: none;
  }

  .nav-actions a {
    display: none;
  }

  .generator {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .panel {
    width: min(100%, 720px);
  }

  .footer-inner {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 620px) {
  .main {
    padding: 42px 16px 38px;
  }

  .headline {
    margin-bottom: 32px;
  }

  .headline p {
    font-size: 16px;
    line-height: 1.45;
  }

  .scene-wrap {
    min-height: 220px;
  }

  .scene {
    width: min(100%, 320px);
  }

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

  .password-shell {
    padding-left: 18px;
  }

  .copy {
    min-height: 52px;
  }

  .nav {
    gap: 14px;
    padding: 14px 16px;
  }

  .brand {
    font-size: 20px;
  }

  .brand-logo {
    width: 38px;
    height: 38px;
  }

  .language-control {
    padding: 8px 10px;
  }

  .language-control select {
    min-width: 78px;
    font-size: 14px;
  }

  .site-footer {
    padding: 42px 18px 34px;
  }

  .footer-inner {
    grid-template-columns: 1fr;
  }

  .footer-language {
    min-width: 100%;
  }
}
