/* ============================================================
   AI Disclosure Generator — styles.css
   Mobile-first, no framework, Lighthouse 90+ target
   ============================================================ */

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

:root {
  --color-bg: #f8f9fc;
  --color-surface: #ffffff;
  --color-border: #e2e8f0;
  --color-primary: #2563eb;
  --color-primary-dark: #1d4ed8;
  --color-primary-light: #dbeafe;
  --color-text: #1e293b;
  --color-text-muted: #64748b;
  --color-success: #16a34a;
  --color-warning: #d97706;
  --color-danger: #dc2626;
  --color-likely: #2563eb;
  --color-recommended: #059669;
  --color-goodtoknow: #6366f1;
  --color-warning-badge: #d97706;
  --color-warning-bg: #fef3c7;
  --color-danger-bg: #fee2e2;
  --color-pro: #7c3aed;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.1);
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --max-width: 760px;
  --spacing-page: 1rem;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: var(--color-primary);
  text-decoration: underline;
}

a:hover {
  color: var(--color-primary-dark);
}

/* --- Layout --- */
.site-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 0.75rem var(--spacing-page);
}

.site-header__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-logo {
  font-weight: 700;
  font-size: 1rem;
  color: var(--color-text);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.site-logo span {
  color: var(--color-primary);
}

.site-header__links {
  display: flex;
  gap: 1rem;
  font-size: 0.8125rem;
}

.site-header__links a {
  color: var(--color-text-muted);
  text-decoration: none;
}

.site-header__links a:hover {
  color: var(--color-primary);
}

.main-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.5rem var(--spacing-page) 3rem;
}

/* --- Hero --- */
.hero {
  text-align: center;
  padding: 2rem 0 1.5rem;
}

.hero__badge {
  display: inline-block;
  background: var(--color-primary-light);
  color: var(--color-primary);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.25rem 0.75rem;
  border-radius: 100px;
  margin-bottom: 1rem;
}

.hero h1 {
  font-size: clamp(1.6rem, 5vw, 2.4rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

.hero__sub {
  font-size: 1rem;
  color: var(--color-text-muted);
  max-width: 600px;
  margin: 0 auto 0.5rem;
}

.hero__privacy-note {
  font-size: 0.8125rem;
  color: var(--color-success);
  font-weight: 600;
  margin-top: 0.5rem;
}

/* --- Form Card --- */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.form-section {
  margin-bottom: 1.75rem;
}

.form-section:last-child {
  margin-bottom: 0;
}

.form-label {
  display: block;
  font-weight: 600;
  font-size: 0.9375rem;
  margin-bottom: 0.625rem;
  color: var(--color-text);
}

.form-label .q-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.375rem;
  height: 1.375rem;
  background: var(--color-primary);
  color: white;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 700;
  margin-right: 0.5rem;
  flex-shrink: 0;
}

/* Button-group selects */
.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.btn-option {
  background: var(--color-bg);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.875rem;
  font-size: 0.875rem;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  color: var(--color-text);
  line-height: 1.4;
  user-select: none;
}

.btn-option:hover {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
}

.btn-option.selected {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
  font-weight: 600;
}

.btn-option:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Two-column sub-questions */
.sub-questions {
  display: none;
  background: #f1f5f9;
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-top: 0.75rem;
  gap: 1rem;
}

.sub-questions.visible {
  display: flex;
  flex-direction: column;
}

.sub-q-label {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.375rem;
  color: var(--color-text);
}

/* Politics checkbox */
.politics-check {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: var(--color-warning-bg);
  border: 1px solid #fcd34d;
  border-radius: var(--radius-md);
  padding: 0.875rem 1rem;
  margin-bottom: 1.25rem;
  cursor: pointer;
}

.politics-check input[type="checkbox"] {
  width: 1.125rem;
  height: 1.125rem;
  margin-top: 0.125rem;
  accent-color: var(--color-warning);
  flex-shrink: 0;
  cursor: pointer;
}

.politics-check label {
  font-size: 0.875rem;
  color: var(--color-text);
  cursor: pointer;
  line-height: 1.5;
}

/* CTA Button */
.btn-cta {
  display: block;
  width: 100%;
  background: var(--color-primary);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  padding: 0.875rem 1.5rem;
  font-size: 1.0625rem;
  font-weight: 700;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  letter-spacing: 0.01em;
  margin-top: 1.5rem;
}

.btn-cta:hover {
  background: var(--color-primary-dark);
}

.btn-cta:active {
  transform: scale(0.98);
}

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

/* --- Disclaimer Bar (§1-1: always visible while scrolling results) --- */
.disclaimer-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fef9ee;
  border: 1px solid #fed7aa;
  /* remove top border-radius when stuck so it looks flush at viewport edge */
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  padding: 0.875rem 1rem;
  font-size: 0.8125rem;
  color: #92400e;
  line-height: 1.5;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.10);
}

