:root {
  --bg: #0a0a0f;
  --surface: #12121a;
  --surface2: #1a1a26;
  --border: #2a2a3d;
  --accent: #00ff88;
  --accent2: #7b61ff;
  --accent3: #ff6b6b;
  --text: #e8e8f0;
  --muted: #6b6b8a;
  --mono: 'Space Mono', monospace;
  --sans: 'DM Sans', sans-serif;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 20px 80px;
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(0,255,136,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,255,136,0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: '';
  position: fixed;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(123,97,255,0.08) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

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

/* ── Header ── */
header {
  margin-bottom: 32px;
  animation: fadeDown 0.6s ease both;
  text-align: center;
}

.logo {
  justify-content: center;
  margin-bottom: 10px;
}

.logo-text {
  font-family: var(--mono);
  font-size: clamp(32px, 8vw, 48px);
  font-weight: 700;
  letter-spacing: -1px;
  line-height: 1.1;
}

.logo-text span {
  color: var(--accent);
  text-shadow: 0 0 24px rgba(0,255,136,0.4);
}

.tagline {
  font-size: clamp(15px, 3.5vw, 18px);
  color: var(--text);
  font-family: var(--sans);
  font-weight: 500;
  letter-spacing: -0.2px;
  margin-bottom: 16px;
}

.header-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.header-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-family: var(--mono);
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 5px 12px;
}

/* ── Tab Nav ── */
.tab-nav {
  display: flex;
  gap: 2px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 20px;
  animation: fadeUp 0.6s 0.05s ease both;
}

.tab-btn {
  flex: 1;
  padding: 10px 16px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

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

.tab-btn.active {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
}

.tab-indicator {
  width: 6px; height: 6px;
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.2s;
  flex-shrink: 0;
}

.tab-btn.active .tab-indicator { opacity: 1; }
.tab-btn:nth-child(1) .tab-indicator { background: var(--accent); }
.tab-btn:nth-child(2) .tab-indicator { background: var(--accent2); }

/* ── Pages ── */
.page { display: none; }
.page.active { display: block; }

/* ── Output card ── */
.output-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
  animation: fadeUp 0.6s 0.1s ease both;
}

.output-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
}

.card-label {
  font-size: 11px;
  font-family: var(--mono);
  color: var(--muted);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.strength-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s infinite;
}

.password-display {
  font-family: var(--mono);
  font-size: clamp(16px, 3vw, 22px);
  color: var(--text);
  word-break: break-all;
  line-height: 1.6;
  min-height: 56px;
  letter-spacing: 1px;
  transition: opacity 0.15s;
}

.password-display.flash { opacity: 0; }

