* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Inter', system-ui, sans-serif;
  color: #e2e8f0;
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(139, 92, 246, 0.14), transparent 60%),
    radial-gradient(700px 420px at -10% 30%, rgba(34, 211, 238, 0.08), transparent 55%),
    #080b12;
}

.page {
  width: min(720px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

/* ---------- Header ---------- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  font-family: 'Sora', sans-serif;
  font-weight: 800;
  font-size: 1.2rem;
  color: white;
  background: linear-gradient(135deg, #8b5cf6, #22d3ee);
  box-shadow: 0 8px 24px rgba(139, 92, 246, 0.32);
}

.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-family: 'Sora', sans-serif; font-size: 1.15rem; letter-spacing: -0.02em; }
.brand-text small { color: #64748b; font-size: 0.72rem; font-weight: 600; }

.back-link {
  color: #94a3b8;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s ease;
}
.back-link:hover { color: #e2e8f0; }

/* ---------- Cards ---------- */
.card {
  background: linear-gradient(160deg, rgba(15, 23, 42, 0.9), rgba(8, 11, 18, 0.95));
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 24px;
  padding: 28px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.page-title {
  margin: 0;
  font-family: 'Sora', sans-serif;
  font-size: clamp(1.6rem, 5vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #f1f5f9;
  text-align: center;
}

.page-subtitle {
  margin: 12px auto 22px;
  max-width: 560px;
  text-align: center;
  color: #94a3b8;
  font-size: 0.95rem;
  line-height: 1.6;
}

.tool-card { margin-bottom: 24px; }

/* ---------- Password display ---------- */
.password-display {
  background: rgba(2, 6, 23, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 18px;
  padding: 20px;
  min-height: 84px;
  display: flex;
  align-items: center;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.password-display:focus-within {
  border-color: rgba(139, 92, 246, 0.55);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.12);
}

.password-output {
  display: block;
  width: 100%;
  font-family: 'Sora', monospace, ui-monospace, monospace;
  font-size: clamp(1.05rem, 4.5vw, 1.5rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #f8fafc;
  word-break: break-all;
  line-height: 1.5;
  user-select: all;
}

/* ---------- Strength ---------- */
.strength-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 16px;
}

.strength-bar {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.12);
  overflow: hidden;
}

.strength-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #fb7185, #fbbf24, #34d399);
  background-size: 300% 100%;
  transition: width 0.3s ease;
}

.strength-label {
  min-width: 74px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #64748b;
  text-align: right;
}
.strength-label.weak { color: #fb7185; }
.strength-label.fair { color: #fbbf24; }
.strength-label.good { color: #34d399; }
.strength-label.strong { color: #34d399; }

/* ---------- Options ---------- */
.options {
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid rgba(148, 163, 184, 0.1);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 20px;
}

.option-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.option-row--slider {
  grid-column: 1 / -1;
}

.option-label {
  min-width: 64px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #64748b;
}

#length-slider {
  flex: 1;
  accent-color: #8b5cf6;
  cursor: pointer;
}

.option-value {
  min-width: 34px;
  font-family: 'Sora', sans-serif;
  font-weight: 800;
  font-size: 1rem;
  color: #a78bfa;
  text-align: right;
}

.option-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  color: #cbd5e1;
  cursor: pointer;
  user-select: none;
}
.option-toggle input { position: absolute; opacity: 0; pointer-events: none; }

.toggle-box {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  border-radius: 6px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(2, 6, 23, 0.6);
  transition: background 0.15s ease, border-color 0.15s ease;
}
.toggle-box::after {
  content: "";
  width: 10px;
  height: 6px;
  border-left: 2px solid white;
  border-bottom: 2px solid white;
  transform: rotate(-45deg) translateY(-1px);
  opacity: 0;
  transition: opacity 0.15s ease;
}
.option-toggle input:checked + .toggle-box {
  background: linear-gradient(135deg, #8b5cf6, #22d3ee);
  border-color: transparent;
}
.option-toggle input:checked + .toggle-box::after { opacity: 1; }
.option-toggle input:focus-visible + .toggle-box {
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.35);
}

/* ---------- Buttons ---------- */
.tool-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 12px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.btn:active { transform: scale(0.97); }
.btn svg { width: 16px; height: 16px; }

.btn-primary {
  color: white;
  border: 1px solid rgba(139, 92, 246, 0.4);
  background: linear-gradient(135deg, #7c3aed, #2563eb);
}
.btn-primary:hover { box-shadow: 0 10px 26px rgba(124, 58, 237, 0.32); }

.btn-secondary {
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(148, 163, 184, 0.07);
}
.btn-secondary:hover { border-color: rgba(148, 163, 184, 0.4); background: rgba(148, 163, 184, 0.12); }

/* ---------- Tips ---------- */
.tips-card h2 {
  margin: 0 0 14px;
  font-family: 'Sora', sans-serif;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}
.tips-card { margin-bottom: 24px; }

.tips-list {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 8px;
}
.tips-list li {
  font-size: 0.88rem;
  line-height: 1.6;
  color: #94a3b8;
}
.tips-list li::marker { color: #8b5cf6; }

/* ---------- FAQ ---------- */
.market-card h2 {
  margin: 0 0 18px;
  font-family: 'Sora', sans-serif;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.faq-card h3 {
  margin: 20px 0 8px;
  font-family: 'Sora', sans-serif;
  font-size: 0.98rem;
  letter-spacing: -0.01em;
}
.faq-card h3:first-of-type { margin-top: 0; }
.faq-card p {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.6;
  color: #94a3b8;
}

/* ---------- Related tools ---------- */
.related-tools {
  width: min(720px, calc(100% - 32px));
  margin: 36px auto 0;
}
.related-tools p { margin: 0 0 10px; }
.related-tools > p a { color: #a78bfa; font-weight: 700; text-decoration: none; }
.related-tools > p a:hover { text-decoration: underline; }
.related-tools h2 {
  font-size: 0.8rem;
  color: #64748b;
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.related-tools ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.related-tools a:not(p a) {
  display: inline-block;
  padding: 8px 14px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 999px;
  color: #e2e8f0;
  text-decoration: none;
  font-size: 0.85rem;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.related-tools a:not(p a):hover { border-color: rgba(139, 92, 246, 0.5); color: #a78bfa; }

/* ---------- Footer ---------- */
.site-footer {
  text-align: center;
  padding: 28px 16px 36px;
  font-size: 0.72rem;
  color: #475569;
}

@media (max-width: 560px) {
  .page { width: calc(100% - 24px); padding-top: 18px; }
  .card { padding: 22px 18px; border-radius: 20px; }
  .options { grid-template-columns: 1fr; }
  .site-header { flex-direction: column; align-items: flex-start; gap: 10px; }
}