.disclaimer-bar strong {
  color: #78350f;
}

/* --- Results Section --- */
.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.results-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
}

.btn-back {
  background: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
  font-family: var(--font-sans);
  cursor: pointer;
  color: var(--color-text-muted);
  transition: border-color 0.15s, color 0.15s;
}

.btn-back:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

/* --- Rule Cards --- */
.rules-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.rule-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1rem 1.125rem;
  box-shadow: var(--shadow-sm);
}

.rule-card__header {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.badge {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: 100px;
  white-space: nowrap;
  flex-shrink: 0;
}

.badge--likely {
  background: #dbeafe;
  color: #1d4ed8;
}

.badge--recommended {
  background: #d1fae5;
  color: #065f46;
}

.badge--goodtoknow {
  background: #ede9fe;
  color: #5b21b6;
}

.badge--warning {
  background: var(--color-warning-bg);
  color: #92400e;
}

.badge--danger {
  background: var(--color-danger-bg);
  color: #991b1b;
}

.rule-card__title {
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.4;
  flex: 1;
  min-width: 0;
}

.rule-card__explanation {
  font-size: 0.8375rem;
  color: var(--color-text-muted);
  line-height: 1.6;
  margin-bottom: 0.5rem;
}

.rule-card__source {
  font-size: 0.75rem;
}

/* --- Disclosure Text Box --- */
.disclosure-section {
  margin-bottom: 1.5rem;
}

.section-title {
  font-size: 1.0625rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--color-border);
  margin-bottom: 1rem;
  overflow-x: auto;
}

.tab-btn {
  background: none;
  border: none;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  color: var(--color-text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
}

.tab-btn.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

.tab-btn:hover:not(.active) {
  color: var(--color-text);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.disclosure-box {
  position: relative;
}

.disclosure-text {
  background: #f8faff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1rem;
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--color-text);
  min-height: 60px;
  white-space: pre-wrap;
}

.btn-copy {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  margin-top: 0.625rem;
  background: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  color: var(--color-text-muted);
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.btn-copy:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: var(--color-primary-light);
}

.btn-copy.copied {
  border-color: var(--color-success);
  color: var(--color-success);
  background: #f0fdf4;
}

/* Pro lock overlay */
.pro-lock {
  position: relative;
}

.pro-lock__overlay {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.75);
  backdrop-filter: blur(3px);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.75rem;
  text-align: center;
  padding: 1rem;
}

.pro-lock__overlay p {
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

/* --- Placement Guide --- */
.placement-grid {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  margin-bottom: 1.5rem;
}

.placement-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 0.875rem 1rem;
}

.placement-card__platform {
  font-weight: 700;
  font-size: 0.875rem;
  margin-bottom: 0.25rem;
}

.placement-card__instruction {
  font-size: 0.8375rem;
  color: var(--color-text-muted);
  line-height: 1.5;
}

/* --- Pro Upsell --- */
.pro-upsell {
  background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
  border: 1px solid #c4b5fd;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

.pro-upsell__label {
  display: inline-block;
  background: var(--color-pro);
  color: white;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.2rem 0.625rem;
  border-radius: 100px;
  margin-bottom: 0.75rem;
}

.pro-upsell h3 {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--color-text);
}

.pro-upsell__desc {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-bottom: 1rem;
}

.pro-features {
  list-style: none;
  text-align: left;
  display: inline-block;
  margin-bottom: 1.25rem;
}

.pro-features li {
  font-size: 0.875rem;
  padding: 0.2rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--color-text);
}

