/* =========================================================
   Beast Password Generator — CSS
   Dark theme + orange accent matching BeastToolsHub.com
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;600&family=Syne:wght@600;700;800&display=swap');

:root {
  --bpg-bg:           #0d0d0d;
  --bpg-surface:      #161616;
  --bpg-surface2:     #1e1e1e;
  --bpg-surface3:     #252525;
  --bpg-border:       #2a2a2a;
  --bpg-border-hover: #3a3a3a;
  --bpg-accent:       #ff4d00;
  --bpg-accent-dim:   #cc3d00;
  --bpg-accent-glow:  rgba(255,77,0,.15);
  --bpg-accent-glow2: rgba(255,77,0,.08);
  --bpg-text:         #f2f2f2;
  --bpg-muted:        #777;
  --bpg-muted2:       #555;
  --bpg-green:        #22c55e;
  --bpg-yellow:       #eab308;
  --bpg-red:          #ef4444;
  --bpg-blue:         #3b82f6;
  --bpg-radius:       12px;
  --bpg-radius-sm:    7px;
  --bpg-mono:         'IBM Plex Mono', monospace;
  --bpg-display:      'Syne', sans-serif;
  --bpg-transition:   0.2s ease;
}

/* ── Base ──────────────────────────────────────────────────── */
.bpg-wrap * { box-sizing: border-box; margin: 0; padding: 0; }
.bpg-wrap {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: var(--bpg-bg);
  color: var(--bpg-text);
  border-radius: var(--bpg-radius);
  border: 1px solid var(--bpg-border);
  overflow: hidden;
  max-width: 100%;
}

/* ── Tabs ──────────────────────────────────────────────────── */
.bpg-tabs {
  display: flex;
  background: var(--bpg-surface);
  border-bottom: 1px solid var(--bpg-border);
  overflow-x: auto;
  scrollbar-width: none;
}
.bpg-tabs::-webkit-scrollbar { display: none; }
.bpg-tab {
  flex-shrink: 0;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--bpg-muted);
  padding: 14px 18px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.03em;
  transition: color var(--bpg-transition), border-color var(--bpg-transition);
  white-space: nowrap;
}
.bpg-tab:hover  { color: var(--bpg-text); }
.bpg-tab.active { color: var(--bpg-accent); border-bottom-color: var(--bpg-accent); }

/* ── Panels ────────────────────────────────────────────────── */
.bpg-panel { display: none; padding: 28px 24px; }
.bpg-panel.active { display: block; }
.bpg-desc {
  color: var(--bpg-muted);
  font-size: 0.88rem;
  line-height: 1.6;
  margin-bottom: 22px;
  max-width: 640px;
}

/* ── Grid layouts ──────────────────────────────────────────── */
.bpg-main-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: start;
}
@media (max-width: 760px) { .bpg-main-grid { grid-template-columns: 1fr; } }

.bpg-row { display: flex; gap: 14px; flex-wrap: wrap; }
.bpg-col { flex: 1; min-width: 120px; }
.bpg-btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }

/* ── Form fields ───────────────────────────────────────────── */
.bpg-field { margin-bottom: 20px; }
.bpg-label {
  display: block;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--bpg-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 9px;
}
.bpg-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 9px;
}
.bpg-input {
  width: 100%;
  background: var(--bpg-surface2);
  border: 1px solid var(--bpg-border);
  border-radius: var(--bpg-radius-sm);
  color: var(--bpg-text);
  padding: 10px 13px;
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--bpg-transition), box-shadow var(--bpg-transition);
}
.bpg-input:focus {
  border-color: var(--bpg-accent);
  box-shadow: 0 0 0 3px var(--bpg-accent-glow);
}
select.bpg-input { cursor: pointer; }