.char-uppercase { color: #7b61ff; }
.char-lowercase { color: #e8e8f0; }
.char-number    { color: #00ff88; }
.char-symbol    { color: #ff6b6b; }

/* ── Strength meter ── */
.strength-meter {
  margin-top: 20px;
  display: flex;
  gap: 4px;
  align-items: center;
}

.strength-bar {
  flex: 1;
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.strength-bar-fill {
  height: 100%;
  border-radius: 2px;
  width: 0%;
  transition: width 0.4s cubic-bezier(0.34,1.56,0.64,1), background 0.4s;
}

.strength-text {
  font-size: 11px;
  font-family: var(--mono);
  color: var(--muted);
  min-width: 60px;
  text-align: right;
}

/* ── Buttons ── */
.actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.btn {
  flex: 1;
  padding: 12px 16px;
  border: none;
  border-radius: 10px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary { background: var(--accent); color: #0a0a0f; font-weight: 600; }
.btn-primary:hover {
  background: #00cc6a;
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(0,255,136,0.3);
}
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--border); transform: translateY(-1px); }
.btn-secondary.copied {
  background: rgba(0,255,136,0.1);
  border-color: var(--accent);
  color: var(--accent);
}

/* ── Settings card ── */
.settings-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px 28px;
  margin-bottom: 20px;
  animation: fadeUp 0.6s 0.2s ease both;
}

.section-title {
  font-size: 11px;
  font-family: var(--mono);
  color: var(--muted);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.slider-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.slider-label { font-size: 14px; color: var(--text); min-width: 60px; }

.slider-value {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 700;
  color: var(--accent);
  min-width: 40px;
  text-align: center;
}

input[type=range] {
  flex: 1;
  appearance: none;
  background: var(--border);
  height: 4px;
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

input[type=range]::-webkit-slider-thumb {
  appearance: none;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 0 12px rgba(0,255,136,0.5);
  transition: transform 0.2s, box-shadow 0.2s;
}

input[type=range]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 0 20px rgba(0,255,136,0.7);
}

.toggles-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.toggle-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
}

.toggle-item:hover { border-color: var(--muted); }
.toggle-item.active        { border-color: var(--accent);  background: rgba(0,255,136,0.05); }
.toggle-item.active-purple { border-color: var(--accent2); background: rgba(123,97,255,0.08); }
.toggle-item.active-red    { border-color: var(--accent3); background: rgba(255,107,107,0.08); }

.toggle-info { display: flex; align-items: center; gap: 8px; }
.toggle-icon { font-size: 16px; width: 24px; text-align: center; }
.toggle-label    { font-size: 13px; color: var(--text); }
.toggle-sublabel { font-size: 10px; color: var(--muted); font-family: var(--mono); margin-top: 1px; }

.toggle-switch {
  width: 36px; height: 20px;
  background: var(--border);
  border-radius: 10px;
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}

.toggle-switch::after {
  content: '';
  position: absolute;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--muted);
  top: 3px; left: 3px;
  transition: all 0.2s;
}

.toggle-item.active        .toggle-switch { background: rgba(0,255,136,0.3); }
.toggle-item.active        .toggle-switch::after { left: 19px; background: var(--accent); }
.toggle-item.active-purple .toggle-switch { background: rgba(123,97,255,0.3); }
.toggle-item.active-purple .toggle-switch::after { left: 19px; background: var(--accent2); }
.toggle-item.active-red    .toggle-switch { background: rgba(255,107,107,0.3); }
.toggle-item.active-red    .toggle-switch::after { left: 19px; background: var(--accent3); }

/* ── History card ── */
.history-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px 28px;
  animation: fadeUp 0.6s 0.3s ease both;
}

.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.history-clear {
  font-size: 11px;
  color: var(--muted);
  font-family: var(--mono);
  cursor: pointer;
  transition: color 0.2s;
}
.history-clear:hover { color: var(--accent3); }

.history-list { display: flex; flex-direction: column; gap: 8px; }

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  gap: 12px;
  animation: slideIn 0.3s ease both;
  transition: border-color 0.2s;
}

.history-item:hover { border-color: var(--muted); }

.history-pw {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: 0.5px;
}

.history-meta { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.history-len {
  font-size: 10px;
  font-family: var(--mono);
  color: var(--muted);
  background: var(--border);
  padding: 2px 6px;
  border-radius: 4px;
}

.history-copy {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  padding: 4px;
  border-radius: 4px;
  transition: color 0.2s;
  display: flex; align-items: center;
}
.history-copy:hover { color: var(--accent); }

.empty-history {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  font-family: var(--mono);
  padding: 20px 0;
  border: 1px dashed var(--border);
  border-radius: 8px;
}

/* ════════════════════════════
   강도 체크 페이지
════════════════════════════ */
.checker-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
  animation: fadeUp 0.5s ease both;
}

.checker-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent2), var(--accent3));
}

.pw-input-wrap {
  position: relative;
  margin-bottom: 24px;
}

.pw-input {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 88px 16px 16px;
  font-family: var(--mono);
  font-size: 18px;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  letter-spacing: 2px;
}

.pw-input:focus {
  border-color: var(--accent2);
  box-shadow: 0 0 0 3px rgba(123,97,255,0.15);
}

.pw-input::placeholder {
  color: var(--muted);
  letter-spacing: 0;
  font-size: 14px;
}

.pw-toggle-vis {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 18px;
  padding: 4px;
  transition: color 0.2s;
}
.pw-toggle-vis:hover { color: var(--text); }

.pw-clear {
  position: absolute;
  right: 48px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  padding: 4px;
  line-height: 1;
  transition: color 0.2s;
  display: none;
}
.pw-clear:hover { color: var(--accent3); }

/* Big strength display */
.big-strength {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
}

.big-score-ring {
  position: relative;
  width: 80px; height: 80px;
  flex-shrink: 0;
}

.big-score-ring svg { transform: rotate(-90deg); }

.ring-bg { fill: none; stroke: var(--border); stroke-width: 6; }

.ring-fill {
  fill: none;
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 220;
  stroke-dashoffset: 220;
  transition: stroke-dashoffset 0.6s cubic-bezier(0.34,1.56,0.64,1), stroke 0.4s;
}

.score-num {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  transition: color 0.4s;
}

.big-strength-info { flex: 1; }

.big-strength-label {
  font-size: 24px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
  transition: color 0.3s;
}

.big-strength-sub {
  font-size: 13px;
  color: var(--muted);
  font-family: var(--mono);
}

/* Checklist */
.checklist { display: flex; flex-direction: column; gap: 10px; }

.check-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: all 0.3s;
}

.check-item.pass { border-color: rgba(0,255,136,0.3);   background: rgba(0,255,136,0.04); }
.check-item.fail { border-color: rgba(255,107,107,0.3); background: rgba(255,107,107,0.04); }

