:root {
  --dark-bg: #1c1f22;
  --dark-gray: #2b2e30;
  --accent-gray: #25282b;
  --teal-primary: #1a7fc8;
  --teal-accent: #3bbdc6;
  --off-white: #f5f5f5;
  --muted-gray: rgba(245, 245, 245, 0.78);
  --border: rgba(245, 245, 245, 0.12);
  --panel-shadow: 0 20px 48px rgba(0, 0, 0, 0.35);
}

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Nunito', sans-serif;
  color: var(--off-white);
  background:
    radial-gradient(circle at 22% 10%, rgba(26, 127, 200, 0.18), transparent 45%),
    radial-gradient(circle at 86% 0%, rgba(59, 189, 198, 0.14), transparent 45%),
    var(--dark-bg);
  padding: 0;
}

.page-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 10% 20%, rgba(59, 189, 198, 0.08), transparent 50%);
}

.wrapper {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: 1rem 1rem 2.25rem;
  position: relative;
  z-index: 1;
}

.breadcrumb {
  margin-bottom: 0.85rem;
}

.breadcrumb-link {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(26, 127, 200, 0.4);
  background: rgba(26, 127, 200, 0.12);
  color: var(--off-white);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.86rem;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.breadcrumb-link:hover,
.breadcrumb-link:focus-visible {
  background: rgba(26, 127, 200, 0.2);
  border-color: rgba(26, 127, 200, 0.65);
}

.breadcrumb-link:focus-visible {
  outline: 2px solid var(--teal-accent);
  outline-offset: 2px;
}

.hero {
  margin-bottom: 1rem;
  text-align: center;
}

.hero-heading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
}

.hero-heading > div {
  text-align: center;
}

.hero-logo {
  border-radius: 999px;
  border: 1px solid rgba(59, 189, 198, 0.45);
  background: rgba(37, 40, 43, 0.86);
  box-shadow: 0 0 0 4px rgba(26, 127, 200, 0.16);
}

.eyebrow {
  margin: 0 0 0.3rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 0.72rem;
  color: rgba(245, 245, 245, 0.56);
}

.hero h1 {
  margin: 0 0 0.3rem;
  font-family: 'Exo 2', sans-serif;
  font-size: clamp(1.8rem, 4.8vw, 2.3rem);
}

.hero-copy,
.mix-note {
  margin: 0;
  color: var(--muted-gray);
}

.mix-note {
  margin-top: 0.35rem;
  color: rgba(59, 189, 198, 0.9);
  font-weight: 600;
}

.panel,
.output-panel {
  background: linear-gradient(135deg, rgba(37, 40, 43, 0.95), rgba(28, 31, 34, 0.86));
  border: 1px solid var(--border);
  border-radius: 1.2rem;
  box-shadow: var(--panel-shadow);
  padding: 1.05rem;
}

.mode-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.45rem;
}

.mode-tab {
  min-height: 50px;
  border: 1px solid var(--border);
  border-radius: 0.8rem;
  background: rgba(37, 40, 43, 0.75);
  color: var(--muted-gray);
  font-family: 'Nunito', sans-serif;
  font-size: 0.98rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.mode-tab.active {
  border-color: rgba(26, 127, 200, 0.9);
  background: rgba(26, 127, 200, 0.28);
  color: var(--off-white);
}

.mode-tab:hover {
  color: var(--off-white);
}

.mode-tab:focus-visible {
  outline: 2px solid var(--teal-accent);
  outline-offset: 2px;
}

.section-copy {
  margin: 0.75rem 0 0;
  color: var(--muted-gray);
  font-size: 0.92rem;
}

.card-section {
  margin-top: 1rem;
  border-top: 1px solid rgba(245, 245, 245, 0.08);
  padding-top: 1rem;
}

.section-label {
  margin: 0 0 0.62rem;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(245, 245, 245, 0.66);
}

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

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

.radio-card {
  position: relative;
}

.radio-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.radio-label {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 72px;
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  background: rgba(37, 40, 43, 0.7);
  padding: 0.6rem 0.72rem;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.value {
  font-size: 1.28rem;
  line-height: 1;
  font-weight: 700;
  color: var(--off-white);
}

.hint {
  margin-top: 0.25rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted-gray);
}

.radio-card input:checked + .radio-label {
  border-color: rgba(59, 189, 198, 0.95);
  background: rgba(26, 127, 200, 0.18);
  box-shadow: 0 0 0 1px rgba(59, 189, 198, 0.45), 0 10px 24px rgba(26, 127, 200, 0.2);
}

.radio-card input:focus-visible + .radio-label {
  outline: 2px solid var(--teal-accent);
  outline-offset: 2px;
}

.toggle-row {
  margin-top: 0.8rem;
  display: flex;
  gap: 0.72rem;
  align-items: flex-start;
  min-height: 52px;
  padding: 0.65rem 0.72rem;
  border-radius: 0.85rem;
  border: 1px solid var(--border);
  background: rgba(37, 40, 43, 0.62);
}

.toggle-row input {
  width: 1.1rem;
  height: 1.1rem;
  margin-top: 0.15rem;
  accent-color: var(--teal-primary);
}

.toggle-copy strong {
  display: block;
  font-size: 0.92rem;
  color: var(--off-white);
}

.toggle-copy small {
  display: block;
  margin-top: 0.1rem;
  font-size: 0.8rem;
  color: var(--muted-gray);
}

.toggle-row:focus-within {
  outline: 2px solid var(--teal-accent);
  outline-offset: 2px;
}

.language-row {
  margin-top: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.62rem;
}

.language-label {
  font-weight: 700;
  color: var(--off-white);
}

#languageSelect {
  min-height: 44px;
  border-radius: 0.72rem;
  border: 1px solid var(--border);
  background: rgba(37, 40, 43, 0.75);
  color: var(--off-white);
  padding: 0 0.72rem;
  font-family: 'Nunito', sans-serif;
}

