/* =====================================================================
   KYBORG INTERACTIVE POLL - styles
   Brand palette from kyborg.ai
   ===================================================================== */

:root {
  --bg-dark:    #2a353e;
  --bg-darker:  #1e2a32;
  --bg-section: #33404b;
  --bg-card:    #3a4854;
  --green:      #a0f000;
  --green-dark: #73ae00;
  --green-soft: rgba(160, 240, 0, 0.12);
  --white:      #ffffff;
  --text-light: #b8c4cc;
  --text-mute:  #8a96a0;
  --border:     rgba(255,255,255,0.08);
  --font-head:  'Cabin', Arial, sans-serif;
  --font-body:  'Lato', Arial, sans-serif;
}

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

html, body {
  background: var(--bg-dark);
  color: var(--white);
  font-family: var(--font-body);
  line-height: 1.55;
  font-size: 16px;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }

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

/* ---------- Header ---------- */
.kb-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: var(--bg-darker);
  border-bottom: 1px solid var(--border);
}
.kb-header__logo {
  display: flex;
  align-items: center;
  gap: 12px;
}
.kb-header__logo img { height: 36px; width: auto; }
.kb-header__tag {
  font-family: var(--font-head);
  font-size: 14px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-light);
}
.kb-header__code {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 18px;
  color: var(--green);
  letter-spacing: 0.15em;
}

/* ---------- Layout ---------- */
.kb-container {
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 20px 64px;
}
.kb-container--wide {
  max-width: 1280px;
}

/* ---------- Typography ---------- */
h1, h2, h3 {
  font-family: var(--font-head);
  font-weight: 700;
  line-height: 1.2;
  color: var(--white);
}
h1 { font-size: clamp(28px, 4vw, 44px); margin-bottom: 12px; }
h2 { font-size: clamp(22px, 2.6vw, 30px); margin-bottom: 12px; }
h3 { font-size: 18px; margin-bottom: 8px; }

.kb-eyebrow {
  font-family: var(--font-head);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 12px;
}
.kb-muted { color: var(--text-light); }

/* ---------- Cards ---------- */
.kb-card {
  background: var(--bg-section);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
}
.kb-card--accent {
  border-left: 4px solid var(--green);
}

/* ---------- Buttons ---------- */
.kb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  background: var(--green);
  color: var(--bg-darker);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, transform 0.05s;
  width: 100%;
}
.kb-btn:hover  { background: var(--green-dark); color: var(--white); }
.kb-btn:active { transform: translateY(1px); }
.kb-btn:disabled {
  background: var(--bg-card);
  color: var(--text-mute);
  cursor: not-allowed;
}
.kb-btn--ghost {
  background: transparent;
  color: var(--white);
  border: 2px solid var(--white);
}
.kb-btn--ghost:hover {
  background: var(--white);
  color: var(--bg-darker);
}
.kb-btn--inline { width: auto; padding: 10px 18px; font-size: 14px; }

/* ---------- Forms ---------- */
.kb-input {
  width: 100%;
  padding: 14px 16px;
  background: var(--bg-darker);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--white);
  font-family: var(--font-body);
  font-size: 18px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  text-align: center;
}
.kb-input:focus {
  outline: none;
  border-color: var(--green);
}

/* ---------- Choice list ---------- */
.kb-choice-list { display: flex; flex-direction: column; gap: 10px; }
.kb-choice {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: var(--bg-darker);
  border: 2px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  user-select: none;
}
.kb-choice:hover { border-color: var(--green-dark); }
.kb-choice.is-selected {
  border-color: var(--green);
  background: var(--green-soft);
}
.kb-choice__box {
  width: 22px; height: 22px;
  border: 2px solid var(--text-mute);
  border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  background: transparent;
}
.kb-choice.is-selected .kb-choice__box {
  border-color: var(--green);
  background: var(--green);
}
.kb-choice.is-selected .kb-choice__box::after {
  content: "";
  width: 6px; height: 11px;
  border: solid var(--bg-darker);
  border-width: 0 3px 3px 0;
  transform: rotate(45deg);
  margin-top: -3px;
}

/* Radio variant (for single-select) */
.kb-choice--radio .kb-choice__box { border-radius: 50%; }
.kb-choice--radio.is-selected .kb-choice__box::after {
  content: "";
  width: 10px; height: 10px;
  border: none;
  background: var(--bg-darker);
  border-radius: 50%;
  transform: none;
  margin: 0;
}
.kb-choice__label {
  font-size: 16px;
  color: var(--white);
}

