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

:root {
  --brand:       #f59e0b;
  --brand-dk:    #d97706;
  --dark:        #0f172a;
  --dark-2:      #1e293b;
  --bg:          #f1f5f9;
  --surface:     #ffffff;
  --border:      #e2e8f0;
  --text:        #0f172a;
  --muted:       #64748b;
  --light-muted: #94a3b8;

  --high:        #dc2626;
  --high-bg:     #fef2f2;
  --high-border: #fca5a5;
  --high-glow:   rgba(220,38,38,.12);

  --medium:      #d97706;
  --medium-bg:   #fffbeb;
  --medium-border:#fcd34d;
  --medium-glow: rgba(217,119,6,.12);

  --low:         #16a34a;
  --low-bg:      #f0fdf4;
  --low-border:  #86efac;
  --low-glow:    rgba(22,163,74,.12);

  --radius:      1rem;
  --radius-sm:   .5rem;
  --shadow-sm:   0 1px 2px rgba(0,0,0,.06);
  --shadow:      0 4px 6px -1px rgba(0,0,0,.07), 0 2px 4px -2px rgba(0,0,0,.05);
  --shadow-lg:   0 10px 15px -3px rgba(0,0,0,.08), 0 4px 6px -4px rgba(0,0,0,.05);
}

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

/* ── Top navigation bar ────────────────────────────────────── */
.navbar {
  background: var(--dark);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 0 rgba(255,255,255,.06);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: .5rem;
  text-decoration: none;
}
.nav-logo-mark {
  width: 32px; height: 32px;
  background: var(--brand);
  border-radius: .4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: .85rem;
  color: var(--dark);
  letter-spacing: -.02em;
  flex-shrink: 0;
}
.nav-logo-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -.01em;
}
.nav-logo-name span { color: var(--brand); }

.nav-badge {
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .06em;
  color: var(--light-muted);
  text-transform: uppercase;
}

/* ── Hero section (index only) ─────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--dark) 0%, var(--dark-2) 100%);
  padding: 4rem 2rem 3rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 100%, rgba(245,158,11,.08) 0%, transparent 65%);
  pointer-events: none;
}
.hero-title {
  font-size: clamp(1.75rem, 5vw, 2.75rem);
  font-weight: 800;
  color: #fff;
  letter-spacing: -.03em;
  margin-bottom: .75rem;
  line-height: 1.15;
}
.hero-title em {
  font-style: normal;
  color: var(--brand);
}
.hero-sub {
  font-size: 1rem;
  color: var(--light-muted);
  max-width: 460px;
  margin: 0 auto;
}

/* ── Page wrapper ──────────────────────────────────────────── */
.page {
  max-width: 780px;
  margin: 0 auto;
  padding: 2rem 1.25rem 5rem;
}

/* ── Card ──────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.25rem;
}
.card-title {
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.25rem;
}

/* ── Form ──────────────────────────────────────────────────── */
.form-card { margin-top: -2.5rem; position: relative; z-index: 1; }

.field { margin-bottom: 1.25rem; }
.field > label {
  display: block;
  font-size: .82rem;
  font-weight: 600;
  margin-bottom: .45rem;
  color: var(--text);
}

textarea {
  width: 100%;
  padding: .85rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .95rem;
  font-family: inherit;
  resize: vertical;
  min-height: 120px;
  background: var(--bg);
  color: var(--text);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
textarea:focus {
  outline: none;
  border-color: var(--brand);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(245,158,11,.15);
}
textarea::placeholder { color: var(--light-muted); }

.type-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.type-row label:first-child {
  font-size: .82rem;
  font-weight: 600;
  color: var(--muted);
  flex-shrink: 0;
}
.radio-group { display: flex; gap: .6rem; flex-wrap: wrap; }
.radio-pill {
  display: flex;
  align-items: center;
  gap: .35rem;
  padding: .3rem .85rem;
  border: 1.5px solid var(--border);
  border-radius: 2rem;
  cursor: pointer;
  font-size: .82rem;
  font-weight: 500;
  transition: all .15s;
  color: var(--muted);
  background: var(--surface);
  user-select: none;
}
.radio-pill input { display: none; }
.radio-pill:has(input:checked) {
  border-color: var(--brand);
  color: var(--brand-dk);
  background: #fffbeb;
}

/* ── Button ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .75rem 2rem;
  border-radius: var(--radius-sm);
  font-size: .95rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all .15s;
  letter-spacing: .01em;
}
.btn:active { transform: scale(.98); }
.btn-primary {
  background: var(--brand);
  color: var(--dark);
  width: 100%;
}
.btn-primary:hover { background: var(--brand-dk); }
.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--border);
  width: auto;
}
.btn-outline:hover { border-color: var(--brand); color: var(--brand-dk); }

/* ── Alert ─────────────────────────────────────────────────── */
.alert {
  padding: .75rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.25rem;
  font-size: .875rem;
  border: 1px solid;
}
.alert-error {
  background: var(--high-bg);
  border-color: var(--high-border);
  color: var(--high);
}

/* ── Examples ──────────────────────────────────────────────── */
.examples-section { margin-top: 1.75rem; }
.examples-label {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--light-muted);
  margin-bottom: .75rem;
}
.example-grid { display: flex; flex-wrap: wrap; gap: .5rem; }
.example-chip {
  display: flex;
  align-items: center;
  gap: .4rem;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 2rem;
  padding: .4rem 1rem;
  font-size: .8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
  color: var(--text);
}
.example-chip:hover {
  border-color: var(--brand);
  color: var(--brand-dk);
  background: #fffbeb;
}
.chip-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.chip-danger .chip-dot { background: var(--high); }
.chip-safe   .chip-dot { background: var(--low); }