#languageSelect:focus-visible {
  outline: 2px solid var(--teal-accent);
  outline-offset: 2px;
}

.generate-btn {
  width: 100%;
  min-height: 56px;
  margin-top: 1rem;
  border: none;
  border-radius: 999px;
  background: linear-gradient(110deg, var(--teal-accent), var(--teal-primary));
  color: var(--off-white);
  font-family: 'Nunito', sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 14px 34px rgba(26, 127, 200, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.generate-btn:hover {
  transform: translateY(-2px);
}

.generate-btn:focus-visible {
  outline: 2px solid var(--teal-accent);
  outline-offset: 2px;
}

.privacy-badge {
  margin: 0.65rem 0 0;
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(59, 189, 198, 0.4);
  background: rgba(59, 189, 198, 0.13);
  color: rgba(219, 250, 255, 0.92);
  font-size: 0.82rem;
  font-weight: 700;
}

.output-panel {
  margin-top: 1rem;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.output-panel.active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.output-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.copy-btn {
  min-height: 44px;
  min-width: 84px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(37, 40, 43, 0.8);
  color: var(--off-white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0 0.75rem;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  cursor: pointer;
}

.copy-btn .icon {
  width: 18px;
  height: 18px;
}

.copy-btn .icon-check {
  display: none;
}

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

.copy-btn.copied {
  color: #8ff2d8;
  border-color: rgba(143, 242, 216, 0.5);
}

.copy-btn.copied .icon-copy {
  display: none;
}

.copy-btn.copied .icon-check {
  display: block;
}

.copy-btn:focus-visible {
  outline: 2px solid var(--teal-accent);
  outline-offset: 2px;
}

.password-field {
  margin: 0.5rem 0;
}

.password-input {
  width: 100%;
  min-height: 52px;
  border-radius: 0.92rem;
  border: 1px solid var(--border);
  background: rgba(37, 40, 43, 0.78);
  color: var(--off-white);
  padding: 0.68rem 0.82rem;
  font-family: 'JetBrains Mono', Consolas, monospace;
  font-size: 1.03rem;
}

.password-input:focus-visible {
  outline: 2px solid var(--teal-accent);
  outline-offset: 2px;
}

.regen-note {
  margin: 0.15rem 0 0.6rem;
  color: rgba(59, 189, 198, 0.92);
  font-size: 0.82rem;
  font-weight: 700;
}

.strength-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.strength-bar {
  width: 100%;
  height: 9px;
  border-radius: 999px;
  background: rgba(245, 245, 245, 0.11);
  overflow: hidden;
}

.strength-bar-fill {
  width: 0;
  height: 100%;
  border-radius: 999px;
  transition: width 0.35s ease, background 0.2s ease;
}

.strength-bar-fill.weak {
  background: #ef5757;
}

.strength-bar-fill.good {
  background: #f2b84a;
}

.strength-bar-fill.strong {
  background: #59d6a6;
}

.strength-bar-fill.very-strong {
  background: #2fd6a0;
}

.strength-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  color: var(--muted-gray);
  font-size: 0.86rem;
  font-weight: 700;
}

.strength-tip {
  margin: 0;
  font-size: 0.83rem;
  color: rgba(245, 245, 245, 0.88);
}

.tool-note {
  margin: 1rem 0 0;
  text-align: center;
  color: var(--muted-gray);
  font-size: 0.88rem;
}

.toast {
  position: fixed;
  bottom: 1.4rem;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(28, 31, 34, 0.95);
  color: var(--off-white);
  padding: 0.56rem 1.05rem;
  font-size: 0.85rem;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 540px) {
  .option-grid-3 {
    grid-template-columns: 1fr;
  }

  .strength-meta {
    flex-direction: column;
    gap: 0.2rem;
  }

  .hero-heading {
    gap: 0.7rem;
  }

  .hero-logo {
    width: 48px;
    height: 48px;
  }
}

@media (min-width: 720px) {
  .panel,
  .output-panel {
    padding: 1.45rem;
  }

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

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

/* ── PIN mode: keypad guide ── */
.keypad-guide {
  margin-top: 1rem;
  padding: 0.85rem;
  border-radius: 0.85rem;
  border: 1px solid rgba(26, 127, 200, 0.25);
  background: rgba(26, 127, 200, 0.06);
}

.keypad-guide-title {
  margin: 0 0 0.25rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 800;
  color: rgba(245, 245, 245, 0.6);
}

.keypad-guide-desc {
  margin: 0 0 0.65rem;
  font-size: 0.82rem;
  color: var(--muted-gray);
  line-height: 1.45;
}

.keypad-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.38rem;
}

.key-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.5rem 0.25rem;
  border-radius: 0.55rem;
  border: 1px solid rgba(245, 245, 245, 0.1);
  background: rgba(37, 40, 43, 0.75);
}

.key-num {
  font-family: 'Exo 2', sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--off-white);
  line-height: 1;
}

.key-letters {
  margin-top: 0.18rem;
  font-size: 0.6rem;
  letter-spacing: 0.04em;
  font-weight: 700;
  color: rgba(59, 189, 198, 0.9);
}

.keypad-example {
  margin: 0.65rem 0 0;
  font-size: 0.82rem;
  color: var(--muted-gray);
}

.keypad-example strong {
  color: var(--off-white);
}

/* ── PIN result display ── */
.pin-result-wrapper {
  margin: 0.4rem 0 0.6rem;
}

.pin-word-grid {
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
}

.pin-letter-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 46px;
  padding: 0.55rem 0.4rem;
  border-radius: 0.7rem;
  border: 1px solid rgba(59, 189, 198, 0.3);
  background: rgba(59, 189, 198, 0.07);
  gap: 0.1rem;
}

