/* ── Reset ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ── Root variables ── */
:root {
  --bg-page:      #f4f4f5;
  --bg-card:      #ffffff;
  --bg-output:    #f9f9fb;
  --bg-option:    #f4f4f5;
  --bg-option-on: #eeedfe;
  --border:       #e2e2e6;
  --border-on:    #7f77dd;
  --text-primary: #18181b;
  --text-muted:   #6b7280;
  --accent:       #534ab7;
  --accent-hover: #3c3489;
  --radius-md:    8px;
  --radius-lg:    14px;
  --font-mono:    'Courier New', Courier, monospace;
}

/* ── Page layout ── */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-page);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

/* ── Card ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  width: 100%;
  max-width: 460px;
}

.card h1 {
  font-size: 22px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.card .subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

/* ── Password output box ── */
.output-box {
  background: var(--bg-output);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 1.25rem;
  min-height: 58px;
}

.output-box #pwDisplay {
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
  word-break: break-all;
  flex: 1;
  letter-spacing: 1.5px;
}

/* ── Copy button ── */
.copy-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 6px 12px;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}

.copy-btn:hover {
  background: var(--bg-option);
  color: var(--text-primary);
}

/* ── Strength bar ── */
.strength-section {
  margin-bottom: 1.25rem;
}

.strength-info {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

#strengthLabel {
  font-weight: 600;
  color: var(--text-primary);
}

.strength-track {
  height: 6px;
  background: var(--bg-option);
  border-radius: 99px;
  overflow: hidden;
}

.strength-fill {
  height: 100%;
  border-radius: 99px;
  width: 0%;
  background: #888;
  transition: width 0.35s ease, background 0.35s ease;
}

/* ── Length slider ── */
.slider-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 1.25rem;
}

.slider-row label {
  font-size: 14px;
  color: var(--text-muted);
  min-width: 56px;
}

.slider-row input[type="range"] {
  flex: 1;
  accent-color: var(--accent);
  cursor: pointer;
}

.slider-val {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  min-width: 28px;
  text-align: right;
}

/* ── Option checkboxes ── */
.options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 1.5rem;
}

.opt-box {
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--bg-option);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  user-select: none;
}

.opt-box.active {
  background: var(--bg-option-on);
  border-color: var(--border-on);
}

.opt-box input[type="checkbox"] {
  display: none;
}

.opt-icon {
  font-size: 18px;
  color: var(--text-muted);
  transition: color 0.15s;
}

.opt-box.active .opt-icon {
  color: var(--accent);
}

.opt-label {
  font-size: 13px;
  color: var(--text-primary);
}

/* ── Generate button ── */
.gen-btn {
  width: 100%;
  padding: 13px;
  background: var(--accent);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.15s, transform 0.1s;
}

.gen-btn:hover  { background: var(--accent-hover); }
.gen-btn:active { transform: scale(0.98); }

/* ── Toast notification ── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(60px);
  background: #18181b;
  color: #f4f4f5;
  padding: 10px 22px;
  border-radius: var(--radius-md);
  font-size: 13px;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
  z-index: 999;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}