.pro-features li::before {
  content: "\2713";
  color: var(--color-pro);
  font-weight: 700;
  font-size: 0.875rem;
}

.pro-price {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-bottom: 1rem;
}

.pro-price strong {
  font-size: 1.375rem;
  color: var(--color-pro);
  font-weight: 800;
}

.pro-price s {
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

.btn-pro {
  display: inline-block;
  background: var(--color-pro);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  padding: 0.75rem 2rem;
  font-size: 1rem;
  font-weight: 700;
  font-family: var(--font-sans);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, transform 0.1s;
}

.btn-pro:hover {
  background: #6d28d9;
  color: white;
  text-decoration: none;
}

.btn-pro:active {
  transform: scale(0.98);
}

.pro-guarantee {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-top: 0.625rem;
}

/* --- Hard Stop (politics) --- */
.hard-stop {
  background: var(--color-danger-bg);
  border: 1px solid #fca5a5;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: center;
}

.hard-stop__icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.hard-stop h2 {
  font-size: 1.125rem;
  font-weight: 700;
  color: #991b1b;
  margin-bottom: 0.75rem;
}

.hard-stop p {
  font-size: 0.9rem;
  color: #7f1d1d;
  line-height: 1.6;
}

/* --- FAQ Section --- */
.faq-section {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--color-border);
}

.faq-section h2 {
  font-size: 1.375rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  text-align: center;
}

.faq-item {
  border-bottom: 1px solid var(--color-border);
  padding: 1rem 0;
}

.faq-item:last-child {
  border-bottom: none;
}

.faq-question {
  font-weight: 600;
  font-size: 0.9375rem;
  margin-bottom: 0.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  list-style: none;
}

.faq-question::after {
  content: "+";
  font-size: 1.25rem;
  color: var(--color-primary);
  flex-shrink: 0;
  transition: transform 0.2s;
}

details[open] .faq-question::after {
  transform: rotate(45deg);
}

.faq-answer {
  font-size: 0.8875rem;
  color: var(--color-text-muted);
  line-height: 1.7;
  padding-top: 0.5rem;
}

.faq-answer a {
  font-size: inherit;
}

/* --- Footer --- */
.site-footer {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: 1.5rem var(--spacing-page);
  margin-top: 3rem;
}

.site-footer__inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.site-footer__top {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.footer-brand {
  font-weight: 700;
  color: var(--color-text);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.8125rem;
}

.footer-links a {
  color: var(--color-text-muted);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--color-primary);
}

.site-footer__bottom {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  border-top: 1px solid var(--color-border);
  padding-top: 0.875rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: space-between;
  align-items: center;
}

.footer-reviewed {
  font-weight: 600;
  color: var(--color-text-muted);
}

/* --- Hoppling signature --- */
.site-footer__hoppling {
  padding: 0.75rem 0;
  border-top: 1px solid var(--color-border);
  margin-top: 0.25rem;
}

.hoppling-sig {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.hoppling-mascot {
  display: inline-flex;
  align-items: center;
  width: 28px;
  height: 28px;
  background: var(--color-primary-light);
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
}

.hoppling-mascot img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.hoppling-sig a {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 600;
}

.hoppling-sig a:hover {
  text-decoration: underline;
}

/* --- State visibility --- */
#state-input { display: block; }
#state-results { display: none; }
#state-hardstop { display: none; }

/* --- No results message --- */
.no-rules-msg {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  font-size: 0.9rem;
  color: var(--color-text-muted);
  text-align: center;
}

/* --- Responsive --- */
@media (min-width: 600px) {
  :root {
    --spacing-page: 1.5rem;
  }

  .card {
    padding: 2rem;
  }

  .sub-questions.visible {
    flex-direction: row;
  }

  .sub-questions > div {
    flex: 1;
  }
}

@media (min-width: 900px) {
  :root {
    --spacing-page: 2rem;
  }

  .hero {
    padding: 3rem 0 2rem;
  }
}

/* --- Print --- */
@media print {
  .site-header, .btn-back, .pro-upsell, .btn-copy, .faq-section, .site-footer {
    display: none !important;
  }

  .disclaimer-bar {
    border: 2px solid #000;
  }
}
