/* ===== Reset & Base ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #0f0f13;
  --bg2: #18181f;
  --bg3: #1e1e28;
  --border: #2d2d3a;
  --text: #e2e2f0;
  --text-muted: #8888aa;
  --text-dim: #5555777;
  --accent: #6c63ff;
  --accent-hover: #7c72ff;
  --red: #ef4444;
  --orange: #f97316;
  --yellow: #eab308;
  --green: #22c55e;
  --emerald: #10b981;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SF Mono", "Fira Code", "Cascadia Code", Consolas, monospace;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background-color: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

/* ===== Header ===== */
.header {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f0f1a 100%);
  border-bottom: 1px solid var(--border);
  padding: 1.5rem 1rem;
}

.header-inner {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.header-text h1 {
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, #a78bfa, #6c63ff, #818cf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.25rem;
}

.header-text p {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.lang-btn {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.8125rem;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}

.lang-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
}

/* ===== Main ===== */
.main {
  max-width: 760px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

/* ===== Tabs ===== */
.tabs {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}

.tab-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 0.6rem 1.2rem;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
}

.tab-btn:hover {
  color: var(--text);
}

.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* ===== Card ===== */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow);
}

.section-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 1.25rem;
}

/* ===== Input ===== */
.input-group {
  margin-bottom: 1.5rem;
}

.input-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.input-wrapper {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.password-input {
  flex: 1;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 1rem;
  padding: 0.625rem 0.875rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
}

.password-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.2);
}

.password-input::placeholder {
  color: var(--text-muted);
  font-family: var(--font);
}

.visibility-btn {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.625rem 0.875rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.8125rem;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
  min-width: 64px;
}

.visibility-btn:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

/* ===== Strength Bar ===== */
.strength-section {
  margin-bottom: 1.25rem;
}

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

.meta-label {
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

.strength-label {
  font-size: 0.9375rem;
  font-weight: 600;
}

.score-text-0 { color: var(--red); }
.score-text-1 { color: var(--orange); }
.score-text-2 { color: var(--yellow); }
.score-text-3 { color: var(--green); }
.score-text-4 { color: var(--emerald); }

.strength-track {
  background: var(--bg3);
  border-radius: 4px;
  height: 8px;
  overflow: hidden;
}

.strength-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s ease;
}

/* ===== Metrics ===== */
.metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.metric-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.875rem 1rem;
}

.metric-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.metric-value {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

/* ===== Feedback ===== */
.feedback-section {
  border-top: 1px solid var(--border);
  padding-top: 1.25rem;
}

.feedback-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

.feedback-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.feedback-list li {
  font-size: 0.875rem;
  padding: 0.375rem 0.625rem;
  border-radius: 5px;
  display: flex;
  align-items: flex-start;
  gap: 0.375rem;
}

.feedback-error {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.1);
}

.feedback-warning {
  color: #fde68a;
  background: rgba(234, 179, 8, 0.1);
}

.feedback-suggestion {
  color: #a5b4fc;
  background: rgba(108, 99, 255, 0.1);
}

.feedback-good {
  color: #86efac;
  background: rgba(34, 197, 94, 0.1);
}

/* ===== Security Note ===== */
.security-note {
  text-align: center;
  font-size: 0.78125rem;
  color: var(--text-muted);
  opacity: 0.7;
  padding: 0 0.5rem;
  line-height: 1.5;
}

/* ===== Generator ===== */
.form-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.875rem;
}

.form-label {
  font-size: 0.8125rem;
  color: var(--text-muted);
  min-width: 80px;
  flex-shrink: 0;
}

.slider-row {
  align-items: center;
}

.slider {
  flex: 1;
  appearance: none;
  -webkit-appearance: none;
  height: 4px;
  background: var(--bg3);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 0 2px rgba(108, 99, 255, 0.3);
  transition: box-shadow 0.15s;
}

.slider::-webkit-slider-thumb:hover {
  box-shadow: 0 0 0 4px rgba(108, 99, 255, 0.25);
}

.slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer;
  border: none;
}

.slider-val {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--text);
  min-width: 28px;
  text-align: right;
}

.checkboxes {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.check-label {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--text);
}

.check-label input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}

.toggle-label {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--text);
  font-weight: 500;
}

.toggle-label input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--accent);
  cursor: pointer;
}

.passphrase-opts {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.875rem 1rem;
  margin-bottom: 1rem;
}

.num-input {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.875rem;
  padding: 0.375rem 0.625rem;
  width: 72px;
  outline: none;
}

.num-input:focus {
  border-color: var(--accent);
}

.select-input {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.875rem;
  padding: 0.375rem 0.5rem;
  outline: none;
  cursor: pointer;
}

.select-input:focus {
  border-color: var(--accent);
}

/* ===== Generator Output ===== */
.output-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.75rem;
  position: relative;
}

.gen-output {
  flex: 1;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.9375rem;
  padding: 0.625rem 0.875rem;
  outline: none;
  min-width: 0;
}

.icon-btn {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.625rem 0.875rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.8125rem;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.icon-btn:hover {
  color: var(--text);
  border-color: var(--accent);
  background: rgba(108, 99, 255, 0.1);
}

.copy-msg {
  position: absolute;
  right: 0;
  top: -1.5rem;
  font-size: 0.75rem;
  color: var(--emerald);
  transition: opacity 0.3s;
  pointer-events: none;
  white-space: nowrap;
}

/* ===== Buttons ===== */
.primary-btn {
  background: var(--accent);
  border: none;
  border-radius: var(--radius);
  color: #fff;
  cursor: pointer;
  font-size: 0.9375rem;
  font-weight: 600;
  padding: 0.625rem 1.5rem;
  transition: background 0.15s, transform 0.1s;
  width: 100%;
  margin-top: 0.25rem;
}

.primary-btn:hover {
  background: var(--accent-hover);
}

.primary-btn:active {
  transform: scale(0.98);
}

/* ===== Bulk Output ===== */
.bulk-output {
  margin-top: 0.75rem;
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  padding: 0.75rem;
  outline: none;
  resize: vertical;
  line-height: 1.7;
}

/* ===== Footer ===== */
.footer {
  text-align: center;
  padding: 1.5rem 1rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.8125rem;
}

.footer a {
  color: var(--accent);
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}

/* ===== Responsive ===== */
@media (max-width: 480px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .metrics {
    grid-template-columns: 1fr;
  }

  .header-text h1 {
    font-size: 1.25rem;
  }

  .output-row {
    flex-wrap: wrap;
  }

  .gen-output {
    width: 100%;
  }
}
