/* ============================================================
   App Access Risk Assessment — Light Theme Stylesheet
   ============================================================ */

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

:root {
  --clr-bg:          #f0f4f8;
  --clr-surface:     #ffffff;
  --clr-surface2:    #f8fafc;
  --clr-border:      #e2e8f0;
  --clr-border-dark: #cbd5e1;
  --clr-text:        #1e293b;
  --clr-text-sec:    #475569;
  --clr-muted:       #94a3b8;
  --clr-primary:     #2563eb;
  --clr-primary-h:   #1d4ed8;
  --clr-primary-lt:  #eff6ff;
  --clr-primary-mid: #bfdbfe;
  --clr-red:         #dc2626;
  --clr-red-bg:      #fef2f2;
  --clr-red-border:  #fecaca;
  --clr-yellow:      #d97706;
  --clr-yellow-bg:   #fffbeb;
  --clr-yellow-border:#fde68a;
  --clr-green:       #16a34a;
  --clr-green-bg:    #f0fdf4;
  --clr-green-border:#bbf7d0;
  --clr-indigo:      #4f46e5;
  --clr-indigo-lt:   #eef2ff;
  --radius:          16px;
  --radius-sm:       10px;
  --radius-xs:       6px;
  --shadow-sm:       0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow:          0 4px 16px rgba(0,0,0,.08), 0 2px 6px rgba(0,0,0,.05);
  --shadow-lg:       0 10px 40px rgba(0,0,0,.1), 0 4px 12px rgba(0,0,0,.06);
}

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

body {
  background: var(--clr-bg);
  color: var(--clr-text);
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  min-height: 100vh;
}

/* ── Header ── */
.app-header {
  background: var(--clr-surface);
  border-bottom: 1px solid var(--clr-border);
  padding: .875rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}
.header-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: .875rem;
}
.header-logo {
  font-size: 1.6rem;
  background: var(--clr-primary-lt);
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.header-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--clr-text);
  letter-spacing: -.01em;
}
.header-sub {
  font-size: .75rem;
  color: var(--clr-muted);
  margin-top: .05rem;
}

/* ── Progress Bar ── */
.progress-bar-wrap {
  position: sticky;
  top: 69px;
  z-index: 90;
  background: var(--clr-surface);
  padding: .6rem 1.5rem .5rem;
  border-bottom: 1px solid var(--clr-border);
}
.progress-bar-track {
  height: 5px;
  background: var(--clr-border);
  border-radius: 99px;
  overflow: hidden;
  max-width: 900px;
  margin: 0 auto;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--clr-primary), var(--clr-indigo));
  border-radius: 99px;
  transition: width .4s cubic-bezier(.4,0,.2,1);
}
.progress-label {
  max-width: 900px;
  margin: .3rem auto 0;
  font-size: .72rem;
  color: var(--clr-muted);
  text-align: right;
  font-weight: 500;
}

/* ── Container ── */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.5rem 5rem;
}

/* ── Steps ── */
.step { display: none; }
.step.active { display: block; animation: fadeUp .3s ease; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Cards ── */
.step-card {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius);
  padding: 2.5rem;
  box-shadow: var(--shadow);
}

/* ============================================================
   INTRO / LANDING PAGE
   ============================================================ */

/* Hero */
.intro-hero {
  text-align: center;
  padding: 1rem 0 2.5rem;
  border-bottom: 1px solid var(--clr-border);
  margin-bottom: 2.5rem;
}
.intro-hero-icon {
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, var(--clr-primary-lt), #dbeafe);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin: 0 auto 1.25rem;
  box-shadow: 0 4px 12px rgba(37,99,235,.15);
}
.intro-hero h2 {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--clr-text);
  letter-spacing: -.02em;
  margin-bottom: .6rem;
}
.intro-hero p {
  color: var(--clr-text-sec);
  font-size: .95rem;
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.7;
}

