*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

:root {
  --bg: #0f1117;
  --surface: #1a1d27;
  --surface2: #21253a;
  --border: #2a2d3e;
  --accent: #6c63ff;
  --accent-light: #8b85ff;
  --green: #34d399;
  --orange: #fb923c;
  --text: #e8eaf0;
  --muted: #8b90a8;
  --radius: 12px;
  --mono: 'Fira Code', 'Cascadia Code', Consolas, monospace;
}

[data-theme="light"] {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface2: #eef0f8;
  --border: #dde1ef;
  --accent: #5b52e8;
  --accent-light: #7b74f5;
  --green: #059669;
  --orange: #d97706;
  --text: #1a1d2e;
  --muted: #6b7280;
}

body {
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background .2s, color .2s;
}

/* Nav */
nav {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
nav a { color: var(--muted); text-decoration: none; font-size: .85rem; transition: color .15s; }
nav a:hover { color: var(--text); }
.nav-sep { color: var(--border); }
.page-title { color: var(--text); font-weight: 600; font-size: .9rem; }
.theme-toggle {
  margin-left: auto;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
  padding: 5px 12px;
  font-size: .82rem;
  transition: all .15s;
}
.theme-toggle:hover { color: var(--text); border-color: var(--accent); }

/* Wrapper */
.wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

.container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  width: 100%;
  max-width: 480px;
}

h1 {
  color: var(--text);
  text-align: center;
  margin-bottom: 28px;
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -.3px;
}

.password-box {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

#password {
  flex: 1;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--mono);
  font-size: .95rem;
  outline: none;
}

button {
  padding: 10px 18px;
  border: none;
  border-radius: 8px;
  background: var(--surface2);
  color: var(--muted);
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .18s;
  border: 1px solid var(--border);
}
button:hover { color: var(--text); border-color: var(--accent); }

.length-control { margin-bottom: 20px; }

label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: .85rem;
}

input[type="range"] {
  width: 100%;
  height: 5px;
  background: var(--border);
  border-radius: 3px;
  outline: none;
  -webkit-appearance: none;
  border: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer;
  transition: transform .18s;
}
input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.15); }

.button-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.button-group button { flex: 1; min-width: 160px; }

#generateBasic { background: var(--green); color: #fff; border-color: transparent; }
#generateBasic:hover { opacity: .88; border-color: transparent; }

#generateSpecial { background: var(--orange); color: #fff; border-color: transparent; }
#generateSpecial:hover { opacity: .88; border-color: transparent; }

#copyBtn { background: var(--surface2); }

@media (max-width: 480px) {
  .container { padding: 20px 16px; }
  .button-group button { min-width: 100%; }
}

