.toolisto-password-generator,
.toolisto-password-generator * {
  box-sizing: border-box;
}

.toolisto-password-generator {
  --toolisto-primary: #5b5cf0;
  --toolisto-primary-dark: #4748d4;
  --toolisto-border: #e4e7ec;
  --toolisto-text: #172033;
  --toolisto-muted: #667085;
  --toolisto-surface: #ffffff;
  width: 100%;
  max-width: 760px;
  margin: 24px auto;
  padding: clamp(20px, 4vw, 36px);
  color: var(--toolisto-text);
  background: var(--toolisto-surface);
  border: 1px solid var(--toolisto-border);
  border-radius: 20px;
  box-shadow: 0 14px 42px rgba(23, 32, 51, 0.08);
  font-family: inherit;
}

.toolisto-pg__output-wrap {
  display: flex;
  overflow: hidden;
  min-height: 64px;
  border: 2px solid #d9ddea;
  border-radius: 14px;
  background: #f8f9fc;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.toolisto-pg__output-wrap:focus-within {
  border-color: var(--toolisto-primary);
  box-shadow: 0 0 0 4px rgba(91, 92, 240, 0.12);
}

.toolisto-pg__output {
  flex: 1;
  width: 100%;
  min-width: 0;
  height: auto;
  margin: 0;
  padding: 14px 16px;
  color: var(--toolisto-text);
  background: transparent;
  border: 0;
  border-radius: 0;
  outline: none;
  box-shadow: none;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: clamp(17px, 3vw, 22px);
  font-weight: 650;
  letter-spacing: 0.02em;
}

.toolisto-pg__copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 104px;
  margin: 7px;
  padding: 10px 15px;
  color: var(--toolisto-primary);
  background: #ececff;
  border: 0;
  border-radius: 10px;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.toolisto-pg__copy:hover,
.toolisto-pg__copy:focus-visible {
  color: #ffffff;
  background: var(--toolisto-primary);
}

.toolisto-pg__copy:active {
  transform: scale(0.98);
}

.toolisto-pg__copy.is-copied {
  color: #087a55;
  background: #dcfce7;
}

.toolisto-pg__strength {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 14px 2px 30px;
}

.toolisto-pg__strength-track {
  flex: 1;
  height: 7px;
  overflow: hidden;
  background: #edf0f4;
  border-radius: 999px;
}

.toolisto-pg__strength-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  transition: width 0.25s ease, background 0.25s ease;
}

.toolisto-pg__strength-track span[data-level="1"] { width: 25%; background: #e5484d; }
.toolisto-pg__strength-track span[data-level="2"] { width: 50%; background: #f59e0b; }
.toolisto-pg__strength-track span[data-level="3"] { width: 75%; background: #3b82f6; }
.toolisto-pg__strength-track span[data-level="4"] { width: 100%; background: #12a56f; }

.toolisto-pg__strength-label {
  min-width: 118px;
  color: var(--toolisto-muted);
  font-size: 14px;
  text-align: right;
}

.toolisto-pg__strength-label strong[data-level="1"] { color: #c93439; }
.toolisto-pg__strength-label strong[data-level="2"] { color: #b26500; }
.toolisto-pg__strength-label strong[data-level="3"] { color: #2563c9; }
.toolisto-pg__strength-label strong[data-level="4"] { color: #087a55; }

.toolisto-pg__length-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 13px;
  font-size: 16px;
  font-weight: 700;
}

.toolisto-pg__length-row output {
  display: inline-grid;
  place-items: center;
  min-width: 46px;
  min-height: 36px;
  padding: 4px 10px;
  color: var(--toolisto-primary);
  background: #f0f0ff;
  border-radius: 9px;
  font-weight: 800;
}

.toolisto-pg__range {
  width: 100%;
  height: 6px;
  margin: 0 0 31px;
  padding: 0;
  accent-color: var(--toolisto-primary);
  cursor: pointer;
}

.toolisto-pg__options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.toolisto-pg__options legend {
  grid-column: 1 / -1;
  width: 100%;
  margin-bottom: 10px;
  padding: 0;
  font-size: 16px;
  font-weight: 700;
}

.toolisto-pg__option {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  margin: 0;
  padding: 12px 14px;
  background: #fafbfc;
  border: 1px solid var(--toolisto-border);
  border-radius: 11px;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.toolisto-pg__option:hover {
  background: #f7f7ff;
  border-color: #c9c9fb;
}

.toolisto-pg__option--wide {
  grid-column: 1 / -1;
}

.toolisto-pg__option input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--toolisto-primary);
}

.toolisto-pg__option span {
  color: #344054;
  font-size: 14px;
  font-weight: 600;
}

.toolisto-pg__option code {
  padding: 2px 6px;
  color: #7c8091;
  background: transparent;
  font-size: 12px;
}

.toolisto-pg__error {
  margin: 15px 0 0;
  padding: 10px 12px;
  color: #a61b20;
  background: #fff1f1;
  border-radius: 8px;
  font-size: 14px;
}

.toolisto-pg__generate {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 54px;
  margin: 24px 0 0;
  padding: 13px 20px;
  color: #ffffff;
  background: var(--toolisto-primary);
  border: 0;
  border-radius: 12px;
  box-shadow: 0 8px 18px rgba(91, 92, 240, 0.22);
  font: inherit;
  font-size: 16px;
  font-weight: 750;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.toolisto-pg__generate:hover,
.toolisto-pg__generate:focus-visible {
  color: #ffffff;
  background: var(--toolisto-primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 11px 22px rgba(91, 92, 240, 0.28);
}

.toolisto-pg__generate:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.toolisto-pg__privacy {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 8px;
  margin: 18px 0 0;
  color: var(--toolisto-muted);
  font-size: 13px;
  line-height: 1.55;
  text-align: center;
}

.toolisto-pg__privacy svg {
  flex: 0 0 auto;
  margin-top: 1px;
  color: #12a56f;
}

@media (max-width: 600px) {
  .toolisto-password-generator {
    margin: 18px auto;
    padding: 18px;
    border-radius: 15px;
  }

  .toolisto-pg__output-wrap {
    min-height: 58px;
  }

  .toolisto-pg__copy {
    min-width: 48px;
    padding: 10px;
  }

  .toolisto-pg__copy span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .toolisto-pg__strength {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
    margin-bottom: 25px;
  }

  .toolisto-pg__strength-track {
    width: 100%;
  }

  .toolisto-pg__strength-label {
    min-width: 0;
    text-align: left;
  }

  .toolisto-pg__options {
    grid-template-columns: 1fr;
  }

  .toolisto-pg__option--wide {
    grid-column: auto;
  }

  .toolisto-pg__option code {
    display: none;
  }
}

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