/* How it works */
.how-it-works {
  margin-bottom: 2.5rem;
}
.how-it-works h3 {
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--clr-muted);
  margin-bottom: 1rem;
}
.steps-flow {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .75rem;
}
.flow-step {
  background: var(--clr-surface2);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  text-align: center;
  position: relative;
}
.flow-step-num {
  width: 28px;
  height: 28px;
  background: var(--clr-primary);
  color: #fff;
  border-radius: 50%;
  font-size: .75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto .6rem;
}
.flow-step-title {
  font-size: .82rem;
  font-weight: 700;
  color: var(--clr-text);
  margin-bottom: .2rem;
}
.flow-step-sub {
  font-size: .72rem;
  color: var(--clr-muted);
  line-height: 1.4;
}

/* Scoring info */
.scoring-info {
  background: var(--clr-primary-lt);
  border: 1px solid var(--clr-primary-mid);
  border-radius: var(--radius-sm);
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
}
.scoring-info h3 {
  font-size: .82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--clr-primary);
  margin-bottom: .75rem;
}
.scoring-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .75rem;
}
.scoring-item {
  background: var(--clr-surface);
  border-radius: var(--radius-xs);
  padding: .75rem;
  border: 1px solid var(--clr-primary-mid);
}
.scoring-item-label {
  font-size: .72rem;
  font-weight: 700;
  color: var(--clr-primary);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: .2rem;
}
.scoring-item-val {
  font-size: .82rem;
  color: var(--clr-text-sec);
  line-height: 1.4;
}

/* Outcome preview */
.outcome-preview {
  margin-bottom: 2rem;
}
.outcome-preview h3 {
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--clr-muted);
  margin-bottom: .75rem;
}
.outcome-list {
  display: flex;
  flex-direction: column;
  gap: .4rem;
}
.outcome-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .6rem .9rem;
  border-radius: var(--radius-xs);
  font-size: .85rem;
  font-weight: 500;
  border: 1px solid transparent;
}
.outcome-item.red    { background: var(--clr-red-bg);    border-color: var(--clr-red-border);    color: var(--clr-red); }
.outcome-item.yellow { background: var(--clr-yellow-bg); border-color: var(--clr-yellow-border); color: var(--clr-yellow); }
.outcome-item.green  { background: var(--clr-green-bg);  border-color: var(--clr-green-border);  color: var(--clr-green); }
.outcome-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.outcome-item.red    .outcome-dot { background: var(--clr-red); }
.outcome-item.yellow .outcome-dot { background: var(--clr-yellow); }
.outcome-item.green  .outcome-dot { background: var(--clr-green); }

/* App name input section */
.app-name-section {
  background: var(--clr-surface2);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-sm);
  padding: 1.5rem;
}
.app-name-section .form-label {
  font-size: .9rem;
  font-weight: 700;
  color: var(--clr-text);
  margin-bottom: .5rem;
  display: block;
}