.check-icon {
  width: 24px; height: 24px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  transition: all 0.3s;
  background: var(--border);
  color: var(--muted);
}

.check-item.pass .check-icon { background: rgba(0,255,136,0.2);   color: var(--accent); }
.check-item.fail .check-icon { background: rgba(255,107,107,0.2); color: var(--accent3); }

.check-text { flex: 1; }
.check-title { font-size: 14px; color: var(--text); margin-bottom: 2px; }
.check-desc  { font-size: 11px; color: var(--muted); font-family: var(--mono); }

.check-badge {
  font-size: 10px;
  font-family: var(--mono);
  padding: 3px 8px;
  border-radius: 100px;
  font-weight: 700;
  flex-shrink: 0;
}

.check-item.pass .check-badge { background: rgba(0,255,136,0.15);   color: var(--accent); }
.check-item.fail .check-badge { background: rgba(255,107,107,0.15); color: var(--accent3); }

/* Entropy card */
.entropy-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px 28px;
  margin-bottom: 20px;
  animation: fadeUp 0.5s 0.1s ease both;
}

.entropy-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 16px;
}

.entropy-stat {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  text-align: center;
}

.entropy-val {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 700;
  color: var(--accent2);
  margin-bottom: 4px;
  transition: color 0.3s;
}

.entropy-key { font-size: 11px; color: var(--muted); font-family: var(--mono); }

/* Tips card */
.tips-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px 28px;
  animation: fadeUp 0.5s 0.2s ease both;
}

.tip-list { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }

.tip-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.tip-item .tip-icon { flex-shrink: 0; font-size: 15px; margin-top: 1px; }
.tip-item.highlight { color: var(--text); }

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--surface2);
  border: 1px solid var(--accent);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 13px;
  padding: 12px 24px;
  border-radius: 100px;
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
  z-index: 100;
  white-space: nowrap;
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* ── Animations ── */
@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideIn {
  from { opacity: 0; transform: translateX(-10px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.3; }
}

/* ── Site desc (unused) ── */
.site-desc { display: none; }

/* ── AdFit ── */
.adfit-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 28px 0 8px;
  min-height: 76px;
}

.adfit-label {
  font-size: 10px;
  font-family: var(--mono);
  color: var(--muted);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 8px;
  align-self: center;
}

/* ── Guide & FAQ sections ── */
.content-section {
  margin-bottom: 20px;
  animation: fadeUp 0.6s 0.1s ease both;
}

.section-heading {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
  padding-left: 4px;
}

.guide-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.guide-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  transition: border-color 0.2s;
}

.guide-card:hover { border-color: var(--muted); }

.guide-card-icon {
  font-size: 22px;
  margin-bottom: 10px;
}

.guide-card h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
  line-height: 1.4;
}

.guide-card p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.65;
}

.guide-card strong { color: var(--text); font-weight: 500; }

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.faq-q {
  width: 100%;
  background: none;
  border: none;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  text-align: left;
  gap: 12px;
}

.faq-q-text {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  font-family: var(--sans);
}

.faq-arrow {
  font-size: 11px;
  color: var(--muted);
  font-family: var(--mono);
  flex-shrink: 0;
  transition: transform 0.25s;
}

.faq-item.open .faq-arrow { transform: rotate(180deg); }

.faq-a {
  display: none;
  padding: 0 20px 16px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.7;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

.faq-item.open .faq-a { display: block; }

.faq-a strong { color: var(--text); font-weight: 500; }

@media (max-width: 500px) {
  .guide-grid { grid-template-columns: 1fr; }
}

/* ── Footer ── */
.site-footer {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
}

.footer-contact {
  display: flex;
  justify-content: center;
}

.footer-contact a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-family: var(--mono);
  color: var(--muted);
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 6px 14px;
  transition: all 0.2s;
}

.footer-contact a:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(0,255,136,0.05);
}

.footer-copy {
  font-size: 12px;
  color: var(--muted);
  font-family: var(--mono);
}

.footer-links {
  display: flex;
  gap: 20px;
  justify-self: end;
}

.footer-links a {
  font-size: 12px;
  color: var(--muted);
  font-family: var(--mono);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-links a:hover { color: var(--accent); }

@media (max-width: 500px) {
  .toggles-grid { grid-template-columns: 1fr; }
  .slider-row   { flex-wrap: wrap; }
  .entropy-grid { grid-template-columns: 1fr 1fr; }
  .big-strength { flex-direction: column; text-align: center; }
  .tab-btn      { font-size: 13px; padding: 9px 10px; }
  .site-footer  { grid-template-columns: 1fr; justify-items: center; }
  .footer-links { justify-content: center; }
}
