:root {
  color-scheme: light;
  --bg: #f6f3ec;
  --bg-highlight: #eef2ff;
  --surface: #ffffff;
  --fg: #1f2640;
  --accent: #4c6ef5;
  --accent-soft: rgba(76, 110, 245, 0.12);
  --accent-contrast: #ffffff;
  --muted: #6c728b;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  line-height: 1.5;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-highlight) 100%);
  color: var(--fg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: min(960px, 92vw);
  margin: 0 auto;
  padding: 1.5rem 0;
}

/* Fallback borders for older browsers (before color-mix rules) */
.generator { border: 1px solid rgba(76,110,245,0.10); }
.site-header, .site-footer { border-bottom: 1px solid rgba(76,110,245,0.12); }
.site-footer { border-top: 1px solid rgba(76,110,245,0.12); }

.site-header, .site-footer {
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 12%, transparent);
}

.site-footer {
  border-top: 1px solid color-mix(in srgb, var(--accent) 12%, transparent);
  margin-top: auto;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  padding: 0;
  margin: 0.75rem 0 0;
}

.footer-links a {
  color: inherit;
  text-decoration: none;
  font-weight: 600;
}

.footer-links a:hover,
.footer-links a:focus-visible {
  text-decoration: underline;
}

.site-header h1 {
  margin: 0 0 0.25rem;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
}

.tagline {
  margin: 0;
  color: var(--muted);
  max-width: 45ch;
}

main.container {
  display: grid;
  gap: 2rem;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
}

@media (max-width: 800px) {
  main.container { grid-template-columns: 1fr; }
}

.generator {
  background: var(--surface);
  border-radius: 1.25rem;
  padding: clamp(1.5rem, 3.5vw, 2.25rem);
  box-shadow: 0 18px 45px rgba(31, 38, 64, 0.12);
  border: 1px solid color-mix(in srgb, var(--accent) 10%, transparent);
}

.generator { padding-top: 0.25rem; }

.field {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

label, legend { font-weight: 600; }

input[type="number"] {
  padding: 0.65rem 0.85rem;
  border-radius: 0.75rem;
  border: 1px solid color-mix(in srgb, var(--accent) 15%, transparent);
  font-size: 1rem;
  width: 8rem;
}

input[type="number"]:focus {
  outline: 3px solid var(--accent-soft);
  border-color: var(--accent);
}

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

fieldset.options {
  border: 1px solid color-mix(in srgb, var(--accent) 10%, transparent);
  border-radius: 1rem;
  padding: 1.1rem;
  display: grid;
  gap: 0.75rem;
}

.option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 500;
}

.option input[type="checkbox"] {
  width: 1.2rem;
  height: 1.2rem;
  accent-color: var(--accent);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-bottom: 1.75rem;
}

button {
  padding: 0.75rem 1.25rem;
  border-radius: 999px;
  border: none;
  font-size: 1rem;
  font-weight: 600;
  background: var(--accent);
  color: var(--accent-contrast);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

button[disabled] {
  background: color-mix(in srgb, var(--accent) 35%, var(--surface));
  cursor: not-allowed;
  box-shadow: none;
}

@media (prefers-reduced-motion: reduce) {
  button { transition: none; }
}

button:focus-visible {
  outline: 3px solid var(--accent-soft);
  outline-offset: 3px;
}

button:not([disabled]):hover,
button:not([disabled]):focus-visible {
  box-shadow: 0 16px 28px rgba(76, 110, 245, 0.25);
}

button:not([disabled]):active { transform: scale(0.98); }

.output {
  background: #1f2640;
  color: #f8f9ff;
  border-radius: 0.75rem;
  padding: 1rem;
  min-height: 3.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  word-break: break-all;
}

.output:focus-within {
  outline: 3px solid var(--accent-soft);
  outline-offset: 4px;
}

output#password {
  font-family: "JetBrains Mono", "Fira Code", monospace;
  font-size: 1.1rem;
  letter-spacing: 0.05em;
}

.status {
  min-height: 1.25rem;
  margin-top: 0.85rem;
  color: var(--muted);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.tips-panel {
  display: grid;
  gap: 1.25rem;
  align-content: start;
}

.tips-panel > h2 {
  margin: 0;
  font-size: 1.05rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.tip-card {
  background: var(--surface);
  border-radius: 1rem;
  border: 1px solid color-mix(in srgb, var(--accent) 8%, transparent);
  padding: 1.35rem;
  box-shadow: 0 16px 35px rgba(31, 38, 64, 0.08);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.tip-card h3 {
  margin: 0;
  font-size: 1.15rem;
}

.tip-card p {
  margin: 0;
  color: var(--muted);
}

.tip-list {
  margin: 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 0.4rem;
  color: var(--fg);
}

.how-it-works {
  background: color-mix(in srgb, var(--surface) 85%, transparent);
  border-top: 1px solid color-mix(in srgb, var(--accent) 10%, transparent);
}

.how-it-works h2 {
  margin: 0 0 1rem;
  font-size: clamp(1.5rem, 3vw, 2rem);
}

.steps {
  display: grid;
  gap: 1rem;
  margin: 1.5rem 0;
}

@media (min-width: 720px) {
  .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.step {
  background: var(--surface);
  border-radius: 1rem;
  border: 1px solid color-mix(in srgb, var(--accent) 8%, transparent);
  padding: 1.35rem;
  box-shadow: 0 16px 35px rgba(31, 38, 64, 0.08);
  display: grid;
  gap: 0.5rem;
}

.step h3 {
  margin: 0;
  font-size: 1.1rem;
}

.step p {
  margin: 0;
  color: var(--muted);
}

.why-generator {
  display: grid;
  gap: 0.5rem;
  max-width: 70ch;
}

.why-generator h3 {
  margin: 0;
}

/* FAQ section styling */

.faq-section {
  padding-bottom: 2.5rem;
}

.faq-section h2 {
  margin: 0 0 1rem;
  font-size: clamp(1.4rem, 3vw, 1.8rem);
}

.faq-item {
  background: var(--surface);
  border-radius: 1rem;
  border: 1px solid color-mix(in srgb, var(--accent) 8%, transparent);
  padding: 1.35rem;
  box-shadow: 0 16px 35px rgba(31, 38, 64, 0.06);
  margin-bottom: 1rem;
}

.faq-item h3 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
}

.faq-item p {
  margin: 0;
  color: var(--muted);
}
