/* ==========================================================================
   GUARDORA SECURITY RISK ASSESSMENT — DESIGN TOKENS
   Palette: deep graphite-navy base, aurora teal/violet signature accent,
   functional red-amber-orange-green severity scale kept true to convention
   so risk reads instantly. Display type: Space Grotesk. Body: Inter.
   Data/scores: JetBrains Mono — a nod to the terminal/scan aesthetic.
   ========================================================================== */

:root{
  --bg:            #0A0F16;
  --bg-raised:     #0F161F;
  --surface:       #131C27;
  --surface-2:     #1A2534;
  --border:        #263344;
  --border-soft:   #1C2735;

  --text:          #E9EEF4;
  --text-muted:    #8FA0B3;
  --text-faint:    #56667A;

  --accent:        #38D9C9;
  --accent-dim:    #1F6E68;
  --accent-2:      #8B7CF6;

  --risk-low:      #34D399;
  --risk-medium:   #F5C445;
  --risk-high:     #F5924A;
  --risk-critical: #F0575C;

  --font-display:  'Space Grotesk', sans-serif;
  --font-body:     'Inter', sans-serif;
  --font-mono:     'JetBrains Mono', monospace;

  --radius-s:  8px;
  --radius-m:  14px;
  --radius-l:  22px;

  --shadow-card: 0 20px 60px -30px rgba(0,0,0,0.7);
}

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

html, body{
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

body{
  min-height: 100vh;
}

img, svg{ display:block; max-width:100%; }

button{ font-family: inherit; cursor: pointer; }
input{ font-family: inherit; }

@media (prefers-reduced-motion: reduce){
  *, *::before, *::after{
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

:focus-visible{
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.app{
  max-width: 840px;
  margin: 0 auto;
  padding: 0 24px 64px;
  position: relative;
}

/* ---------------------------------------------------------------------
   Shared bits
   --------------------------------------------------------------------- */

.eyebrow{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 18px;
}
.eyebrow__dot{
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(56,217,201,0.18);
}

.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  padding: 13px 22px;
  border-radius: var(--radius-s);
  border: 1px solid transparent;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}
.btn:active{ transform: translateY(1px); }
.btn--primary{
  background: var(--accent);
  color: #06201C;
}
.btn--primary:hover{ background: #4FE4D4; }
.btn--primary:disabled{
  background: var(--surface-2);
  color: var(--text-faint);
  cursor: not-allowed;
}
.btn--ghost{
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}
.btn--ghost:hover{
  color: var(--text);
  border-color: var(--accent-dim);
}
.btn--large{ padding: 16px 28px; font-size: 16px; }
.btn--full{ width: 100%; }

.link-btn{
  background: none;
  border: none;
  color: var(--accent);
  font-weight: 600;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.screen{ display: none; }
.screen.is-active{ display: block; }

/* ---------------------------------------------------------------------
   Welcome screen
   --------------------------------------------------------------------- */

.screen--welcome{
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 40px;
  overflow: hidden;
}

.scanfield{
  position: absolute;
  inset: -10% -24px auto -24px;
  height: 640px;
  color: var(--border-soft);
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, black, transparent);
          mask-image: linear-gradient(to bottom, black, transparent);
}
.scanfield__grid{ width: 100%; height: 100%; }
.scanfield__line{
  position: absolute;
  left: 0; right: 0;
  height: 120px;
  top: -120px;
  background: linear-gradient(to bottom, transparent, rgba(56,217,201,0.09), transparent);
  animation: scanDown 7s linear infinite;
}
@keyframes scanDown{
  0%{ transform: translateY(0); }
  100%{ transform: translateY(640px); }
}

.welcome__content{ position: relative; z-index: 1; padding: 40px 0 20px; }

.welcome__headline{
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(34px, 5.4vw, 54px);
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin: 0 0 20px;
}

.welcome__desc{
  font-size: 17px;
  line-height: 1.6;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 0 36px;
}

.welcome__meta{
  display: flex;
  gap: 32px;
  padding: 22px 0;
  margin-bottom: 36px;
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
}
.welcome__meta-item{ display: flex; flex-direction: column; gap: 4px; }
.welcome__meta-num{
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 600;
  color: var(--accent);
}
.welcome__meta-label{
  font-size: 12.5px;
  color: var(--text-faint);
}

.welcome__resume{
  margin-top: 18px;
  font-size: 14px;
  color: var(--text-muted);
}

/* ---------------------------------------------------------------------
   Assessment screen
   --------------------------------------------------------------------- */

.screen--assessment, #screen-assessment{ padding-top: 48px; min-height: 100vh; }

.assess__header{ margin-bottom: 40px; }

.assess__progress-track{
  height: 4px;
  border-radius: 4px;
  background: var(--surface-2);
  overflow: hidden;
  margin-bottom: 14px;
}
.assess__progress-fill{
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.4s ease;
}

.assess__progress-meta{
  display: flex;
  justify-content: space-between;
  align-items: center;
}
#progress-label{
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-faint);
}
.assess__category-tag{
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(56,217,201,0.09);
  border: 1px solid rgba(56,217,201,0.25);
  padding: 5px 10px;
  border-radius: 20px;
}

.question{ min-height: 320px; }

.question__text{
  font-family: var(--font-display);
  font-size: clamp(23px, 3.4vw, 30px);
  font-weight: 600;
  line-height: 1.28;
  margin: 0 0 28px;
  max-width: 620px;
}

.answer-list{
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 26px;
}

.answer{
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  color: var(--text);
  font-size: 15.5px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.answer:hover{ border-color: var(--accent-dim); background: var(--surface-2); }
.answer__marker{
  flex: 0 0 auto;
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  position: relative;
}
.answer.is-selected{
  border-color: var(--accent);
  background: rgba(56,217,201,0.07);
}
.answer.is-selected .answer__marker{
  border-color: var(--accent);
}
.answer.is-selected .answer__marker::after{
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--accent);
}

.question__explainer{
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-raised);
  border: 1px solid var(--border-soft);
  border-left: 3px solid var(--accent-2);
  border-radius: var(--radius-s);
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.55;
}
.question__explainer b{ color: var(--text); font-weight: 600; }

.assess__footer{
  display: flex;
  justify-content: space-between;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border-soft);
}

