@import url('https://api.fontshare.com/v2/css?f[]=clash-display@200,300,400,500,600,700&display=swap');

:root {
  --bg: #0a0a0a;
  --surface: rgba(63, 63, 63, 0.3);
  --surface-hover: rgba(63, 63, 63, 0.5);
  --text: rgb(255, 255, 255);
  --text-muted: rgb(128, 128, 128);
  --text-secondary: rgb(153, 153, 153);
  --border: rgba(255,255,255,0.06);
  --border-light: rgba(255, 255, 255, 0.08);
  --accent: rgb(225, 97, 5);
  --accent-hover: rgb(255, 117, 25);
  --accent-glow: rgba(225, 97, 5, 0.15);
  --input-bg: rgba(255,255,255,0.03);
  --input-border: rgba(255,255,255,0.08);
  --input-focus: rgba(225, 97, 5, 0.3);
}

html.light {
  --bg: #fafafa;
  --surface: rgba(0, 0, 0, 0.03);
  --surface-hover: rgba(0, 0, 0, 0.06);
  --text: #111111;
  --text-muted: #777777;
  --text-secondary: #555555;
  --border: rgba(0,0,0,0.06);
  --border-light: rgba(0, 0, 0, 0.08);
  --accent: rgb(225, 97, 5);
  --accent-hover: rgb(255, 117, 25);
  --accent-glow: rgba(225, 97, 5, 0.08);
  --input-bg: rgba(0,0,0,0.02);
  --input-border: rgba(0,0,0,0.1);
  --input-focus: rgba(225, 97, 5, 0.2);
}

/* Logo: white in dark mode, dark in light mode */
.dark .logo-img { filter: none; }
.light .logo-img { filter: invert(1) brightness(0.1); }

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Clash Display', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background-color 0.4s ease, color 0.4s ease;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html.dark body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.015) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
  z-index: 0;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* Nav */
.nav-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: background-color 0.4s ease, border-color 0.4s ease;
}

html.dark .nav-bar {
  background: rgba(10, 10, 10, 0.85);
}
html.light .nav-bar {
  background: rgba(250, 250, 250, 0.85);
}

.nav-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.25s ease;
  white-space: nowrap;
  user-select: none;
  border: 1px solid transparent;
}

.nav-tab:hover {
  color: var(--text);
  background: var(--surface);
}

.nav-tab.active {
  color: var(--accent);
  background: var(--accent-glow);
  border-color: rgba(225, 97, 5, 0.15);
}

.nav-tab .tab-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
  background: var(--surface);
  transition: all 0.25s ease;
}

.nav-tab.active .tab-num {
  background: var(--accent);
  color: #fff;
}

.nav-tab .tab-progress {
  font-size: 11px;
  opacity: 0.6;
  font-weight: 400;
}

/* Theme toggle */
.theme-toggle {
  height: 36px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid var(--border-light);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  font-family: 'Clash Display', sans-serif;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-glow);
}

/* Hero */
.hero-section {
  padding-top: 140px;
  padding-bottom: 60px;
  text-align: center;
  position: relative;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: 100px;
  border: 1px solid var(--border-light);
  background: var(--surface);
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 24px;
  transition: all 0.4s ease;
}

.hero-badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse-dot 2s ease-in-out infinite;
}

