/* RRZ AI Policy Builder - app styles
   Violet / teal / amber system to match the workshop deck. */

:root {
  --violet: #6d28d9;
  --violet-deep: #3b1f6e;
  --violet-ink: #241443;
  --teal: #0ea5a4;
  --amber: #f59e0b;
  --paper: #faf9fc;
  --card: #ffffff;
  --ink: #241443;
  --muted: #6f6a80;
  --line: #e7e3f2;
  --radius: 14px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.55;
}

.wrap { max-width: 1040px; margin: 0 auto; padding: 0 20px; }

/* top bar */
.topbar { background: var(--violet-ink); color: #fff; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  display: inline-grid; place-items: center;
  width: 40px; height: 40px; border-radius: 10px;
  background: linear-gradient(135deg, var(--violet), var(--teal));
  font-weight: 800; letter-spacing: .5px;
}
.brand small { display: block; opacity: .7; font-size: 12px; }
.topbar nav a { color: #fff; opacity: .85; text-decoration: none; margin-left: 18px; font-size: 14px; }
.topbar nav a.on, .topbar nav a:hover { opacity: 1; }

main { padding: 28px 20px 60px; }

/* cards and layout */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 22px;
  box-shadow: 0 1px 3px rgba(36, 20, 67, .05);
}
.card.narrow { max-width: 480px; margin: 60px auto; }
.grid-2 { display: grid; grid-template-columns: 1fr 1.3fr; gap: 22px; }
@media (max-width: 860px) { .grid-2 { grid-template-columns: 1fr; } }

h1 { font-size: 26px; margin: 0 0 10px; }
h2 { font-size: 19px; margin: 0 0 8px; }
h3 { font-size: 15px; margin: 18px 0 6px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.muted { color: var(--muted); }

/* forms */
label { display: block; font-weight: 600; font-size: 14px; margin: 14px 0 4px; }
input[type=text], input[type=password], textarea {
  width: 100%; padding: 10px 12px; font-size: 15px;
  border: 1px solid var(--line); border-radius: 8px;
  font-family: inherit; background: #fff; color: var(--ink);
}
input:focus, textarea:focus, .choice:focus { outline: 2px solid var(--teal); outline-offset: 1px; }

.btn {
  display: inline-block; margin-top: 14px;
  background: var(--violet); color: #fff;
  border: none; border-radius: 8px;
  padding: 10px 20px; font-size: 15px; font-weight: 600;
  cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--violet-deep); }
.btn.ghost { background: transparent; color: var(--violet); border: 1.5px solid var(--violet); }
.btn.big { font-size: 17px; padding: 14px 30px; }

.error { color: #b3261e; font-weight: 600; }
.notice {
  background: #ecfdf5; border: 1px solid #99e6d0; color: #065f46;
  border-radius: 8px; padding: 10px 14px; font-size: 14px;
}
.codeblock {
  background: var(--violet-ink); color: #d9f5f0;
  padding: 14px; border-radius: 8px; overflow-x: auto;
  font-size: 12.5px; user-select: all;
}

/* lists, pills */
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 9px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: none; }
.pill {
  display: inline-block; font-size: 11px; font-weight: 700;
  padding: 2px 9px; border-radius: 999px; margin-left: 8px;
  background: #f1eefa; color: var(--violet);
}
.pill.ok { background: #e0f6f2; color: var(--teal); }
.copy { width: 100%; margin-top: 6px; font-size: 12px; color: var(--muted); }
.logo-preview { max-height: 64px; max-width: 220px; }

/* wizard */
.wizard-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 14px; }
.progress { height: 8px; background: var(--line); border-radius: 999px; margin-bottom: 26px; overflow: hidden; }
.progress-fill {
  height: 100%; width: 0;
  background: linear-gradient(90deg, var(--violet), var(--teal));
  transition: width .35s ease;
}
.qsection h2 { color: var(--violet-deep); }
.q { margin: 20px 0 6px; }
.qlabel { font-size: 15px; }
.help { font-size: 13px; color: var(--muted); margin: 2px 0 8px; }
.who { display: block; font-size: 11.5px; color: var(--teal); margin-top: 5px; min-height: 14px; }

.choices { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.choice {
  background: #fff; border: 1.5px solid var(--line); color: var(--ink);
  border-radius: 999px; padding: 8px 16px; font-size: 14px;
  cursor: pointer; font-family: inherit; transition: all .12s ease;
}
.choice:hover { border-color: var(--violet); }
.choice.on {
  background: var(--violet); border-color: var(--violet); color: #fff;
  box-shadow: 0 2px 8px rgba(109, 40, 217, .3);
}
.choices.multi .choice.on { background: var(--teal); border-color: var(--teal); }

.cta { text-align: center; border: 2px solid var(--amber); }

.foot { padding: 18px 20px 40px; color: var(--muted); font-size: 12.5px; }

/* ============ v2: Session Studio additions ============ */

.brand-logo { height: 40px; max-width: 160px; object-fit: contain; }

.row { display: flex; gap: 14px; }
.row > label { flex: 1; }
select { width: 100%; padding: 10px 12px; font-size: 15px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); font-family: inherit; }

