/* ── Design tokens (.ai/design.md) ─────────────────────────────────── */
:root {
  --primary:       #0064e0;
  --primary-deep:  #0457cb;
  --canvas:        #ffffff;
  --surface-soft:  #f1f4f7;
  --ink-deep:      #0a1317;
  --ink:           #1c1e21;
  --charcoal:      #444950;
  --steel:         #5d6c7b;
  --hairline:      #ced0d4;
  --hairline-soft: #dee3e9;
  --success:       #31a24c;
  --attention:     #f2a918;
  --critical:      #e41e3f;
  --fb-blue:       #1876f2;

  --r-sm:   4px;
  --r-md:   6px;
  --r-lg:   8px;
  --r-xl:   16px;
  --r-xxl:  24px;
  --r-xxxl: 32px;
  --r-full: 100px;
}

/* ── Reset ──────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  background: var(--canvas);
  color: var(--ink);
  min-height: 100vh;
}

/* ── Hero ───────────────────────────────────────────────────────────── */
.hero {
  background: var(--primary);
  text-align: center;
  padding: 64px 24px 100px;
  position: relative;
}

.hero h1 {
  font-size: 42px;
  font-weight: 700;
  color: var(--canvas);
  line-height: 1.18;
  margin-bottom: 14px;
}

.hero p {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.65;
  max-width: 500px;
  margin: 0 auto;
}

.hero-wave {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  line-height: 0;
  overflow: hidden;
}

.hero-wave svg { display: block; width: 100%; height: 64px; }

/* ── Page body ──────────────────────────────────────────────────────── */
.page-body { background: var(--canvas); }

.generator-wrapper {
  max-width: 720px;
  margin: -48px auto 0;
  padding: 0 24px 72px;
  position: relative;
  z-index: 10;
}

/* card-checkout-summary from design.md */
.generator-card {
  background: var(--canvas);
  border-radius: var(--r-xxxl);
  padding: 32px;
  border: 1px solid var(--hairline-soft);
  box-shadow: rgba(20, 22, 26, 0.16) 0px 6px 28px 0px;
}

/* ── Passphrase row ─────────────────────────────────────────────────── */
.passphrase-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

/* text-input from design.md */
.passphrase-field {
  position: relative;
  flex: 1;
}

.passphrase-input {
  width: 100%;
  height: 54px;
  border: 1.5px solid var(--hairline);
  border-radius: var(--r-lg);
  padding: 0 52px 0 16px;
  font-size: 16px;
  color: var(--ink-deep);
  background: var(--canvas);
  outline: none;
  letter-spacing: 0.01em;
  cursor: default;
}

.passphrase-input:focus-visible { border-color: var(--fb-blue); }

/* eye toggle — positioned inside the input */
.btn-visibility {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--steel);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-md);
  transition: color 0.15s;
}

.btn-visibility:hover { color: var(--ink); }
.btn-visibility svg   { width: 20px; height: 20px; }

/* button-icon-circular from design.md */
.btn-regenerate {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border: 1.5px solid var(--hairline);
  border-radius: var(--r-xl);
  background: var(--canvas);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--charcoal);
  transition: background 0.15s, color 0.15s;
}

.btn-regenerate:hover { background: var(--surface-soft); }
.btn-regenerate svg   { width: 20px; height: 20px; }

/* ── Strength bar ───────────────────────────────────────────────────── */
.strength-bar-track {
  height: 8px;
  background: var(--hairline-soft);
  border-radius: var(--r-full);
  overflow: hidden;
  margin-bottom: 14px;
}

.strength-bar-fill {
  height: 100%;
  border-radius: var(--r-full);
  transition: width 0.35s ease, background-color 0.35s ease;
  width: 0;
}

/* strength levels */
.strength-bar-fill.weak      { width: 25%;  background: var(--critical); }
.strength-bar-fill.fair      { width: 50%;  background: var(--attention); }
.strength-bar-fill.strong    { width: 75%;  background: #5aad3f; }
.strength-bar-fill.very-strong { width: 100%; background: var(--success); }

/* ── Strength + Copy row ────────────────────────────────────────────── */
.strength-copy-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.strength-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 15px;
  font-weight: 600;
}