.hero-autosave-note {
  font-size: 12px;
  color: var(--text-muted);
  opacity: 0.45;
  margin-top: -14px;
  margin-bottom: 24px;
  letter-spacing: 0.01em;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

.hero-title {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 20px;
  background: linear-gradient(135deg, var(--text) 0%, var(--text-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: clamp(0.8rem, 1.5vw, 0.95rem);
  color: var(--text-muted);
  max-width: 640px;
  margin: 0 auto 32px;
  font-weight: 400;
  line-height: 1.7;
}

.hero-divider {
  width: 60px;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
  margin: 0 auto;
}

/* Section */
.form-section {
  max-width: 800px;
  margin: 0 auto;
  padding: 80px 24px 40px;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.form-section.visible {
  opacity: 1;
  transform: translateY(0);
}

.section-header {
  margin-bottom: 48px;
}

.section-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--accent-glow);
  border: 1px solid rgba(225, 97, 5, 0.2);
  color: var(--accent);
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 16px;
}

.section-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.section-desc {
  color: var(--text-muted);
  font-size: 18px;
}

/* Question */
.question-block {
  margin-bottom: 36px;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.question-block.q-visible {
  opacity: 1;
  transform: translateY(0);
}

.question-label {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 8px;
}

.question-num {
  font-size: 16px;
  color: var(--accent);
  font-weight: 600;
  flex-shrink: 0;
  min-width: 28px;
}

.question-text {
  font-size: 19px;
  font-weight: 500;
  line-height: 1.5;
}

.question-hint {
  font-size: 15px;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 12px;
  padding-left: 38px;
  line-height: 1.6;
}

textarea.form-input {
  width: 100%;
  min-height: 100px;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text);
  font-family: 'Clash Display', -apple-system, sans-serif;
  font-size: 18px;
  font-weight: 400;
  line-height: 1.6;
  resize: vertical;
  transition: all 0.3s ease;
  outline: none;
}

textarea.form-input::placeholder {
  color: var(--text-muted);
  opacity: 0.5;
}

textarea.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--input-focus);
  background: var(--surface);
}

textarea.form-input:hover:not(:focus) {
  border-color: var(--border-light);
  background: var(--surface);
}

/* Voice scales (Q20) */
.voice-scale {
  margin-bottom: 20px;
}

.scale-labels {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 15px;
  font-weight: 500;
}

.scale-label-left { color: var(--text-muted); }
.scale-label-right { color: var(--text-muted); }

.scale-track {
  position: relative;
  height: 44px;
  display: flex;
  align-items: center;
}

input[type="range"].voice-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--input-border);
  outline: none;
  transition: all 0.2s ease;
}

input[type="range"].voice-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 0 0 4px var(--accent-glow), 0 2px 8px rgba(0,0,0,0.3);
  transition: all 0.2s ease;
}

input[type="range"].voice-slider::-webkit-slider-thumb:hover {
  background: var(--accent-hover);
  transform: scale(1.15);
}

input[type="range"].voice-slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: none;
  box-shadow: 0 0 0 4px var(--accent-glow), 0 2px 8px rgba(0,0,0,0.3);
}

.scale-value {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.scale-ticks {
  display: flex;
  justify-content: space-between;
  padding: 0 9px;
  margin-top: 2px;
}

.scale-ticks span {
  font-size: 10px;
  color: var(--text-muted);
  opacity: 0.4;
}

/* PDF controls */
.pdf-section {
  max-width: 800px;
  margin: 20px auto 40px;
  padding: 0 24px;
}

.pdf-card {
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 32px;
  background: var(--surface);
  text-align: center;
  transition: all 0.4s ease;
}

.pdf-card h3 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
}

.pdf-card p {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.pdf-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0;
  border-radius: 10px;
  border: 1px solid var(--border-light);
  overflow: hidden;
  margin-bottom: 24px;
}

.pdf-toggle label {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s ease;
  color: var(--text-muted);
  user-select: none;
}

.pdf-toggle label:hover { color: var(--text); }

.pdf-toggle input { display: none; }

.pdf-toggle input:checked + label {
  background: var(--accent);
  color: #fff;
}

.btn-pdf {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 32px;
  border-radius: 12px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-family: 'Clash Display', sans-serif;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  letter-spacing: -0.01em;
}

.btn-pdf:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(225, 97, 5, 0.3);
}

.btn-pdf:active {
  transform: translateY(0);
}

.btn-pdf.generating {
  opacity: 0.7;
  pointer-events: none;
}

/* Clear Answers button */
.btn-clear {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 12px;
  border: 1px solid var(--border-light);
  background: transparent;
  color: var(--text-muted);
  font-family: 'Clash Display', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  letter-spacing: -0.01em;
}

.btn-clear:hover {
  border-color: #dc2626;
  color: #dc2626;
  background: rgba(220, 38, 38, 0.08);
}

