/* =============================================================
   Will Safety Quiz — front-end styles
   Scoped under .wsq-root to avoid bleeding into the host theme
   ============================================================= */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,600;9..144,800;9..144,900&family=Lora:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

#wsq-quiz-root, #wsq-quiz-root * { box-sizing: border-box; }

.wsq-root {
  font-family: 'Lora', Georgia, serif;
  color: #1c1917;
  background: #fafaf9;
  line-height: 1.5;
  /* Break out of narrow theme content columns and span the full viewport width */
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  padding: 0;
}
.wsq-root .display { font-family: 'Fraunces', Georgia, serif; font-feature-settings: "ss01"; }
.wsq-root .mono { font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: 0.25em; text-transform: uppercase; }

.wsq-container { max-width: 1100px; margin: 0 auto; padding: 64px 32px; }
.wsq-container-narrow { max-width: 720px; margin: 0 auto; padding: 64px 32px; }

@keyframes wsqFadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes wsqScoreReveal { from { opacity: 0; transform: scale(0.92); } to { opacity: 1; transform: scale(1); } }
.wsq-fade-up { animation: wsqFadeUp 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.wsq-score-reveal { animation: wsqScoreReveal 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) both; }

/* INTRO */
.wsq-eyebrow { color: #991b1b; margin-bottom: 24px; }
.wsq-h1 { font-family: 'Fraunces', Georgia, serif; font-size: clamp(34px, 5vw, 60px); font-weight: 900; line-height: 1.05; margin: 0 0 24px 0; color: #1c1917; }
.wsq-h1 em { font-weight: 400; font-style: italic; color: #7f1d1d; }
.wsq-lead { font-size: 18px; color: #44403c; line-height: 1.6; margin: 0 0 32px 0; max-width: 640px; }
.wsq-callout { border-left: 2px solid #7f1d1d; padding: 16px 20px; background: rgba(245,245,244,0.5); margin-bottom: 40px; }
.wsq-callout-label { color: #78716c; margin-bottom: 8px; }
.wsq-callout p { margin: 0; color: #292524; line-height: 1.6; }

.wsq-btn-primary { display: inline-flex; align-items: center; gap: 12px; background: #1c1917; color: #fafaf9; padding: 16px 32px; border: none; cursor: pointer; transition: background 0.3s; font-family: 'Fraunces', serif; font-size: 18px; font-weight: 600; text-decoration: none; }
.wsq-btn-primary:hover { background: #7f1d1d; color: #fafaf9; }
.wsq-btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }
.wsq-btn-primary svg { transition: transform 0.2s; }
.wsq-btn-primary:hover svg { transform: translateX(4px); }

.wsq-stats { margin-top: 48px; padding-top: 32px; border-top: 1px solid #d6d3d1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.wsq-stat-num { font-family: 'Fraunces', serif; font-size: clamp(28px, 4vw, 36px); font-weight: 900; color: #7f1d1d; line-height: 1; margin-bottom: 8px; }
.wsq-stat-label { font-size: 12px; color: #57534e; line-height: 1.4; }

/* QUIZ */
.wsq-progress-meta { display: flex; justify-content: space-between; margin-bottom: 12px; }
.wsq-progress-meta .wsq-risk { color: #92400e; }
.wsq-progress-meta .wsq-risk-critical { color: #991b1b; }
.wsq-progress-bar { height: 1px; background: #d6d3d1; position: relative; overflow: hidden; margin-bottom: 40px; }
.wsq-progress-fill { position: absolute; top: 0; left: 0; height: 100%; background: #7f1d1d; transition: width 0.5s ease-out; }

.wsq-q-flaw { color: #7f1d1d; font-family: 'Fraunces', serif; font-weight: 600; font-size: 14px; text-transform: uppercase; letter-spacing: 0.15em; margin-bottom: 12px; }
.wsq-q-text { font-family: 'Fraunces', serif; font-size: clamp(24px, 3.2vw, 36px); font-weight: 600; line-height: 1.25; color: #1c1917; margin: 0 0 20px 0; }
.wsq-q-detail { color: #57534e; line-height: 1.6; font-style: italic; border-left: 2px solid #d6d3d1; padding-left: 16px; margin: 0 0 40px 0; }

.wsq-options { display: flex; flex-direction: column; gap: 12px; }
.wsq-option { width: 100%; text-align: left; padding: 16px 20px; border: 1px solid #d6d3d1; background: transparent; cursor: pointer; transition: all 0.2s; display: flex; align-items: center; justify-content: space-between; font-family: inherit; font-size: 16px; color: #292524; }
.wsq-option:hover { border-color: #1c1917; background: #f5f5f4; }
.wsq-option svg { color: #a8a29e; transition: all 0.2s; }
.wsq-option:hover svg { color: #7f1d1d; transform: translateX(4px); }

.wsq-back { background: none; border: none; color: #78716c; cursor: pointer; margin-top: 32px; font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: 0.25em; text-transform: uppercase; padding: 0; }
.wsq-back:hover { color: #1c1917; }

/* CAPTURE */
.wsq-h2 { font-family: 'Fraunces', serif; font-size: clamp(28px, 4vw, 44px); font-weight: 900; line-height: 1.1; margin: 0 0 20px 0; color: #1c1917; }
.wsq-h2 em { font-weight: 400; font-style: italic; color: #7f1d1d; }

.wsq-form { display: flex; flex-direction: column; gap: 20px; }
.wsq-field-label { color: #78716c; display: block; margin-bottom: 8px; }
.wsq-input { width: 100%; padding: 12px 16px; border: 1px solid #d6d3d1; background: #fafaf9; color: #1c1917; font-family: inherit; font-size: 16px; transition: border-color 0.2s, background 0.2s; }
.wsq-input:focus { outline: none; border-color: #1c1917; background: #fff; }
.wsq-input.error { border-color: #991b1b; }
.wsq-input::placeholder { color: #a8a29e; }
.wsq-error { color: #991b1b; font-family: 'JetBrains Mono', monospace; font-size: 11px; margin-top: 6px; }

.wsq-consent { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; padding-top: 8px; }
.wsq-consent input { margin-top: 4px; accent-color: #7f1d1d; }
.wsq-consent span { font-size: 14px; color: #44403c; line-height: 1.5; }
.wsq-submit-error { background: #fef2f2; border-left: 2px solid #991b1b; padding: 12px 16px; color: #7f1d1d; font-family: 'JetBrains Mono', monospace; font-size: 12px; }
.wsq-fineprint { text-align: center; color: #a8a29e; font-family: 'JetBrains Mono', monospace; font-size: 10px; letter-spacing: 0.25em; text-transform: uppercase; padding-top: 8px; }

.wsq-loader { width: 18px; height: 18px; border: 2px solid #fafaf9; border-top-color: transparent; border-radius: 50%; animation: wsq-spin 0.8s linear infinite; }
@keyframes wsq-spin { to { transform: rotate(360deg); } }

/* RESULT */
.wsq-confirm { display: flex; align-items: center; gap: 8px; color: #78716c; margin-bottom: 24px; }
.wsq-confirm svg { color: #047857; }

.wsq-score-card { position: relative; padding: 40px; background: #1c1917; color: #fafaf9; margin-bottom: 40px; overflow: hidden; }
.wsq-score-card::before { content: ''; position: absolute; inset: 0; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.4'/%3E%3C/svg%3E"); opacity: 0.5; pointer-events: none; }
.wsq-score-card > * { position: relative; z-index: 1; }
.wsq-score-eyebrow { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; color: #a8a29e; }
.wsq-score-num { font-family: 'Fraunces', serif; font-size: clamp(72px, 12vw, 144px); font-weight: 900; line-height: 0.95; letter-spacing: -0.02em; margin-bottom: 4px; }
.wsq-score-num span { color: #78716c; font-size: 0.55em; }
.wsq-score-verdict { font-family: 'Fraunces', serif; font-style: italic; font-size: clamp(22px, 3vw, 32px); margin-bottom: 20px; }
.wsq-score-headline { color: #d6d3d1; font-size: 17px; line-height: 1.6; max-width: 540px; }

.wsq-btn-pdf { display: inline-flex; align-items: center; gap: 12px; background: #7f1d1d; color: #fafaf9; padding: 16px 32px; border: none; cursor: pointer; transition: background 0.3s; font-family: 'Fraunces', serif; font-size: 18px; font-weight: 600; margin-bottom: 40px; }
.wsq-btn-pdf:hover { background: #1c1917; }

.wsq-flaw-list-h3 { font-family: 'Fraunces', serif; font-size: 24px; font-weight: 600; margin: 0 0 20px 0; }
.wsq-flaw { display: flex; gap: 16px; padding: 16px; border-left: 2px solid #7f1d1d; background: #f5f5f4; margin-bottom: 12px; }
.wsq-flaw-num { color: #7f1d1d; font-family: 'JetBrains Mono', monospace; font-weight: 600; font-size: 14px; padding-top: 2px; }
.wsq-flaw-title { font-family: 'Fraunces', serif; font-weight: 600; color: #1c1917; margin-bottom: 4px; }
.wsq-flaw-tag { font-family: 'JetBrains Mono', monospace; font-size: 10px; text-transform: uppercase; letter-spacing: 0.15em; padding: 2px 6px; margin-left: 12px; vertical-align: middle; }
.wsq-flaw-tag-critical { background: #7f1d1d; color: #fafaf9; }
.wsq-flaw-tag-high { background: #fef3c7; color: #78350f; }
.wsq-flaw-detail { font-size: 14px; color: #44403c; margin: 0; line-height: 1.5; }

.wsq-cta-block { background: #1c1917; color: #fafaf9; padding: 40px; margin-bottom: 24px; }
.wsq-cta-eyebrow { color: #a8a29e; margin-bottom: 12px; }
.wsq-cta-h3 { font-family: 'Fraunces', serif; font-size: clamp(22px, 3vw, 30px); font-weight: 600; line-height: 1.3; margin: 0 0 16px 0; }
.wsq-cta-block p { color: #d6d3d1; margin-bottom: 24px; line-height: 1.6; }
.wsq-cta-grid { display: grid; gap: 12px; }
@media (min-width: 700px) { .wsq-cta-grid { grid-template-columns: 1fr 1fr; } }
.wsq-cta-btn { display: flex; align-items: center; justify-content: space-between; background: #fafaf9; color: #1c1917; padding: 16px 20px; text-decoration: none; transition: background 0.2s, color 0.2s; }
.wsq-cta-btn:hover { background: #7f1d1d; color: #fafaf9; }
.wsq-cta-btn-label { font-family: 'JetBrains Mono', monospace; font-size: 10px; letter-spacing: 0.25em; text-transform: uppercase; opacity: 0.7; }
.wsq-cta-btn-text { font-family: 'Fraunces', serif; font-weight: 600; font-size: 16px; }

.wsq-footer { padding: 32px 24px; margin-top: 32px; border-top: 1px solid #d6d3d1; color: #a8a29e; }