/* ════════════════════════════════════════════════════════════ */
/*  RESULT PAGE                                                */
/* ════════════════════════════════════════════════════════════ */

/* ── Verdict hero ──────────────────────────────────────────── */
.verdict-hero {
  border-radius: var(--radius);
  padding: 2rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  border: 1px solid;
  position: relative;
  overflow: hidden;
}
.verdict-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: .6;
  pointer-events: none;
}
.verdict-hero.high   { background: var(--high-bg);   border-color: var(--high-border);   box-shadow: 0 0 0 4px var(--high-glow); }
.verdict-hero.medium { background: var(--medium-bg); border-color: var(--medium-border); box-shadow: 0 0 0 4px var(--medium-glow); }
.verdict-hero.low    { background: var(--low-bg);    border-color: var(--low-border);    box-shadow: 0 0 0 4px var(--low-glow); }

/* Circular gauge */
.gauge-wrap { flex-shrink: 0; position: relative; width: 90px; height: 90px; }
.gauge-wrap svg { width: 90px; height: 90px; transform: rotate(-90deg); }
.gauge-bg { fill: none; stroke: rgba(0,0,0,.06); stroke-width: 8; }
.gauge-fill {
  fill: none;
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset .8s cubic-bezier(.4,0,.2,1);
}
.high   .gauge-fill { stroke: var(--high);   }
.medium .gauge-fill { stroke: var(--medium); }
.low    .gauge-fill { stroke: var(--low);    }
.gauge-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.gauge-number { font-size: 1.4rem; font-weight: 800; }
.gauge-pct    { font-size: .65rem; font-weight: 600; color: var(--muted); margin-top: 1px; }
.high   .gauge-number { color: var(--high);   }
.medium .gauge-number { color: var(--medium); }
.low    .gauge-number { color: var(--low);    }

.verdict-info { flex: 1; }
.verdict-label {
  font-size: 1.6rem;
  font-weight: 900;
  letter-spacing: -.02em;
  line-height: 1;
  display: block;
  margin-bottom: .3rem;
}
.high   .verdict-label { color: var(--high);   }
.medium .verdict-label { color: var(--medium); }
.low    .verdict-label { color: var(--low);    }
.verdict-risk {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  padding: .2rem .6rem;
  border-radius: 2rem;
  border: 1px solid;
}
.high   .verdict-risk { color: var(--high);   background: var(--high-bg);   border-color: var(--high-border);   }
.medium .verdict-risk { color: var(--medium); background: var(--medium-bg); border-color: var(--medium-border); }
.low    .verdict-risk { color: var(--low);    background: var(--low-bg);    border-color: var(--low-border);    }
.verdict-type-badge {
  display: inline-block;
  margin-left: .4rem;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .05em;
  color: var(--muted);
  background: rgba(0,0,0,.05);
  padding: .15rem .5rem;
  border-radius: 2rem;
}

/* ── Two column ────────────────────────────────────────────── */
.two-col { display: grid; gap: 1.25rem; grid-template-columns: 1fr 1fr; }
@media (max-width: 600px) { .two-col { grid-template-columns: 1fr; } }

/* ── Triggers ──────────────────────────────────────────────── */
.trigger-list { list-style: none; display: flex; flex-direction: column; gap: .5rem; }
.trigger-item {
  display: flex;
  align-items: flex-start;
  gap: .65rem;
  font-size: .875rem;
  color: var(--text);
  padding: .5rem .65rem;
  border-radius: .4rem;
  background: var(--bg);
}
.trigger-item::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: .45rem;
}
.trigger-high   .trigger-item::before { background: var(--high);   }
.trigger-medium .trigger-item::before { background: var(--medium); }
.trigger-low    .trigger-item::before { background: var(--low);    }

/* ── Input preview ─────────────────────────────────────────── */
.meta-row {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-bottom: .75rem;
  font-size: .82rem;
}
.meta-key { color: var(--muted); font-weight: 500; min-width: 3.5rem; }
.meta-val {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: .3rem;
  padding: .1rem .5rem;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--text);
}
.input-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .75rem;
  font-size: .82rem;
  color: var(--muted);
  word-break: break-all;
  max-height: 90px;
  overflow-y: auto;
  line-height: 1.5;
}

/* ── Advice ────────────────────────────────────────────────── */
.advice-card { margin-bottom: 1.25rem; }
.advice-high   { border-color: var(--high-border);   background: var(--high-bg);   }
.advice-medium { border-color: var(--medium-border); background: var(--medium-bg); }
.advice-low    { border-color: var(--low-border);    background: var(--low-bg);    }
.advice-list { list-style: none; display: flex; flex-direction: column; gap: .5rem; }
.advice-list li {
  font-size: .875rem;
  padding-left: 1.2rem;
  position: relative;
}
.advice-list li::before {
  content: '›';
  position: absolute;
  left: 0;
  font-weight: 900;
  color: inherit;
}
.advice-high   .advice-list li::before { color: var(--high);   }
.advice-medium .advice-list li::before { color: var(--medium); }

/* ── Actions ───────────────────────────────────────────────── */
.actions { display: flex; gap: .75rem; justify-content: center; margin-top: 1.5rem; }

/* ── Muted ─────────────────────────────────────────────────── */
.muted { color: var(--muted); font-size: .875rem; }

/* ── Footer ────────────────────────────────────────────────── */
.site-footer {
  text-align: center;
  color: var(--light-muted);
  font-size: .75rem;
  margin-top: 3.5rem;
  padding-bottom: 1rem;
}