/* ── Form Elements ── */
.form-group { margin-bottom: 1.5rem; }
.form-label {
  display: block;
  font-weight: 600;
  margin-bottom: .5rem;
  font-size: .9rem;
  color: var(--clr-text);
}
.form-input {
  width: 100%;
  background: var(--clr-surface);
  border: 1.5px solid var(--clr-border-dark);
  border-radius: var(--radius-sm);
  color: var(--clr-text);
  padding: .8rem 1rem;
  font-size: 1rem;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.form-input:focus {
  border-color: var(--clr-primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.form-input::placeholder { color: var(--clr-muted); }
.field-hint { font-size: .78rem; color: var(--clr-muted); margin-top: .4rem; }

/* ── Step Header ── */
.step-header { margin-bottom: 2rem; }
.step-badge {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  background: var(--clr-primary-lt);
  color: var(--clr-primary);
  font-size: .72rem;
  font-weight: 700;
  padding: .25rem .75rem;
  border-radius: 99px;
  margin-bottom: .75rem;
  letter-spacing: .05em;
  text-transform: uppercase;
  border: 1px solid var(--clr-primary-mid);
}
.step-header h2 {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -.02em;
  margin-bottom: .5rem;
  color: var(--clr-text);
}
.step-desc {
  color: var(--clr-text-sec);
  font-size: .9rem;
  max-width: 600px;
  line-height: 1.65;
}

/* ── Questions Container ── */
.questions-container { display: flex; flex-direction: column; gap: 1.75rem; }

/* ── Question Block ── */
.question-block {}
.question-label {
  font-weight: 700;
  font-size: .95rem;
  margin-bottom: .5rem;
  color: var(--clr-text);
}
.question-hint {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  background: #fefce8;
  border: 1px solid #fef08a;
  border-radius: var(--radius-xs);
  padding: .6rem .9rem;
  font-size: .8rem;
  color: #713f12;
  margin-bottom: .75rem;
  line-height: 1.5;
}
.question-hint .hint-icon { flex-shrink: 0; font-size: .9rem; }

/* Radio Cards */
.radio-cards { display: flex; flex-direction: column; gap: .5rem; }
.radio-card {
  display: flex;
  align-items: flex-start;
  gap: .875rem;
  padding: .9rem 1.1rem;
  background: var(--clr-surface);
  border: 1.5px solid var(--clr-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color .15s, background .15s, box-shadow .15s;
  user-select: none;
}
.radio-card:hover {
  border-color: var(--clr-primary);
  background: var(--clr-primary-lt);
  box-shadow: 0 0 0 3px rgba(37,99,235,.08);
}
.radio-card.selected {
  border-color: var(--clr-primary);
  background: var(--clr-primary-lt);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.radio-card input[type="radio"] { display: none; }
.radio-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--clr-border-dark);
  flex-shrink: 0;
  margin-top: .2rem;
  transition: border-color .15s, background .15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.radio-card.selected .radio-dot {
  border-color: var(--clr-primary);
  background: var(--clr-primary);
}
.radio-card.selected .radio-dot::after {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
}
.radio-card-label { font-weight: 600; font-size: .88rem; color: var(--clr-text); }
.radio-card-desc  { font-size: .78rem; color: var(--clr-text-sec); margin-top: .2rem; line-height: 1.4; }

/* Toggle (Yes/No) */
.toggle-group { display: flex; gap: .5rem; }
.toggle-btn {
  flex: 1;
  padding: .75rem 1rem;
  background: var(--clr-surface);
  border: 1.5px solid var(--clr-border-dark);
  border-radius: var(--radius-sm);
  color: var(--clr-text-sec);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  text-align: center;
}
.toggle-btn:hover { border-color: var(--clr-primary); color: var(--clr-primary); background: var(--clr-primary-lt); }
.toggle-btn.selected-yes {
  border-color: var(--clr-green);
  background: var(--clr-green-bg);
  color: var(--clr-green);
  box-shadow: 0 0 0 3px rgba(22,163,74,.1);
}
.toggle-btn.selected-no {
  border-color: var(--clr-red);
  background: var(--clr-red-bg);
  color: var(--clr-red);
  box-shadow: 0 0 0 3px rgba(220,38,38,.1);
}

/* Conditional sub-question */
.sub-question {
  margin-top: .75rem;
  padding: 1rem 1.25rem;
  background: var(--clr-surface2);
  border: 1px solid var(--clr-border);
  border-left: 3px solid var(--clr-primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  display: none;
}
.sub-question.visible { display: block; animation: fadeUp .2s ease; }

/* ── Navigation Row ── */
.nav-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--clr-border);
}

/* ── Buttons ── */
.btn {
  padding: .7rem 1.5rem;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all .15s;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
}
.btn:active { transform: scale(.97); }
.btn-primary {
  background: var(--clr-primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(37,99,235,.3);
}
.btn-primary:hover { background: var(--clr-primary-h); box-shadow: 0 4px 12px rgba(37,99,235,.35); }
.btn-secondary {
  background: var(--clr-surface);
  color: var(--clr-text-sec);
  border: 1.5px solid var(--clr-border-dark);
}
.btn-secondary:hover { border-color: var(--clr-primary); color: var(--clr-primary); }
.btn-outline {
  background: transparent;
  color: var(--clr-primary);
  border: 1.5px solid var(--clr-primary);
}
.btn-outline:hover { background: var(--clr-primary-lt); }

/* ── Result Card ── */
.result-card {}

/* Result Header */
.result-header {
  padding: 1.75rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.75rem;
  text-align: center;
}
.result-header.level-red    { background: var(--clr-red-bg);    border: 1.5px solid var(--clr-red-border); }
.result-header.level-yellow { background: var(--clr-yellow-bg); border: 1.5px solid var(--clr-yellow-border); }
.result-header.level-green  { background: var(--clr-green-bg);  border: 1.5px solid var(--clr-green-border); }
.result-icon  { font-size: 2.5rem; margin-bottom: .6rem; }
.result-title {
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: .35rem;
  letter-spacing: -.01em;
}
.result-header.level-red    .result-title { color: var(--clr-red); }
.result-header.level-yellow .result-title { color: var(--clr-yellow); }
.result-header.level-green  .result-title { color: var(--clr-green); }
.result-sub   { font-size: .88rem; color: var(--clr-text-sec); }

/* Scores Grid */
.scores-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .75rem;
  margin-bottom: 1.75rem;
}
.score-card {
  background: var(--clr-surface2);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  text-align: center;
}
.score-label { font-size: .7rem; color: var(--clr-muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.score-value { font-size: 1.6rem; font-weight: 800; color: var(--clr-primary); margin: .25rem 0; letter-spacing: -.02em; }
.score-max   { font-size: .72rem; color: var(--clr-muted); }

/* Result Sections */
.result-section { margin-bottom: 1.75rem; }
.result-section h3 {
  font-size: .82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--clr-muted);
  margin-bottom: .875rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--clr-border);
}
.hint-text { font-size: .8rem; color: var(--clr-muted); margin-bottom: .75rem; }

/* Infra notes */
.infra-note {
  background: var(--clr-surface2);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.1rem;
  margin-bottom: .75rem;
}
.infra-note-title { font-weight: 700; font-size: .88rem; margin-bottom: .5rem; color: var(--clr-text); }
.infra-note ul { padding-left: 1.2rem; }
.infra-note li { font-size: .82rem; color: var(--clr-text-sec); margin-bottom: .25rem; }
.infra-note .note-good {
  color: var(--clr-green);
  font-size: .82rem;
  margin-top: .5rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: .35rem;
}
.infra-note .note-warn {
  color: var(--clr-yellow);
  font-size: .82rem;
  margin-top: .5rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: .35rem;
}

/* Baseline list */
.baseline-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .4rem;
}
.baseline-list li {
  display: flex;
  align-items: flex-start;
  gap: .65rem;
  font-size: .85rem;
  padding: .6rem .875rem;
  background: var(--clr-green-bg);
  border: 1px solid var(--clr-green-border);
  border-radius: var(--radius-xs);
  color: var(--clr-text);
  line-height: 1.5;
}
.baseline-list li::before {
  content: '✓';
  color: var(--clr-green);
  font-weight: 700;
  flex-shrink: 0;
  margin-top: .05rem;
}

/* Policy box */
.policy-box {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: var(--radius-sm);
  padding: 1.25rem 1.5rem;
  font-family: 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
  font-size: .78rem;
  color: #86efac;
  white-space: pre-wrap;
  overflow-x: auto;
  line-height: 1.75;
}

/* Export row */
.export-row {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--clr-border);
}

/* ── Validation error ── */
.error-msg {
  color: var(--clr-red);
  font-size: .78rem;
  margin-top: .4rem;
  display: none;
  font-weight: 500;
}
.error-msg.visible { display: flex; align-items: center; gap: .3rem; }
.error-msg.visible::before { content: '⚠'; }

/* ── Divider ── */
.divider {
  height: 1px;
  background: var(--clr-border);
  margin: 2rem 0;
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .container { padding: 1rem 1rem 3rem; }
  .step-card { padding: 1.5rem; }
  .steps-flow { grid-template-columns: repeat(2, 1fr); }
  .scoring-grid { grid-template-columns: 1fr; }
  .scores-grid { grid-template-columns: repeat(2, 1fr); }
  .export-row { flex-direction: column; }
  .export-row .btn { width: 100%; justify-content: center; }
  .header-title { font-size: .9rem; }
  .intro-hero h2 { font-size: 1.4rem; }
}