/* ── Length display ────────────────────────────────────────── */
.bpg-length-display {
  display: flex;
  align-items: center;
  gap: 10px;
}
.bpg-len-val {
  font-family: var(--bpg-mono);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--bpg-accent);
  min-width: 40px;
  text-align: center;
}
.bpg-len-btn {
  width: 28px; height: 28px;
  background: var(--bpg-surface2);
  border: 1px solid var(--bpg-border);
  border-radius: 50%;
  color: var(--bpg-text);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--bpg-transition);
}
.bpg-len-btn:hover { border-color: var(--bpg-accent); color: var(--bpg-accent); }

/* ── Range slider ──────────────────────────────────────────── */
.bpg-range {
  -webkit-appearance: none;
  width: 100%;
  height: 5px;
  border-radius: 3px;
  background: var(--bpg-surface3);
  outline: none;
  cursor: pointer;
}
.bpg-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--bpg-accent);
  border: 3px solid var(--bpg-bg);
  cursor: pointer;
  box-shadow: 0 0 8px var(--bpg-accent-glow);
}
.bpg-range-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--bpg-muted2);
  margin-top: 5px;
}

/* ── Checkboxes ────────────────────────────────────────────── */
.bpg-checkgrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.bpg-check {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 9px 12px;
  background: var(--bpg-surface2);
  border: 1px solid var(--bpg-border);
  border-radius: var(--bpg-radius-sm);
  transition: border-color var(--bpg-transition);
  user-select: none;
}
.bpg-check:hover { border-color: var(--bpg-border-hover); }
.bpg-check input[type="checkbox"] { display: none; }
.bpg-checkmark {
  width: 18px; height: 18px;
  border: 2px solid var(--bpg-border-hover);
  border-radius: 4px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--bpg-transition);
}
.bpg-check input:checked ~ .bpg-checkmark {
  background: var(--bpg-accent);
  border-color: var(--bpg-accent);
}
.bpg-check input:checked ~ .bpg-checkmark::after {
  content: '✓';
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
}
.bpg-check-label {
  font-size: 0.83rem;
  font-weight: 500;
}
.bpg-check-label em {
  font-style: normal;
  color: var(--bpg-muted);
  font-family: var(--bpg-mono);
  font-size: 0.78rem;
  display: block;
}

/* ── Buttons ───────────────────────────────────────────────── */
.bpg-btn-primary {
  width: 100%;
  background: var(--bpg-accent);
  border: none;
  border-radius: var(--bpg-radius-sm);
  color: #fff;
  padding: 13px 20px;
  font-size: 0.97rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background var(--bpg-transition), transform .1s, box-shadow var(--bpg-transition);
  letter-spacing: 0.02em;
}
.bpg-btn-primary:hover  { background: var(--bpg-accent-dim); box-shadow: 0 4px 20px var(--bpg-accent-glow); }
.bpg-btn-primary:active { transform: scale(0.98); }
.bpg-btn-icon { font-size: 1.1rem; }

.bpg-btn-outline {
  background: transparent;
  border: 1px solid var(--bpg-border);
  border-radius: var(--bpg-radius-sm);
  color: var(--bpg-muted);
  padding: 10px 16px;
  font-size: 0.83rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--bpg-transition);
  white-space: nowrap;
}
.bpg-btn-outline:hover { border-color: var(--bpg-accent); color: var(--bpg-accent); }

/* ── Password card ─────────────────────────────────────────── */
.bpg-password-card {
  background: var(--bpg-surface);
  border: 1px solid var(--bpg-border);
  border-radius: var(--bpg-radius);
  padding: 20px;
  min-height: 100px;
}
.bpg-pw-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80px;
  color: var(--bpg-muted2);
  font-size: 0.88rem;
  text-align: center;
}

/* Single password item */
.bpg-pw-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid var(--bpg-border);
  animation: bpg-fadein .25s ease both;
}
.bpg-pw-item:last-child { border-bottom: none; }