.strength-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.strength-icon svg { width: 12px; height: 12px; color: #fff; stroke-width: 3; }

/* color states applied via JS */
.strength-label.weak       { color: var(--critical); }
.strength-label.fair       { color: var(--attention); }
.strength-label.strong     { color: #5aad3f; }
.strength-label.very-strong{ color: var(--success); }

.strength-icon.weak        { background: var(--critical); }
.strength-icon.fair        { background: var(--attention); }
.strength-icon.strong      { background: #5aad3f; }
.strength-icon.very-strong { background: var(--success); }

/* Copy button — attention/warning amber pill */
.btn-copy {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 20px;
  background: var(--attention);
  color: var(--canvas);
  border: none;
  border-radius: var(--r-full);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
  letter-spacing: -0.1px;
}

.btn-copy:hover  { background: #d9940f; }
.btn-copy.copied { background: var(--success); }
.btn-copy svg    { width: 16px; height: 16px; flex-shrink: 0; }

/* ── Slider ─────────────────────────────────────────────────────────── */
.slider-section { margin-bottom: 22px; }

input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 4px;
  background: var(--hairline);
  border-radius: var(--r-full);
  outline: none;
  cursor: pointer;
  margin-bottom: 8px;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary);
  border: 3px solid var(--canvas);
  box-shadow: 0 0 0 2px var(--primary);
  cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary);
  border: 3px solid var(--canvas);
  box-shadow: 0 0 0 2px var(--primary);
  cursor: pointer;
}

.slider-word-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-deep);
}

/* ── Options row ────────────────────────────────────────────────────── */
.options-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  user-select: none;
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
  flex-shrink: 0;
}

/* Separator */
.separator-group {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.separator-label {
  font-size: 15px;
  color: var(--ink);
  white-space: nowrap;
}

.separator-buttons {
  display: flex;
  gap: 5px;
}

.sep-btn {
  width: 36px;
  height: 36px;
  border: 1.5px solid var(--hairline);
  border-radius: var(--r-lg);
  background: var(--canvas);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
  font-family: inherit;
}

.sep-btn:hover:not(.active) { background: var(--surface-soft); }

.sep-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--canvas);
}


/* ── Info sections ──────────────────────────────────────────────────── */
.info-section { padding: 64px 0; }
.info-section--alt { background: var(--surface-soft); }

.info-wrapper {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px;
}

.info-heading {
  font-size: 28px;
  font-weight: 700;
  color: var(--ink-deep);
  line-height: 1.25;
  margin-bottom: 12px;
}

.info-subheading {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink-deep);
  margin: 28px 0 10px;
}

.info-lead {
  font-size: 16px;
  color: var(--steel);
  line-height: 1.65;
  margin-bottom: 36px;
}

.info-body {
  font-size: 16px;
  color: var(--charcoal);
  line-height: 1.65;
}

.info-footnote {
  font-size: 14px;
  color: var(--steel);
  line-height: 1.55;
  margin-top: 20px;
  font-style: italic;
}

/* Why rows */
.why-rows { display: flex; flex-direction: column; gap: 28px; }

.why-row {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.why-row__icon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  background: #e8f0fd;
  border-radius: var(--r-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
}

.why-row__icon svg { width: 22px; height: 22px; }

.why-row__text h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink-deep);
  margin-bottom: 6px;
  line-height: 1.3;
}

.why-row__text p {
  font-size: 15px;
  color: var(--charcoal);
  line-height: 1.6;
}

/* Best practices */
.practices-list { display: flex; flex-direction: column; gap: 22px; }

.practice-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.practice-item__icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
  color: var(--canvas);
}

.practice-item__icon svg { width: 14px; height: 14px; }

.practice-item h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink-deep);
  margin-bottom: 5px;
}

.practice-item p {
  font-size: 15px;
  color: var(--charcoal);
  line-height: 1.6;
}

/* Password manager section */
.pm-benefits {
  background: var(--surface-soft);
  border-radius: var(--r-xl);
  padding: 20px 24px;
  margin-top: 20px;
}

.pm-benefits__label {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 12px;
}

.pm-benefits ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }

.pm-benefits li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  color: var(--ink);
}

.pm-benefits li svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--success);
}

.pm-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}

.pm-card {
  border: 1px solid var(--hairline-soft);
  border-radius: var(--r-xl);
  padding: 18px 20px;
  background: var(--canvas);
}

.pm-card__name {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink-deep);
  margin-bottom: 6px;
}

.pm-card__desc {
  font-size: 14px;
  color: var(--charcoal);
  line-height: 1.55;
}

/* ── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .hero           { padding: 48px 20px 100px; }
  .hero h1        { font-size: 28px; }
  .hero p         { font-size: 14px; }

  /* Tighter wrapper so card has more horizontal room */
  .generator-wrapper { padding: 0 12px 56px; }
  .generator-card    { padding: 20px; border-radius: var(--r-xxl); }

  .options-row { gap: 14px; }

  /* Info sections */
  .info-section  { padding: 48px 0; }
  .info-heading  { font-size: 24px; }
  .pm-grid       { grid-template-columns: 1fr; }

  /* Separator: stack label above buttons, buttons fill full width */
  .separator-group {
    margin-left: 0;
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .separator-buttons { width: 100%; }
  .sep-btn { flex: 1; height: 40px; } /* 40px meets touch-target guidelines */

}