/* ---------------------------------------------------------------------
   Results screen
   --------------------------------------------------------------------- */

#screen-results{ padding-top: 48px; }

.results__summary{
  display: flex;
  align-items: center;
  gap: 40px;
  padding-bottom: 40px;
  margin-bottom: 40px;
  border-bottom: 1px solid var(--border-soft);
}

.gauge{
  position: relative;
  flex: 0 0 auto;
  width: 220px; height: 220px;
}
.gauge__svg{ width: 220px; height: 220px; transform: rotate(-90deg); }
.gauge__track{
  fill: none;
  stroke: var(--surface-2);
  stroke-width: 12;
}
.gauge__arc{
  fill: none;
  stroke: var(--risk-low);
  stroke-width: 12;
  stroke-linecap: round;
  stroke-dasharray: 603;
  stroke-dashoffset: 603;
  transition: stroke-dashoffset 1.1s cubic-bezier(.22,.9,.3,1), stroke 0.6s ease;
}
.gauge__sweep-group{
  transform-origin: 110px 110px;
  animation: sweepRotate 3.4s linear infinite;
  opacity: 0.55;
}
.gauge__sweep-line{
  stroke: var(--accent);
  stroke-width: 1.4;
  opacity: 0.5;
}
@keyframes sweepRotate{
  from{ transform: rotate(0deg); }
  to{ transform: rotate(360deg); }
}
.gauge__readout{
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.gauge__score{
  font-family: var(--font-mono);
  font-size: 44px;
  font-weight: 700;
  line-height: 1;
}
.gauge__score-label{
  font-size: 12px;
  color: var(--text-faint);
  margin-top: 6px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.results__risk-title{
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  margin: 0 0 10px;
  letter-spacing: -0.01em;
}
.results__risk-desc{
  color: var(--text-muted);
  font-size: 15.5px;
  line-height: 1.6;
  max-width: 440px;
  margin: 0;
}

.results__block{ margin-bottom: 44px; }
.results__block-title{
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 18px;
}

.risk-list{ display: flex; flex-direction: column; gap: 12px; }
.risk-item{
  display: flex;
  gap: 14px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--sev-color, var(--risk-medium));
  border-radius: var(--radius-s);
}
.risk-item__badge{
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--sev-color, var(--risk-medium));
  background: color-mix(in srgb, var(--sev-color, var(--risk-medium)) 14%, transparent);
  border-radius: 6px;
  padding: 4px 8px;
  height: fit-content;
}
.risk-item__body h4{
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 600;
}
.risk-item__body p{
  margin: 0;
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.55;
}
.risk-item__body .risk-item__action{
  margin-top: 8px;
  font-size: 13px;
  color: var(--accent);
}

