:root {
  --bg: #0f1220;
  --panel: #171b2e;
  --panel-soft: #1e2440;
  --text: #e9ecff;
  --muted: #a7afcf;
  --accent: #6f7cff;
  --accent-2: #7b5dff;
  --danger: #ff6b7a;
  --success: #49d17d;
  --border: #2f365e;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

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

body {
  margin: 0;
  font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
  background: radial-gradient(circle at top, #1a2040 0%, var(--bg) 55%);
  color: var(--text);
  min-height: 100vh;
}

.page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.app-card {
  width: min(900px, 100%);
  padding: 28px;
}

.app-header h1 {
  margin: 0;
  font-size: 2rem;
}

.app-header p {
  margin: 10px 0 0;
  color: var(--muted);
}

.password-result {
  margin-top: 22px;
  padding: 20px;
  background: var(--panel-soft);
  border: 1px solid var(--border);
  border-radius: 18px;
}

.password-label {
  color: var(--muted);
  font-size: 0.9rem;
}

.password-output {
  margin-top: 8px;
  font-size: 1.6rem;
  line-height: 1.35;
  letter-spacing: 0;
  font-family: "Cascadia Code", "Fira Code", Consolas, monospace;
  word-break: break-all;
}

.actions-row {
  margin-top: 16px;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 10px;
}

.btn {
  border: none;
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 0.96rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.btn:focus-visible,
.range-input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  box-shadow: 0 12px 24px rgba(111, 124, 255, 0.35);
}

.btn-secondary {
  background: #2c3564;
}

.btn-ghost {
  background: #232b50;
}

.btn-chip {
  background: #27305c;
  font-size: 0.9rem;
}

.btn-chip.active {
  background: linear-gradient(120deg, #4c5fd8, #5e47cb);
  box-shadow: 0 10px 20px rgba(94, 71, 203, 0.35);
}

.copy-status {
  margin: 10px 2px 0;
  min-height: 20px;
  color: var(--success);
  font-size: 0.9rem;
}

.strength-card {
  margin-top: 6px;
  padding: 6px 4px 2px;
}

.strength-top {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.92rem;
}

.strength-track {
  margin-top: 9px;
  width: 100%;
  height: 11px;
  border-radius: 999px;
  background: #293059;
  overflow: hidden;
}

.strength-bar {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  transition: width 0.25s ease, background-color 0.25s ease;
  background: #4f588f;
}

.inner-card {
  margin-top: 18px;
  padding: 18px;
}

.inner-card h2 {
  margin: 0 0 14px;
  font-size: 1.05rem;
}

.preset-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 9px;
}

.range-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.range-value {
  font-weight: 700;
  color: #d5dcff;
}

.range-input {
  width: 100%;
  accent-color: var(--accent);
}

.settings-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 18px;
}

.check-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  color: #dfe3ff;
  font-size: 0.93rem;
}

.check-item input[type="checkbox"] {
  margin-top: 2px;
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  flex: 0 0 18px;
}

.error-box {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid transparent;
  min-height: 20px;
  color: transparent;
}

.error-box.visible {
  border-color: rgba(255, 107, 122, 0.45);
  background: rgba(255, 107, 122, 0.12);
  color: #ffd8dd;
}

.privacy-note {
  margin: 18px 2px 0;
  color: var(--muted);
  font-size: 0.86rem;
}

@media (max-width: 900px) {
  .preset-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .app-card {
    padding: 20px;
    border-radius: 18px;
  }

  .actions-row {
    grid-template-columns: 1fr;
  }

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

  .preset-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .password-output {
    font-size: 1.25rem;
  }
}
