:root {
  --bg: #020202;
  --surface-1: #0a0a0a;
  --surface-2: #111111;
  --surface-3: #161616;
  --border: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.12);
  --text: #f0f0f0;
  --text-2: #888;
  --text-3: #444;
  --accent: #f7df1e;
  --accent-2: #f7df1e;
  --accent-glow: rgba(184, 255, 79, 0.15);
  --accent-glow-strong: rgba(184, 255, 79, 0.25);
  --red: #ff5252;
  --yellow: #ffd54f;
  --green: #f7df1e;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  /* Text size scale */
  --fs-xs:  0.65rem;
  --fs-sm:  0.82rem;
  --fs-md:  0.92rem;
  --fs-lg:  1.05rem;
  --fs-2xl: 2.5rem;
}

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-x: hidden;
}

/* ── Background ── */

.bg-effects {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.12;
}

.bg-orb-1 {
  background: var(--accent);
  top: -20%;
  left: 50%;
  transform: translateX(-50%);
  animation: drift1 12s ease-in-out infinite alternate;
}

.bg-orb-2 {
  background: #4fffb8;
  bottom: -10%;
  right: -10%;
  opacity: 0.05;
  animation: drift2 15s ease-in-out infinite alternate;
}

.bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  background-size: 40px 40px;
}

@keyframes drift1 {
  from { transform: translateX(-50%) translateY(0) scale(1); }
  to   { transform: translateX(-50%) translateY(30px) scale(1.08); }
}

@keyframes drift2 {
  from { transform: translate(0, 0); }
  to   { transform: translate(-20px, -30px); }
}

/* ── Layout ── */

.wrapper {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 480px;
}

/* ── Card ── */

.card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 1.6rem;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04),
    0 1px 0 rgba(255, 255, 255, 0.06),
    0 32px 64px rgba(0, 0, 0, 0.7),
    0 8px 24px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  animation: cardIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 15%;
  right: 15%;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(184, 255, 79, 0.4) 40%,
    rgba(184, 255, 79, 0.4) 60%,
    transparent
  );
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(32px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Header ── */

.header {
  margin-bottom: 1.5rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(184, 255, 79, 0.08);
  border: 1px solid rgba(184, 255, 79, 0.18);
  border-radius: 999px;
  padding: 0.22rem 0.8rem;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin-bottom: 0.75rem;
}

.badge-dot {
  width: 5px;
  height: 5px;
  background: var(--accent);
  border-radius: 50%;
  animation: blink 2s ease-in-out infinite;
  box-shadow: 0 0 6px var(--accent);
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.35; }
}

h1 {
  font-size: var(--fs-2xl);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: 0.3rem;
}

h1 em {
  font-style: normal;
  color: var(--accent);
}

.subtitle {
  font-size: var(--fs-sm);
  color: var(--text-2);
  font-weight: 400;
}

/* ── Output ── */

.output-wrap {
  margin-bottom: 0.75rem;
}

.output {
  background: #050505;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0.9rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  position: relative;
  overflow: hidden;
  transition: border-color 0.25s, box-shadow 0.25s;
}

.output:hover {
  border-color: rgba(184, 255, 79, 0.12);
  box-shadow: 0 0 0 1px rgba(184, 255, 79, 0.05) inset;
}

.output-inner {
  flex: 1;
  min-width: 0;
}

.output-label {
  font-size: var(--fs-xs);
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

#password {
  font-size: var(--fs-lg);
  color: var(--text);
  word-break: break-all;
  line-height: 1.6;
  letter-spacing: 0.03em;
}

/* ── Copy button ── */

.copy-btn {
  background: var(--surface-3);
  border: 1px solid var(--border);
  color: var(--text-2);
  border-radius: var(--radius-sm);
  width: 38px;
  height: 38px;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s ease;
}

.copy-btn:hover {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
  transform: scale(1.08);
  box-shadow: 0 0 18px var(--accent-glow-strong);
}

.copy-btn:active {
  transform: scale(0.9);
}

.copy-btn svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ── Strength ── */

.strength-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}

.strength-bars {
  display: flex;
  gap: 3px;
}

.strength-bar {
  width: 20px;
  height: 3px;
  border-radius: 2px;
  background: var(--surface-3);
  transition: background 0.4s ease;
}

.strength-bar.fill-weak { background: var(--red); }
.strength-bar.fill-ok   { background: var(--yellow); }
.strength-bar.fill-good { background: var(--accent); }