.package-card{
  background: linear-gradient(160deg, var(--surface) 0%, var(--bg-raised) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  padding: 30px;
  box-shadow: var(--shadow-card);
}
.package-card__tag{
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-bottom: 12px;
}
.package-card__name{
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 8px;
}
.package-card__for{
  color: var(--text-muted);
  font-size: 14px;
  margin: 0 0 20px;
}
.package-card__list{
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.package-card__list li{
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 14px;
  color: var(--text);
}
.package-card__list li::before{
  content: '';
  flex: 0 0 auto;
  width: 6px; height: 6px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.results__block--cta{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  padding: 32px;
}
.lead{ display: grid; grid-template-columns: 1fr 1fr; gap: 36px; }
.lead__copy h3{ margin-top: 0; }
.lead__sub{ color: var(--text-muted); font-size: 14px; line-height: 1.6; }

.lead__form{ display: flex; flex-direction: column; gap: 14px; }
.field{ display: flex; flex-direction: column; gap: 6px; }
.field label{ font-size: 12.5px; color: var(--text-faint); }
.field input{
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  padding: 11px 13px;
  color: var(--text);
  font-size: 14.5px;
}
.field input:focus{ border-color: var(--accent); outline: none; }
.lead__confirm{
  font-size: 13.5px;
  color: var(--risk-low);
  margin: 4px 0 0;
}

.faq-list{ display: flex; flex-direction: column; gap: 10px; }
.faq-item{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  overflow: hidden;
}
.faq-item__q{
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 15px 18px;
  background: none;
  border: none;
  color: var(--text);
  font-size: 14.5px;
  font-weight: 600;
  text-align: left;
}
.faq-item__chevron{ transition: transform 0.2s ease; flex: 0 0 auto; color: var(--text-faint); }
.faq-item.is-open .faq-item__chevron{ transform: rotate(45deg); }
.faq-item__a{
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
}
.faq-item__a-inner{ padding: 0 18px 16px; }
.faq-item.is-open .faq-item__a{ max-height: 240px; }

.results__actions{
  display: flex;
  gap: 12px;
  justify-content: center;
  padding-top: 12px;
}

/* ---------------------------------------------------------------------
   Responsive
   --------------------------------------------------------------------- */

@media (max-width: 640px){
  .app{ padding: 0 18px 48px; }
  .welcome__meta{ gap: 20px; flex-wrap: wrap; }
  .results__summary{ flex-direction: column; text-align: center; gap: 24px; }
  .results__risk-desc{ max-width: none; }
  .lead{ grid-template-columns: 1fr; }
  .package-card__list{ grid-template-columns: 1fr; }
  .assess__footer{ flex-direction: row; }
}

/* ---------------------------------------------------------------------
   Print (Export report)
   --------------------------------------------------------------------- */

@media print{
  body{ background: #fff; color: #111; }
  .btn, .assess__footer, #screen-welcome, #screen-assessment{ display: none !important; }
}