.pin-bl-letter {
  font-family: 'JetBrains Mono', Consolas, monospace;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--off-white);
  line-height: 1;
  text-transform: uppercase;
}

.pin-bl-arrow {
  font-size: 0.6rem;
  color: rgba(245, 245, 245, 0.35);
  line-height: 1;
}

.pin-bl-digit {
  font-family: 'JetBrains Mono', Consolas, monospace;
  font-size: 1rem;
  font-weight: 700;
  color: var(--teal-accent);
  line-height: 1;
}

.pin-full-number {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.75rem;
  border-radius: 0.85rem;
  border: 1px solid rgba(59, 189, 198, 0.2);
  background: rgba(59, 189, 198, 0.05);
}

.pin-number-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 800;
  color: rgba(245, 245, 245, 0.5);
}

.pin-number-value {
  font-family: 'JetBrains Mono', Consolas, monospace;
  font-size: clamp(1.9rem, 5vw, 2.4rem);
  font-weight: 700;
  letter-spacing: 0.25em;
  color: var(--teal-accent);
  line-height: 1.1;
}

#pinLanguageSelect {
  min-height: 44px;
  border-radius: 0.72rem;
  border: 1px solid var(--border);
  background: rgba(37, 40, 43, 0.75);
  color: var(--off-white);
  padding: 0 0.72rem;
  font-family: 'Nunito', sans-serif;
}

#pinLanguageSelect:focus-visible {
  outline: 2px solid var(--teal-accent);
  outline-offset: 2px;
}

@media (max-width: 400px) {
  .keypad-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 0.28rem;
  }

  .pin-letter-block {
    min-width: 38px;
    padding: 0.45rem 0.3rem;
  }

  .pin-bl-letter {
    font-size: 1rem;
  }
}
