:root {
  --navy: #1e1e36;
  --navy-2: #2a2a4a;
  --cyan: #0ba2c3;
  --cyan-dark: #0a8aa6;
  --contra: #d06a6f;
  --abst: #97a2ad;
  --bg: #f4f6f8;
  --line: #e6e9ed;
  --mut: #6b7280;
  --white: #ffffff;
  --warn: #b58a2e;
  --shadow: 0 24px 70px rgba(30, 30, 54, 0.12);
  --font: "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  color: var(--navy);
  background:
    radial-gradient(circle at 12% 8%, rgba(11, 162, 195, 0.14), transparent 32rem),
    radial-gradient(circle at 90% 12%, rgba(208, 106, 111, 0.1), transparent 28rem),
    linear-gradient(135deg, #f8fafc 0%, #eef3f6 100%);
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

.boot {
  min-height: 100dvh;
  display: grid;
  place-content: center;
  gap: 14px;
  text-align: center;
  color: var(--mut);
}

.mark {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  margin: 0 auto;
  background: var(--navy);
  color: var(--white);
  font-weight: 900;
}

.page {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand h1,
.brand p,
.card h2,
.card h3,
.metric strong,
.question-title,
.empty p {
  margin: 0;
}

.brand h1 {
  font-size: clamp(1.4rem, 3vw, 2rem);
  line-height: 1.05;
}

.brand p,
.muted {
  color: var(--mut);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(30, 30, 54, 0.08);
  color: var(--navy);
  font-size: 0.82rem;
  font-weight: 800;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--mut);
}

.dot.open {
  background: var(--cyan);
  animation: pulse 1.2s ease-in-out infinite;
}

.dot.closed {
  background: var(--warn);
}

.dot.results {
  background: var(--cyan-dark);
}

.dot.finalizado {
  background: var(--navy);
}

.shell {
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(380px, 1.45fr);
  gap: 18px;
  align-items: start;
}

.card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(230, 233, 237, 0.95);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 22px;
}

.card + .card {
  margin-top: 18px;
}

.card h2 {
  font-size: 1.05rem;
}

.card h3 {
  font-size: 0.92rem;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.progress {
  display: flex;
  gap: 6px;
}

.segment {
  width: 34px;
  height: 7px;
  border-radius: 999px;
  background: var(--line);
}

.segment.done {
  background: var(--cyan);
}

.segment.current {
  background: var(--navy);
}

.eyebrow {
  color: var(--mut);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.question-title {
  font-size: 1.25rem;
  line-height: 1.18;
}

.question-text {
  margin: 10px 0 0;
  color: var(--mut);
  line-height: 1.5;
}

.timer {
  margin-top: 18px;
}

.timer-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}

.timer-value {
  font-size: 1.65rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.bar {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--line);
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--cyan);
  transition: width 0.5s linear, background 0.2s ease;
}

.bar-fill.urgent {
  background: var(--contra);
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 18px;
}

.stat {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--white);
  padding: 14px;
}

.stat-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--mut);
  font-size: 0.78rem;
  font-weight: 800;
}

.swatch {
  width: 10px;
  height: 10px;
  border-radius: 4px;
}

.stat strong {
  display: block;
  margin-top: 10px;
  font-size: clamp(1.7rem, 5vw, 2.2rem);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.stat small {
  display: block;
  margin-top: 6px;
  color: var(--mut);
  font-size: 0.76rem;
}

.participation {
  margin-top: 12px;
  text-align: center;
  color: var(--mut);
  font-size: 0.86rem;
  font-variant-numeric: tabular-nums;
}

.actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 18px;
}

.actions .wide {
  grid-column: 1 / -1;
}

.btn {
  border: 1.5px solid var(--line);
  border-radius: 14px;
  min-height: 46px;
  padding: 0 14px;
  background: var(--white);
  color: var(--navy);
  font-weight: 850;
}

.btn.primary {
  background: var(--cyan);
  border-color: var(--cyan);
  color: var(--white);
}

.btn.dark {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--white);
}

.btn.danger {
  border-color: rgba(208, 106, 111, 0.45);
  color: var(--contra);
}

.btn.ghost {
  background: transparent;
}

.btn:disabled {
  background: #f1f3f5;
  border-color: var(--line);
  color: #aeb5bd;
}

.login {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.login-card {
  width: min(420px, 100%);
}

.form {
  display: grid;
  gap: 12px;
}

.field {
  display: grid;
  gap: 7px;
}

.field label {
  color: var(--mut);
  font-size: 0.78rem;
  font-weight: 850;
}

.field input,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
  color: var(--navy);
  padding: 12px 13px;
  outline: none;
}

.field textarea {
  min-height: 88px;
  resize: vertical;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(11, 162, 195, 0.12);
}

.config-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.7fr 0.7fr;
  gap: 12px;
}

.question-editor {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.question-row {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  background: #fbfcfd;
}

.question-row-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.msg {
  margin-top: 12px;
  border-radius: 14px;
  padding: 11px 13px;
  font-size: 0.86rem;
  font-weight: 750;
}

.msg.error {
  background: rgba(208, 106, 111, 0.12);
  color: #9a3f44;
}

.msg.ok {
  background: rgba(11, 162, 195, 0.12);
  color: var(--cyan-dark);
}

.empty {
  border: 1px dashed var(--line);
  border-radius: 16px;
  padding: 18px;
  color: var(--mut);
  background: rgba(244, 246, 248, 0.64);
}

.spinner {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 4px solid var(--line);
  border-top-color: var(--cyan);
  animation: spin 1s linear infinite;
  margin: 18px auto 8px;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.45);
    opacity: 0.55;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 880px) {
  .shell,
  .config-grid,
  .stats,
  .actions {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .page {
    width: min(100% - 20px, 680px);
    padding-top: 16px;
  }
}