@keyframes bpg-fadein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.bpg-pw-text {
  flex: 1;
  font-family: var(--bpg-mono);
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  color: var(--bpg-text);
  word-break: break-all;
  line-height: 1.5;
}
/* Colour-code character types */
.bpg-pw-text .bpg-char-upper  { color: #fb923c; }
.bpg-pw-text .bpg-char-lower  { color: var(--bpg-text); }
.bpg-pw-text .bpg-char-number { color: #60a5fa; }
.bpg-pw-text .bpg-char-symbol { color: #a78bfa; }

.bpg-pw-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.bpg-pw-action-btn {
  background: var(--bpg-surface2);
  border: 1px solid var(--bpg-border);
  border-radius: var(--bpg-radius-sm);
  color: var(--bpg-muted);
  padding: 6px 10px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all var(--bpg-transition);
}
.bpg-pw-action-btn:hover { border-color: var(--bpg-accent); color: var(--bpg-accent); }

/* ── Strength meter ────────────────────────────────────────── */
.bpg-strength-wrap {
  background: var(--bpg-surface);
  border: 1px solid var(--bpg-border);
  border-radius: var(--bpg-radius);
  padding: 16px 20px;
  margin-top: 14px;
}
.bpg-strength-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.bpg-strength-label { font-size: 0.78rem; font-weight: 700; color: var(--bpg-muted); text-transform: uppercase; letter-spacing: .06em; }
.bpg-strength-name  { font-size: 0.95rem; font-weight: 700; letter-spacing: .02em; }
.bpg-strength-bar-track {
  height: 6px;
  background: var(--bpg-surface3);
  border-radius: 3px;
  overflow: hidden;
}
.bpg-strength-bar {
  height: 100%;
  border-radius: 3px;
  width: 0;
  transition: width .5s cubic-bezier(.4,0,.2,1), background .5s;
}
.bpg-strength-stats {
  font-size: 0.78rem;
  color: var(--bpg-muted);
  margin-top: 10px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-family: var(--bpg-mono);
}
.bpg-strength-stats span { display: flex; align-items: center; gap: 5px; }

/* Strength levels */
.bpg-s-weak        { color: var(--bpg-red); }
.bpg-s-fair        { color: var(--bpg-yellow); }
.bpg-s-good        { color: #84cc16; }
.bpg-s-strong      { color: var(--bpg-green); }
.bpg-s-very-strong { color: #06b6d4; }

.bpg-bar-weak        { background: var(--bpg-red);    width: 20%; }
.bpg-bar-fair        { background: var(--bpg-yellow);  width: 40%; }
.bpg-bar-good        { background: #84cc16;            width: 60%; }
.bpg-bar-strong      { background: var(--bpg-green);   width: 80%; }
.bpg-bar-very-strong { background: #06b6d4;            width: 100%; }

/* ── Tips card ─────────────────────────────────────────────── */
.bpg-tips-card {
  background: var(--bpg-surface);
  border: 1px solid var(--bpg-border);
  border-radius: var(--bpg-radius);
  padding: 16px 20px;
  margin-top: 14px;
}
.bpg-tips-header {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--bpg-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 10px;
}
.bpg-tips-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.bpg-tips-list li {
  font-size: 0.82rem;
  color: var(--bpg-muted);
  padding-left: 18px;
  position: relative;
  line-height: 1.5;
}
.bpg-tips-list li::before { content: '›'; position: absolute; left: 0; color: var(--bpg-accent); font-weight: 700; }
.bpg-tips-list li.bpg-tip-warn { color: var(--bpg-yellow); }
.bpg-tips-list li.bpg-tip-ok   { color: var(--bpg-green); }

/* ── Passphrase ────────────────────────────────────────────── */
.bpg-sep-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}
.bpg-sep-btn {
  background: var(--bpg-surface2);
  border: 1px solid var(--bpg-border);
  border-radius: 20px;
  color: var(--bpg-text);
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--bpg-mono);
  transition: all var(--bpg-transition);
}
.bpg-sep-btn:hover  { border-color: var(--bpg-accent); }
.bpg-sep-btn.active { background: var(--bpg-accent); border-color: var(--bpg-accent); color: #fff; }

.bpg-pp-output {
  font-family: var(--bpg-mono);
  font-size: 1.1rem;
  letter-spacing: .04em;
  line-height: 1.6;
  word-break: break-all;
  padding: 8px 0;
}
.bpg-pp-word   { color: var(--bpg-text); }
.bpg-pp-sep    { color: var(--bpg-accent); }
.bpg-pp-number { color: #60a5fa; }
.bpg-pp-symbol { color: #a78bfa; }

.bpg-pp-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
}

/* ── Bulk ──────────────────────────────────────────────────── */
.bpg-bulk-settings { margin-bottom: 20px; }
.bpg-bulk-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.bpg-bulk-header span {
  font-size: 0.83rem;
  color: var(--bpg-muted);
  font-weight: 600;
}
.bpg-bulk-search { max-width: 260px; padding: 8px 12px; font-size: 0.85rem; }
.bpg-bulk-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 500px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--bpg-border) transparent;
}
.bpg-bulk-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bpg-surface2);
  border: 1px solid var(--bpg-border);
  border-radius: var(--bpg-radius-sm);
  padding: 10px 14px;
  animation: bpg-fadein .2s ease both;
}
.bpg-bulk-num {
  font-size: 0.72rem;
  color: var(--bpg-muted2);
  font-family: var(--bpg-mono);
  min-width: 28px;
}
.bpg-bulk-pw {
  flex: 1;
  font-family: var(--bpg-mono);
  font-size: 0.9rem;
  color: var(--bpg-text);
  word-break: break-all;
}
.bpg-bulk-copy-btn {
  background: transparent;
  border: 1px solid var(--bpg-border);
  border-radius: 4px;
  color: var(--bpg-muted);
  padding: 4px 10px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all var(--bpg-transition);
  flex-shrink: 0;
}
.bpg-bulk-copy-btn:hover { border-color: var(--bpg-accent); color: var(--bpg-accent); }
.bpg-bulk-strength-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── History ───────────────────────────────────────────────── */
.bpg-history-toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
  align-items: center;
}
.bpg-history-toolbar .bpg-input { max-width: 280px; padding: 8px 12px; font-size: 0.85rem; }
.bpg-history-list { display: flex; flex-direction: column; gap: 8px; max-height: 520px; overflow-y: auto; }
.bpg-history-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bpg-surface2);
  border: 1px solid var(--bpg-border);
  border-radius: var(--bpg-radius-sm);
  padding: 12px 16px;
  animation: bpg-fadein .2s ease both;
}
.bpg-history-pw { flex: 1; font-family: var(--bpg-mono); font-size: 0.9rem; word-break: break-all; }
.bpg-history-meta { font-size: 0.72rem; color: var(--bpg-muted2); white-space: nowrap; }
.bpg-history-tag {
  font-size: 0.68rem;
  padding: 2px 7px;
  border-radius: 10px;
  font-weight: 700;
  flex-shrink: 0;
}