#strength-msg {
  font-size: var(--fs-xs);
  color: var(--text-2);
  font-weight: 500;
  letter-spacing: 0.04em;
  min-height: 1em;
  flex: 1;
}

/* ── Divider ── */

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1rem 0;
}

/* ── Section labels ── */

.section-label {
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.15em;
}

/* ── Slider ── */

.slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6rem;
}

#len-num {
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--accent);
  background: rgba(184, 255, 79, 0.08);
  border: 1px solid rgba(184, 255, 79, 0.15);
  border-radius: 6px;
  padding: 0.1rem 0.5rem;
  min-width: 2.8rem;
  text-align: center;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 2px;
  background: var(--surface-3);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
  margin-bottom: 1.2rem;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid var(--bg);
  box-shadow: 0 0 0 1px var(--accent), 0 0 14px rgba(184, 255, 79, 0.4);
  transition: box-shadow 0.2s, transform 0.15s;
}

input[type="range"]::-webkit-slider-thumb:hover {
  box-shadow: 0 0 0 1px var(--accent), 0 0 22px rgba(184, 255, 79, 0.6);
  transform: scale(1.2);
}

input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid var(--bg);
  box-shadow: 0 0 12px rgba(184, 255, 79, 0.4);
}

/* ── Checkboxes ── */

.checks-header {
  margin-bottom: 0.6rem;
}

.checks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.check-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.7rem 0.9rem;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.12s, box-shadow 0.2s;
  user-select: none;
  position: relative;
  overflow: hidden;
}

.check-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(184, 255, 79, 0.04) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.25s;
}

.check-item:hover {
  border-color: var(--border-hover);
  background: var(--surface-3);
  transform: translateY(-1px);
}

.check-item:active {
  transform: scale(0.97);
}

.check-item.active {
  border-color: rgba(184, 255, 79, 0.22);
  background: rgba(184, 255, 79, 0.04);
}

.check-item.active::after {
  opacity: 1;
}

.check-item input {
  display: none;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--surface-3);
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: background 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.check-item.active .dot {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 8px rgba(184, 255, 79, 0.55);
}

.check-label {
  font-size: var(--fs-sm);
  color: var(--text-2);
  font-weight: 500;
  transition: color 0.2s;
  flex: 1;
}

.check-item.active .check-label {
  color: var(--text);
}

.icon {
  font-size: var(--fs-xs);
  color: rgba(184, 255, 79, 0.45);
  font-weight: 700;
  transition: opacity 0.2s;
  opacity: 0;
}

.check-item.active .icon {
  opacity: 1;
}

/* ── Generate button ── */

button.generate {
  width: 100%;
  background: var(--accent);
  color: #020202;
  border: none;
  border-radius: var(--radius-md);
  padding: 0.9rem;
  font-size: var(--fs-md);
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  transition: transform 0.15s, box-shadow 0.2s, background 0.2s;
  position: relative;
  overflow: hidden;
}

button.generate::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
  transition: left 0.55s ease;
}

button.generate:hover {
  background: var(--accent-2);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(184, 255, 79, 0.3), 0 2px 8px rgba(184, 255, 79, 0.2);
}

button.generate:hover::before {
  left: 160%;
}

button.generate:active {
  transform: translateY(0);
  box-shadow: none;
}

.btn-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-inner svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.2s;
}

button.generate:hover .btn-inner svg {
  transform: rotate(15deg) scale(1.1);
}

/* ── Toast ── */

#toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--surface-2);
  color: var(--accent);
  border: 1px solid rgba(184, 255, 79, 0.2);
  padding: 0.55rem 1.4rem;
  border-radius: 999px;
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(184, 255, 79, 0.08);
  z-index: 999;
  white-space: nowrap;
}

#toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Responsive ── */

@media (max-width: 360px) {
  .icon { display: none; }
  h1 { font-size: 1.5rem; }
  .strength-bar { width: 16px; }
}

@media (max-width: 480px) {
  .card { padding: 1.2rem; }
}

@media (max-height: 600px) and (orientation: landscape) {
  .badge,
  .subtitle { display: none; }
  h1 { font-size: 1.2rem; margin-bottom: 0; }
  .header { margin-bottom: 0.7rem; }
}

@media (max-height: 650px) {
  .card { padding: 1rem 1.2rem; }
  .checks { gap: 0.35rem; }
}

@media (min-width: 768px) {
  .wrapper { max-width: 500px; }
}

@media (min-width: 1200px) {
  .wrapper { max-width: 520px; }
}