*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --bg: #0b0f14;
  --bg-card: #141a22;
  --border: rgba(255, 255, 255, 0.08);
  --text: #eef2f7;
  --text-muted: rgba(238, 242, 247, 0.55);
  --accent: #3dd6c6;
  --accent-hover: #2fc4b4;
  --danger: #ff6b6b;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: Inter, system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 60% 45% at 80% 0%, rgba(61, 214, 198, 0.1), transparent 55%),
    radial-gradient(ellipse 50% 40% at 10% 100%, rgba(94, 179, 255, 0.07), transparent 50%);
}

.page {
  position: relative;
  max-width: 520px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}

.topbar {
  margin-bottom: 1.5rem;
}

.back-link {
  display: inline-block;
  margin-bottom: 1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  text-decoration: none;
}

.back-link:hover {
  color: var(--accent);
}

.topbar h1 {
  margin: 0 0 0.5rem;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.subtitle {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.card {
  padding: 1.5rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  box-shadow: var(--shadow);
}

.output-row {
  display: grid;
  gap: 0.75rem;
}

.password-display {
  display: block;
  width: 100%;
  min-height: 3.25rem;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 1rem;
  font-weight: 500;
  word-break: break-all;
  color: var(--text);
}

.password-display.masked {
  -webkit-text-security: disc;
  text-security: disc;
}

.output-actions {
  display: flex;
  gap: 0.5rem;
}

.btn {
  padding: 0.65rem 1.1rem;
  border-radius: 10px;
  border: 1px solid transparent;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}

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

.btn-primary {
  flex: 1;
  background: var(--accent);
  color: #061210;
}

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

.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text-muted);
}

.btn-ghost:hover {
  border-color: rgba(255, 255, 255, 0.18);
  color: var(--text);
}

.btn-accent {
  background: rgba(61, 214, 198, 0.12);
  border-color: rgba(61, 214, 198, 0.3);
  color: var(--accent);
}

.btn-accent:hover {
  background: rgba(61, 214, 198, 0.2);
}

.btn-block {
  width: 100%;
  margin-top: 1.25rem;
}

.strength {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1rem 0 1.25rem;
}

.strength-bar {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.strength-fill {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: var(--danger);
  transition: width 0.25s, background 0.25s;
}

.strength-label {
  min-width: 4.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-align: right;
}

.field {
  margin-bottom: 1rem;
}

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

.field-head label {
  font-size: 0.9rem;
  font-weight: 500;
}

.field-value {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.85rem;
  color: var(--accent);
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.options {
  margin: 0;
  padding: 0;
  border: none;
}

.options legend {
  margin-bottom: 0.65rem;
  font-size: 0.9rem;
  font-weight: 500;
}

.check {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0;
  cursor: pointer;
  font-size: 0.92rem;
}

.check input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--accent);
}

.check code {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.hint {
  min-height: 1.25rem;
  margin: 0.75rem 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
}

.hint.success {
  color: var(--accent);
}

.hint.error {
  color: var(--danger);
}