.btn-clear:active {
  transform: translateY(0);
}

/* Floating Brief Panel */
.floating-panel {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 300px;
  z-index: 900;
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  border-radius: 16px;
  border: 1px solid rgba(225, 97, 5, 0.2);
  background: rgba(10, 10, 10, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.04),
    0 8px 32px rgba(0,0,0,0.5),
    0 0 40px rgba(225, 97, 5, 0.08);
  padding: 16px;
}

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

html.light .floating-panel {
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(225, 97, 5, 0.15);
  box-shadow:
    0 8px 32px rgba(0,0,0,0.12),
    0 0 40px rgba(225, 97, 5, 0.06);
}

.floating-panel-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
  opacity: 0.6;
}

.floating-panel .pdf-toggle {
  margin-bottom: 10px;
  width: 100%;
}

.floating-panel .pdf-toggle label {
  flex: 1;
  text-align: center;
  font-size: 13px;
  padding: 8px 12px;
}

.floating-panel .btn-pdf {
  width: 100%;
  justify-content: center;
  padding: 11px 16px;
  font-size: 14px;
}

.floating-panel .btn-clear {
  width: 100%;
  justify-content: center;
  padding: 9px 16px;
  font-size: 13px;
  margin-top: 8px;
}

/* Mobile: full-width bottom bar */
@media (max-width: 768px) {
  .floating-panel {
    bottom: 0;
    right: 0;
    left: 0;
    width: 100%;
    border-radius: 16px 16px 0 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
    border-top: 1px solid rgba(225, 97, 5, 0.2);
    padding: 12px 16px;
    display: flex;
    gap: 10px;
    align-items: center;
  }

  html.light .floating-panel {
    border-top-color: rgba(225, 97, 5, 0.15);
  }

  .floating-panel-label { display: none; }

  .floating-panel .pdf-toggle {
    margin-bottom: 0;
    flex-shrink: 0;
  }

  .floating-panel .btn-pdf {
    flex: 1;
    white-space: nowrap;
    font-size: 13px;
    padding: 10px 12px;
  }

  .floating-panel .btn-clear {
    width: auto;
    flex-shrink: 0;
    margin-top: 0;
    padding: 10px 12px;
    font-size: 13px;
  }

  /* Hide the text on mobile clear button, show only icon */
  .floating-panel .btn-clear .clear-text { display: none; }
}

/* Confirmation modal */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.modal-overlay.visible {
  display: flex;
  opacity: 1;
}

.modal-content {
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 32px;
  max-width: 420px;
  width: 90%;
  text-align: center;
  transform: scale(0.95);
  transition: transform 0.25s ease, background-color 0.4s ease, border-color 0.4s ease;
}

.modal-overlay.visible .modal-content {
  transform: scale(1);
}

.modal-content h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

.modal-content p {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 24px;
  line-height: 1.6;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.modal-actions button {
  padding: 10px 24px;
  border-radius: 10px;
  font-family: 'Clash Display', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s ease;
}

.btn-modal-cancel {
  border: 1px solid var(--border-light);
  background: var(--surface);
  color: var(--text-muted);
}

.btn-modal-cancel:hover {
  border-color: var(--text-muted);
  color: var(--text);
}

.btn-modal-confirm {
  border: 1px solid #dc2626;
  background: #dc2626;
  color: #fff;
}

.btn-modal-confirm:hover {
  background: #b91c1c;
  border-color: #b91c1c;
}

@media (max-width: 480px) {
  .modal-actions {
    flex-direction: column;
  }
  .modal-actions button {
    width: 100%;
  }
}

/* Save indicator */
.save-indicator {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  padding: 10px 18px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border-light);
  backdrop-filter: blur(10px);
  font-size: 13px;
  color: var(--text-muted);
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 99;
  pointer-events: none;
  white-space: nowrap;
}