.bpg-empty-state {
  text-align: center;
  padding: 50px 20px;
  color: var(--bpg-muted2);
}
.bpg-empty-icon { font-size: 2.5rem; display: block; margin-bottom: 12px; opacity: .3; }

/* ── Checker ───────────────────────────────────────────────── */
.bpg-checker-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: start;
}
@media (max-width: 640px) { .bpg-checker-grid { grid-template-columns: 1fr; } }

.bpg-pw-input-wrap {
  position: relative;
}
.bpg-pw-input-wrap .bpg-input { padding-right: 44px; font-family: var(--bpg-mono); font-size: 1rem; }
.bpg-toggle-vis {
  position: absolute;
  right: 10px; top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  opacity: .5;
  transition: opacity var(--bpg-transition);
}
.bpg-toggle-vis:hover { opacity: 1; }

.bpg-checker-bar-track {
  height: 5px;
  background: var(--bpg-surface3);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 10px;
}

.bpg-checker-result { margin-top: 18px; display: flex; flex-direction: column; gap: 14px; }

.bpg-result-badge {
  font-size: 1.5rem;
  font-weight: 800;
  font-family: var(--bpg-display);
  letter-spacing: .02em;
}
.bpg-result-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.bpg-stat-box {
  background: var(--bpg-surface2);
  border: 1px solid var(--bpg-border);
  border-radius: var(--bpg-radius-sm);
  padding: 10px 14px;
}
.bpg-stat-box .bpg-stat-label { font-size: 0.7rem; color: var(--bpg-muted); text-transform: uppercase; letter-spacing: .06em; }
.bpg-stat-box .bpg-stat-value { font-size: 1rem; font-weight: 700; font-family: var(--bpg-mono); margin-top: 3px; }