.big-pill { font-size: 15px; padding: 6px 14px; letter-spacing: .15em; }
.linkbtn { background: none; border: none; color: #b3261e; cursor: pointer; font-size: 12px; text-decoration: underline; padding: 0 4px; }
.minibtn { border: 1.5px solid var(--line); background: #fff; border-radius: 7px; padding: 4px 12px; font-size: 12.5px; cursor: pointer; font-family: inherit; }
.minibtn.go { border-color: var(--teal); color: var(--teal); font-weight: 700; }
.minibtn:hover { border-color: var(--violet); }
.rowbtns { float: right; display: inline-flex; gap: 6px; }
.status-pill[data-status="active"] { background: #e0f6f2; color: var(--teal); }
.status-pill[data-status="closed"] { background: #f4f0e6; color: #92610a; }
.count:empty { display: none; }

.control-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 16px; flex-wrap: wrap; }
.control-links { display: flex; gap: 10px; }
.switch-row { display: flex; align-items: center; gap: 10px; font-weight: 500; font-size: 14px; margin: 10px 0; cursor: pointer; }
.switch-row input { width: 20px; height: 20px; accent-color: var(--teal); }
.unlock-row { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 10px; }

/* join page */
.join-card { text-align: center; }
.join-kicker { font-size: 11px; font-weight: 800; letter-spacing: .28em; color: var(--teal); text-transform: uppercase; margin: 0 0 4px; }
.join-card form { text-align: left; }

/* participant hub */
.phone-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 16px; }
.poll-card { border: 2px solid var(--teal); }
.scale-choice { min-width: 52px; text-align: center; font-size: 18px; font-weight: 700; }

/* ============ big screen ============ */
.screen-wrap { display: flex; flex-direction: column; height: 100vh; padding: 34px 54px; }
.screen-top { display: flex; justify-content: space-between; align-items: center; font-family: "Segoe UI", system-ui, sans-serif; }
.screen-brand { display: flex; align-items: center; gap: 16px; font-size: 20px; font-weight: 600; opacity: .95; }
.screen-logo { height: 44px; }
.screen-joined { font-size: 18px; opacity: .8; }
.screen-joined span { font-weight: 800; color: #F59E0B; font-size: 24px; }

.screen-stage { flex: 1; display: flex; flex-direction: column; justify-content: center; }

.join-panel { display: flex; align-items: center; gap: 70px; justify-content: center; }
.qr-box { background: #fff; border-radius: 22px; padding: 22px; box-shadow: 0 12px 50px rgba(0,0,0,.35); }
.qr-box img { display: block; width: 380px; height: 380px; }
.qr-box .qr-fallback { display: none; }
.qr-box.qr-failed img { display: none; }
.qr-box.qr-failed { width: 380px; height: 380px; display: grid; place-items: center; }
.qr-box.qr-failed .qr-fallback { display: block; color: #241443; font: 700 24px/1.5 "Segoe UI", sans-serif; text-align: center; }
.join-info h1 { font-family: "Segoe UI", system-ui, sans-serif; font-size: 52px; line-height: 1.15; margin: 8px 0 22px; max-width: 620px; }
.join-eyebrow { font: 800 15px "Segoe UI", sans-serif; letter-spacing: .35em; color: #0EA5A4; margin: 0; }
.join-url { font: 600 26px "Segoe UI", sans-serif; color: #F59E0B; margin: 0 0 26px; word-break: break-all; }
.join-code-label { font: 500 15px "Segoe UI", sans-serif; opacity: .7; margin: 0 0 4px; }
.join-code { font: 800 64px/1 "Segoe UI", sans-serif; letter-spacing: .3em; margin: 0; }

.poll-eyebrow { font: 800 16px "Segoe UI", sans-serif; letter-spacing: .3em; color: #0EA5A4; }
.poll-eyebrow span { color: #F59E0B; }
.poll-question { font-family: "Segoe UI", system-ui, sans-serif; font-size: 54px; line-height: 1.15; margin: 6px 0 42px; max-width: 1200px; }

.poll-bars { display: flex; flex-direction: column; gap: 20px; max-width: 1200px; }
.bar-row { display: grid; grid-template-columns: 320px 1fr 80px; align-items: center; gap: 22px; font-family: "Segoe UI", sans-serif; }
.bar-label { font-size: 24px; font-weight: 600; text-align: right; }
.bar-track { background: rgba(255,255,255,.14); border-radius: 999px; height: 44px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; transition: width .6s cubic-bezier(.2,.8,.2,1); min-width: 6px; }
.bar-n { font-size: 26px; font-weight: 800; }
.scale-bars .bar-row { grid-template-columns: 60px 1fr 80px; }
.scale-avg { font: 800 90px/1 "Segoe UI", sans-serif; color: #F59E0B; margin-bottom: 30px; }
.scale-avg small { font-size: 34px; opacity: .6; font-weight: 600; }

.poll-cloud { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; max-width: 1250px; }
.cloud-chip { font-family: "Segoe UI", sans-serif; font-weight: 700; border: 2.5px solid; border-radius: 999px; padding: .35em .9em; animation: pop .4s ease; }
.cloud-empty { font: 500 26px "Segoe UI", sans-serif; opacity: .65; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }

@media (max-width: 1100px) {
  .join-panel { flex-direction: column; gap: 30px; text-align: center; }
  .join-info h1 { font-size: 34px; }
  .poll-question { font-size: 34px; }
  .bar-row { grid-template-columns: 140px 1fr 50px; }
  .bar-label { font-size: 16px; }
}
