@import url('vendor/fonts/fonts.css');

:root {
  /* Design tokens copied from https://ot-security-universe.vercel.app/ (src/index.css) */
  --bg: hsl(258 50% 97%);          /* #f7f5fc */
  --surface: #ffffff;
  --text: hsl(261 61% 11%);        /* #170b2e */
  --muted: hsl(259 13% 51%);       /* #7b7191 */
  --border: hsl(259 40% 90%);      /* #e0d9f0 */
  --primary: hsl(267 49% 51%);     /* #7c46c0 */
  --primary-foreground: #ffffff;
  --accent: hsl(260 89% 68%);      /* #9766f6 */
  --secondary: hsl(259 44% 93%);   /* #eae5f5 */
  --destructive: hsl(0 72% 51%);
  --warning: hsl(37 92% 44%);      /* #d97706 */
  --radius: 0.625rem;
  --font-sans: 'Manrope', 'Inter', sans-serif;

  font-size: 16px;
}

* { box-sizing: border-box; }

[x-cloak] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  color: var(--text);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

body {
  background: var(--bg);
}

body.screen-questions {
  background:
    linear-gradient(180deg, hsl(36 45% 8% / .62), hsl(36 40% 10% / .78)),
    url('assets/backgrounds/background.webp') center / cover no-repeat fixed;
}

.app-shell {
  max-width: 760px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  box-shadow: 0 0 60px -10px rgb(0 0 0 / .45);
}

@media (max-width: 760px) {
  body.screen-questions { background-attachment: scroll; }
}

h1, h2, h3 {
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 .5rem;
}

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

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1rem 3rem;
}

/* ─── Header ─────────────────────────────────────────────────── */
.app-header {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 1.25rem 1rem .5rem;
  max-width: 720px;
  margin: 0 auto;
}
.app-header img { height: 32px; width: auto; }

.q-fixed-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: .75rem;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 1rem;
}
.q-fixed-header img { height: 28px; width: auto; flex: none; }
.q-fixed-title {
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--text);
}

/* ─── Cards / surfaces ───────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

/* ─── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 1rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  padding: .75rem 1.5rem;
  cursor: pointer;
  transition: box-shadow .2s ease, transform .2s ease, opacity .2s ease;
}
.btn-primary {
  background: var(--primary);
  color: var(--primary-foreground);
}
.btn-primary:hover:not(:disabled) {
  box-shadow: 0 6px 24px -6px hsl(267 49% 51% / .55);
}
.btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}
.btn:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* ─── Forms ──────────────────────────────────────────────────── */
label {
  display: block;
  font-weight: 600;
  font-size: .9rem;
  margin-bottom: .35rem;
}
.field { margin-bottom: 1.25rem; }
select, input[type="email"] {
  width: 100%;
  font-family: var(--font-sans);
  font-size: 1rem;
  padding: .7rem .85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
}
select:focus, input:focus {
  outline: 3px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--primary);
}
.field-error {
  color: var(--destructive);
  font-size: .85rem;
  margin-top: .35rem;
}
.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  margin: 1.25rem 0;
}
.checkbox-row input[type="checkbox"] {
  margin-top: .2rem;
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--primary);
}

/* ─── Progress bar ───────────────────────────────────────────── */
.progress-text {
  font-size: .85rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: .35rem;
}
.progress-track {
  height: 8px;
  border-radius: 999px;
  background: var(--secondary);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width .2s ease;
}

/* ─── Questionnaire ──────────────────────────────────────────── */
.q-progress {
  display: flex;
  align-items: center;
  gap: .85rem;
  padding-top: 1.25rem;
  margin-bottom: 1rem;
}
.q-progress .progress-text { margin-bottom: 0; white-space: nowrap; }
.q-progress .progress-track { flex: 1; }
.q-progress-autosaved {
  font-size: .78rem;
  color: var(--muted);
  white-space: nowrap;
}

.question-viewport {
  overflow: hidden;
}
.question-track {
  display: flex;
  transition: transform .4s cubic-bezier(.4, 0, .2, 1);
}
.question-slide {
  flex: 0 0 100%;
  min-width: 0;
  padding: .1rem;
}