.save-indicator.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Footer */
.site-footer {
  position: relative;
  margin-top: clamp(64px, 10vw, 120px);
  padding: clamp(80px, 12vw, 160px) clamp(24px, 5vw, 48px) clamp(40px, 6vw, 56px);
  text-align: center;
  background:
    radial-gradient(ellipse 80% 55% at 50% 100%, rgba(232,97,26,0.85) 0%, rgba(180,50,5,0.55) 30%, rgba(50,10,0,0.25) 60%, transparent 100%),
    linear-gradient(to top, #1a0800 0%, #0a0a0a 45%);
  border-top: none;
}

html.light .site-footer {
  background:
    radial-gradient(ellipse 80% 55% at 50% 100%, rgba(232,97,26,0.15) 0%, rgba(225,97,5,0.08) 30%, transparent 60%),
    linear-gradient(to top, #f0f0f0 0%, #fafafa 45%);
}

html.light .footer-made-with {
  color: #333;
}

html.light .footer-made-with a {
  color: #111;
}

html.light .footer-bmc {
  background: rgba(0,0,0,0.05);
  border-color: rgba(0,0,0,0.1);
  color: #333;
}

html.light .footer-bmc:hover {
  background: rgba(225,97,5,0.1);
  border-color: rgba(225,97,5,0.3);
}

html.light .footer-copyright {
  color: rgba(0,0,0,0.4);
}

html.light .footer-social a {
  color: rgba(0,0,0,0.4);
}

html.light .footer-social a:hover {
  color: rgb(225,97,5);
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  max-width: 600px;
  margin: 0 auto;
}

.footer-made-with {
  font-size: 16px;
  font-weight: 500;
  color: rgba(255,255,255,0.85);
  letter-spacing: 0.02em;
}

.footer-made-with a {
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  transition: color 0.2s;
}

.footer-made-with a:hover { color: rgb(232,97,26); }

.emoji { font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Twemoji Mozilla", sans-serif; font-style: normal; }

.footer-bmc {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  padding: 12px 28px;
  border-radius: 50px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
}

.footer-bmc:hover {
  background: rgba(232,97,26,0.25);
  border-color: rgba(232,97,26,0.5);
  transform: translateY(-2px);
}

.footer-copyright {
  font-size: 12px;
  font-weight: 500;
  color: rgba(255,255,255,0.4);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  line-height: 1.8;
}

.footer-social {
  font-size: 11px;
  font-weight: 500;
  color: rgba(255,255,255,0.3);
  letter-spacing: 0.06em;
  margin-top: -8px;
}

.footer-social a {
  color: rgba(255,255,255,0.45);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-social a:hover { color: rgb(232,97,26); }

/* Mobile nav */
.nav-tabs-scroll {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  padding: 8px 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.nav-tabs-scroll::-webkit-scrollbar { display: none; }

/* Mobile hamburger */
.mobile-menu-btn {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border-light);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.mobile-menu-btn:hover {
  color: var(--text);
  border-color: var(--accent);
}

.mobile-nav-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 199;
}

.mobile-nav-panel {
  display: none;
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 280px;
  background: var(--bg);
  border-left: 1px solid var(--border);
  z-index: 200;
  padding: 20px;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.3s ease, background-color 0.4s ease;
}

.mobile-nav-panel.open {
  transform: translateX(0);
}

.mobile-nav-panel .nav-tab {
  width: 100%;
  justify-content: flex-start;
  padding: 12px 16px;
  font-size: 15px;
  margin-bottom: 4px;
}

.mobile-nav-close {
  width: 100%;
  display: flex;
  justify-content: flex-end;
  margin-bottom: 16px;
}

.mobile-nav-close button {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border-light);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 768px) {
  .nav-desktop { display: none !important; }
  .mobile-menu-btn { display: flex; }
  .mobile-nav-panel { display: block; }
  .hero-section { padding-top: 120px; padding-bottom: 40px; }
  .form-section { padding: 60px 16px 20px; }
  .question-hint { padding-left: 0; }
  .pdf-card { padding: 24px 16px; }
}

@media (min-width: 769px) {
  .mobile-menu-btn { display: none; }
}

/* Transition helpers */
*, *::before, *::after {
  transition-property: background-color, border-color, color, fill, stroke;
  transition-duration: 0s;
}

body, .nav-bar, .form-input, .pdf-card, .nav-tab, .theme-toggle, .hero-badge,
.mobile-nav-panel, .save-indicator, .site-footer, .section-number,
.pdf-toggle label, .btn-pdf, .floating-panel {
  transition-duration: 0.4s;
  transition-timing-function: ease;
}

/* Extra bottom padding on mobile so floating bar doesn't cover content */
@media (max-width: 768px) {
  main { padding-bottom: 90px; }
}

/* Progress animation */
@keyframes countPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}
.count-pop {
  animation: countPop 0.3s ease;
}

/* Radio Groups */
.radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.radio-option {
  display: none;
}

.radio-option + label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 10px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text-muted);
  font-size: 17px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s ease;
  user-select: none;
}