/* Rating buttons */
.kb-rating {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-top: 12px;
}
.kb-rating--ten { grid-template-columns: repeat(5, 1fr); }
.kb-rating-btn {
  padding: 16px 0;
  background: var(--bg-darker);
  border: 2px solid transparent;
  border-radius: 8px;
  color: var(--white);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 18px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.kb-rating-btn:hover { border-color: var(--green-dark); }
.kb-rating-btn.is-selected {
  border-color: var(--green);
  background: var(--green-soft);
  color: var(--green);
}
.kb-rating__labels {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  color: var(--text-mute);
  font-size: 12px;
}

/* ---------- Progress ---------- */
.kb-progress {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
}
.kb-progress__step {
  flex: 1;
  height: 4px;
  background: var(--bg-card);
  border-radius: 2px;
}
.kb-progress__step.is-done { background: var(--green-dark); }
.kb-progress__step.is-current { background: var(--green); }

/* ---------- Bar chart (results) ---------- */
.kb-bars { display: flex; flex-direction: column; gap: 12px; }
.kb-bar-row { display: flex; flex-direction: column; gap: 6px; }
.kb-bar-row__head {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: var(--text-light);
}
.kb-bar-row__label { color: var(--white); }
.kb-bar-row__count { color: var(--green); font-weight: 700; }
.kb-bar-row__track {
  height: 14px;
  background: var(--bg-darker);
  border-radius: 7px;
  overflow: hidden;
}
.kb-bar-row__fill {
  height: 100%;
  background: linear-gradient(to right, var(--green-dark), var(--green));
  border-radius: 7px;
  transition: width 0.5s ease;
  min-width: 0;
}

/* Presenter mode: bigger bars */
.kb-bars--big .kb-bar-row__head { font-size: 22px; }
.kb-bars--big .kb-bar-row__track { height: 32px; border-radius: 16px; }
.kb-bars--big .kb-bar-row__fill { border-radius: 16px; }

/* ---------- Presenter layout ---------- */
.kb-stage {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 32px;
  align-items: start;
}
.kb-stage__main { min-width: 0; }
.kb-stage__side { display: flex; flex-direction: column; gap: 16px; }
.kb-question-big {
  font-family: var(--font-head);
  font-size: clamp(28px, 3.2vw, 44px);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 24px;
}
.kb-meta-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.kb-pill {
  padding: 6px 14px;
  background: var(--green-soft);
  color: var(--green);
  border-radius: 999px;
  font-family: var(--font-head);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.kb-pill--mute {
  background: var(--bg-card);
  color: var(--text-light);
}

/* QR card */
.kb-qr-card { text-align: center; }
.kb-qr-card img {
  margin: 8px auto 12px;
  background: var(--white);
  padding: 10px;
  border-radius: 8px;
  max-width: 260px;
}
.kb-qr-card .kb-code {
  font-family: var(--font-head);
  font-size: 42px;
  font-weight: 700;
  color: var(--green);
  letter-spacing: 0.25em;
  margin-top: 8px;
}
.kb-qr-card .kb-url {
  color: var(--text-light);
  font-size: 14px;
  word-break: break-all;
  margin-top: 4px;
}

/* Controls */
.kb-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.kb-controls .kb-btn { padding: 12px; font-size: 14px; }

/* Big rating distribution */
.kb-rating-dist {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 8px;
  align-items: end;
  height: 280px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.kb-rating-dist--five { grid-template-columns: repeat(5, 1fr); }
.kb-rating-dist__col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  height: 100%;
}
.kb-rating-dist__bar {
  width: 100%;
  background: linear-gradient(to top, var(--green-dark), var(--green));
  border-radius: 6px 6px 0 0;
  transition: height 0.5s ease;
  min-height: 4px;
}
.kb-rating-dist__num {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 16px;
  color: var(--text-light);
}
.kb-rating-dist__count {
  font-size: 13px;
  color: var(--green);
  font-weight: 700;
}

.kb-stats {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.kb-stat__label {
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-mute);
}
.kb-stat__value {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 28px;
  color: var(--white);
}
.kb-stat__value--green { color: var(--green); }

/* ---------- Status ---------- */
.kb-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-darker);
  color: var(--white);
  padding: 12px 20px;
  border-radius: 8px;
  border: 1px solid var(--green);
  font-size: 14px;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
  z-index: 100;
}
.kb-toast.is-visible { opacity: 1; }

.kb-empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-mute);
  font-size: 18px;
}

/* ---------- Footer ---------- */
.kb-footer {
  text-align: center;
  padding: 24px;
  color: var(--text-mute);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ---------- Mobile tweaks ---------- */
@media (max-width: 768px) {
  .kb-stage {
    grid-template-columns: 1fr;
  }
  .kb-rating { grid-template-columns: repeat(5, 1fr); }
  .kb-rating--ten { grid-template-columns: repeat(5, 1fr); }
  .kb-header { padding: 12px 16px; }
  .kb-container { padding: 20px 16px 48px; }
  .kb-card { padding: 18px; }
}

@media (max-width: 420px) {
  .kb-rating-btn { font-size: 16px; padding: 12px 0; }
}