.question-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.25rem 1.5rem;
  box-shadow: 0 1px 3px rgb(0 0 0 / .04);
}

.domain-badge {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 .7rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: none;
  color: var(--muted);
  font-size: .75rem;
  font-weight: 600;
  margin-bottom: .9rem;
}
.question-title-row {
  display: flex;
  align-items: baseline;
  gap: .4rem;
  margin-bottom: .9rem;
}
.question-title { font-size: 1.05rem; font-weight: 600; }

button.info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.3rem;
  height: 1.3rem;
  min-width: 1.3rem;
  border-radius: 50%;
  border: 1px solid var(--primary);
  background: var(--secondary);
  color: var(--primary);
  font-size: .75rem;
  font-weight: 700;
  font-style: italic;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  position: relative;
}
button.info:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.info-popover {
  position: absolute;
  z-index: 20;
  top: 1.6rem;
  left: 0;
  max-width: 320px;
  width: max-content;
  background: var(--text);
  color: #fff;
  font-size: .85rem;
  font-weight: 400;
  line-height: 1.4;
  padding: .6rem .75rem;
  border-radius: calc(var(--radius) - 2px);
  box-shadow: 0 10px 30px -8px rgb(0 0 0 / .35);
}

.choice-list {
  display: flex;
  flex-direction: column;
  gap: .6rem;
}
.choice-card {
  display: block;
  position: relative;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: .85rem 1rem .85rem 2.6rem;
  cursor: pointer;
  font-size: .92rem;
  line-height: 1.4;
  transition: border-color .15s ease, background .15s ease;
}
.choice-card:hover { border-color: var(--accent); }
.choice-card input[type="radio"] {
  position: absolute;
  left: 1rem;
  top: 1rem;
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--primary);
}
.choice-card.selected {
  border-color: var(--primary);
  background: var(--secondary);
}
.choice-card:focus-within { outline: 3px solid var(--accent); outline-offset: 1px; }

.choice-label {
  display: block;
  font-weight: 700;
  font-size: .98rem;
}
.choice-desc {
  display: block;
  color: var(--muted);
  font-size: .85rem;
  margin-top: .2rem;
}
.choice-card.selected .choice-label { color: var(--primary); }

.q-nav-row {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: .75rem;
}
.q-nav-spacer { flex: 1; }
.btn-ghost {
  background: none;
  color: var(--muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover:not(:disabled) { color: var(--text); border-color: var(--accent); }
.btn-text {
  background: none;
  border: none;
  color: var(--muted);
  padding: .75rem .5rem;
}
.btn-text:hover:not(:disabled) { color: var(--text); }

/* ─── Result ─────────────────────────────────────────────────── */
.result-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem;
  text-align: center;
}
.stat-value { font-size: 1.9rem; font-weight: 800; color: var(--primary); }
.stat-label { font-size: .8rem; color: var(--muted); margin-top: .2rem; }

.radar-wrap { max-width: 480px; margin: 0 auto 1.5rem; }

table.theme-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .88rem;
  margin-bottom: 1.5rem;
}
table.theme-table th, table.theme-table td {
  text-align: left;
  padding: .55rem .6rem;
  border-bottom: 1px solid var(--border);
}
table.theme-table th { color: var(--muted); font-weight: 600; }

.unknown-banner {
  background: var(--secondary);
  border-radius: var(--radius);
  padding: .8rem 1rem;
  font-size: .9rem;
  margin-bottom: 1.5rem;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ─── Responsive ─────────────────────────────────────────────── */
@media (max-width: 480px) {
  .result-summary { grid-template-columns: 1fr; }
  .card { padding: 1.1rem; }

  .q-fixed-header { padding: .85rem; gap: .5rem; }
  .q-fixed-title { font-size: .85rem; }

  .q-nav-row { flex-direction: column; align-items: stretch; gap: .6rem; }
  .q-nav-row .btn { width: 100%; }
  .q-nav-spacer { display: none; }
}