.radio-option + label:hover {
  border-color: var(--border-light);
  background: var(--surface);
  color: var(--text);
}

.radio-option:checked + label {
  border-color: rgba(225, 97, 5, 0.4);
  background: var(--accent-glow);
  color: var(--accent);
}

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

.radio-option + label .radio-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--input-border);
  position: relative;
  flex-shrink: 0;
  transition: all 0.25s ease;
}

.radio-option:checked + label .radio-dot {
  border-color: var(--accent);
}

.radio-option:checked + label .radio-dot::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

/* Checkbox Grid */
.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 8px;
}

.checkbox-option {
  display: none;
}

.checkbox-option + label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text-muted);
  font-size: 17px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s ease;
  user-select: none;
}

.checkbox-option + label:hover {
  border-color: var(--border-light);
  background: var(--surface);
  color: var(--text);
}

.checkbox-option:checked + label {
  border-color: rgba(225, 97, 5, 0.4);
  background: var(--accent-glow);
  color: var(--accent);
}

.checkbox-option:focus-visible + label {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.checkbox-option + label .check-box {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 2px solid var(--input-border);
  position: relative;
  flex-shrink: 0;
  transition: all 0.25s ease;
}

.checkbox-option:checked + label .check-box {
  border-color: var(--accent);
  background: var(--accent);
}

.checkbox-option:checked + label .check-box::after {
  content: '';
  position: absolute;
  top: 1px; left: 4px;
  width: 4px; height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

@media (max-width: 768px) {
  .checkbox-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .checkbox-grid {
    grid-template-columns: 1fr;
  }
}

/* Conditional Fields */
.conditional-field {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, opacity 0.3s ease, margin 0.3s ease;
  margin-top: 0;
}

.conditional-field.visible {
  max-height: 200px;
  opacity: 1;
  margin-top: 12px;
}

.other-field {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, opacity 0.3s ease, margin 0.3s ease;
  margin-top: 0;
  grid-column: 1 / -1;
}

.other-field.visible {
  max-height: 200px;
  opacity: 1;
  margin-top: 0;
}

.other-field textarea {
  width: 100%;
  min-height: 60px;
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text);
  font-family: 'Clash Display', -apple-system, sans-serif;
  font-size: 17px;
  font-weight: 400;
  line-height: 1.6;
  resize: vertical;
  outline: none;
  transition: all 0.3s ease;
}

.other-field textarea::placeholder {
  color: var(--text-muted);
  opacity: 0.5;
}

.other-field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--input-focus);
  background: var(--surface);
}

/* Spinner animation (for PDF button) */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Floating toggles wrapper: stacks Branded/Plain + PDF/Word in floating panel */
.floating-panel .floating-toggles {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.floating-panel .floating-toggles .pdf-toggle {
  margin-bottom: 0;
}

/* Mobile: compact stacked toggles in floating bar */
@media (max-width: 768px) {
  .floating-panel .floating-toggles {
    flex-direction: column;
    flex-shrink: 0;
    gap: 4px;
    width: auto;
  }

  .floating-panel .floating-toggles .pdf-toggle {
    width: auto;
    margin-bottom: 0;
  }

  .floating-panel .floating-toggles .pdf-toggle label {
    padding: 5px 8px;
    font-size: 11px;
  }
}