.bpg-result-issues { display: flex; flex-direction: column; gap: 6px; }
.bpg-issue {
  font-size: 0.82rem;
  padding: 8px 12px;
  border-radius: var(--bpg-radius-sm);
  display: flex;
  align-items: center;
  gap: 8px;
}
.bpg-issue-warn { background: rgba(234,179,8,.08); border: 1px solid rgba(234,179,8,.2); color: var(--bpg-yellow); }
.bpg-issue-bad  { background: rgba(239,68,68,.08);  border: 1px solid rgba(239,68,68,.2);  color: var(--bpg-red); }
.bpg-issue-ok   { background: rgba(34,197,94,.08);  border: 1px solid rgba(34,197,94,.2);  color: var(--bpg-green); }

/* Score ring */
.bpg-checker-score-col { display: flex; flex-direction: column; align-items: center; gap: 18px; padding-top: 10px; }
.bpg-score-ring-wrap { position: relative; width: 130px; }
.bpg-score-ring { width: 130px; height: 130px; transform: rotate(-90deg); }
.bpg-ring-bg   { fill: none; stroke: var(--bpg-surface3); stroke-width: 10; }
.bpg-ring-fill { fill: none; stroke: var(--bpg-accent); stroke-width: 10; stroke-linecap: round; stroke-dasharray: 327; stroke-dashoffset: 327; transition: stroke-dashoffset .8s cubic-bezier(.4,0,.2,1), stroke .5s; }
.bpg-score-label {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.8rem;
  font-weight: 800;
  font-family: var(--bpg-mono);
  color: var(--bpg-text);
}

.bpg-score-breakdown {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.bpg-score-row { display: flex; align-items: center; gap: 8px; font-size: 0.78rem; }
.bpg-score-row-label { color: var(--bpg-muted); flex: 1; }
.bpg-score-mini-bar { flex: 2; height: 4px; background: var(--bpg-surface3); border-radius: 2px; overflow: hidden; }
.bpg-score-mini-fill { height: 100%; border-radius: 2px; transition: width .5s; }
.bpg-score-row-val { color: var(--bpg-text); font-family: var(--bpg-mono); font-weight: 600; min-width: 30px; text-align: right; }

.bpg-privacy-notice {
  margin-top: 24px;
  padding: 12px 16px;
  background: var(--bpg-accent-glow2);
  border: 1px solid rgba(255,77,0,.2);
  border-radius: var(--bpg-radius-sm);
  font-size: 0.82rem;
  color: var(--bpg-muted);
  line-height: 1.5;
}
.bpg-privacy-notice strong { color: var(--bpg-accent); }

/* ── Misc ──────────────────────────────────────────────────── */
.bpg-hidden { display: none !important; }
.bpg-copied { color: var(--bpg-green) !important; }

/* Spinner */
.bpg-spinner {
  display: inline-block;
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: bpg-spin .6s linear infinite;
}
@keyframes bpg-spin { to { transform: rotate(360deg); } }
