:root {
  color-scheme: light;
  --navy-950: #071733;
  --navy-900: #0d244d;
  --blue-800: #164a9f;
  --blue-700: #2164cf;
  --blue-100: #dcecff;
  --cyan-500: #00a7c8;
  --orange-500: #ff9f1c;
  --orange-600: #ef7d00;
  --green-500: #13a36f;
  --rose-500: #e24a6a;
  --ink: #07142b;
  --muted: #65728a;
  --line: #d7e1ef;
  --surface: #ffffff;
  --surface-2: #f5f8fc;
  --shadow: 0 20px 60px rgba(7, 23, 51, 0.14);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(255, 159, 28, 0.08), transparent 28rem),
    linear-gradient(225deg, rgba(0, 167, 200, 0.13), transparent 34rem),
    #dceafa;
  letter-spacing: 0;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.shell {
  min-height: 100vh;
}

.hero {
  display: grid;
  grid-template-columns: minmax(320px, 520px) 1fr;
  min-height: 132px;
  color: #fff;
  background: linear-gradient(90deg, #050b18 0 31%, #092052 31% 100%);
  box-shadow: 0 12px 40px rgba(7, 23, 51, 0.16);
}

.brand-strip {
  display: grid;
  grid-template-columns: 1.2fr 0.85fr;
  align-items: center;
  gap: 14px;
  padding: 18px 18px 18px 20px;
  border-right: 4px solid var(--orange-500);
}

.brand-card {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  height: 96px;
  margin: 0;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.18);
}

.brand-card img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: 100%;
  object-fit: contain;
}

.rural-logo {
  padding: 10px;
}

.plena-logo {
  background: #f7fbf7;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  max-width: 740px;
  padding: 20px 32px;
}

.frequency,
.pill {
  display: inline-flex;
  width: max-content;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 4px 10px;
  border-radius: 999px;
  color: var(--navy-950);
  background: var(--orange-500);
  font-size: 0.74rem;
  font-weight: 900;
}

.hero h1,
.hero p,
.campaign-panel h2,
.dashboard-top h2,
.panel-heading h3 {
  margin: 0;
}

.hero h1 {
  max-width: 560px;
  font-size: clamp(1.55rem, 3.3vw, 2.35rem);
  line-height: 1.03;
}

.hero p {
  color: rgba(255, 255, 255, 0.74);
  font-size: 0.94rem;
}

.main-grid {
  width: min(100% - 32px, 1160px);
  margin: 18px auto 72px;
}

.form-view,
.dashboard-view {
  display: grid;
  gap: 16px;
  width: min(100%, 760px);
  margin: 0 auto;
}

.dashboard-view {
  width: min(100%, 1120px);
}

.campaign-panel,
.progress-panel,
.survey-section,
.dashboard-top,
.dashboard-panel,
.metric-card,
.modal-card {
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.campaign-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.16);
  background: linear-gradient(135deg, var(--blue-700), #1b52ae 62%, #0a7f9a);
}

.eyebrow,
.section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--orange-600);
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
}

.campaign-panel .eyebrow {
  color: #fff;
}

.campaign-panel h2,
.dashboard-top h2 {
  margin-top: 6px;
  font-size: clamp(1.35rem, 3vw, 2rem);
  line-height: 1.08;
}

.counter {
  display: grid;
  justify-items: end;
  gap: 2px;
}

.counter strong {
  color: var(--orange-500);
  font-size: 2rem;
  line-height: 1;
}

.counter span {
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.8rem;
}

.progress-panel {
  padding: 16px 20px;
}

.progress-copy {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.progress-copy strong {
  color: var(--blue-800);
}

.progress-track {
  overflow: hidden;
  height: 10px;
  border-radius: 999px;
  background: #e7eef8;
}

.progress-track span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--orange-500), var(--cyan-500), var(--blue-700));
  transition: width 220ms ease;
}

.survey {
  display: grid;
  gap: 16px;
}

.survey-section {
  overflow: hidden;
  padding: 24px;
  border-top: 4px solid var(--orange-500);
}

.survey-section.accent-blue {
  border-top-color: var(--blue-700);
}

.survey-section.accent-cyan {
  border-top-color: var(--cyan-500);
}

.section-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
}

.pill {
  min-height: 20px;
  padding: 3px 8px;
  color: #9a5200;
  background: #fff1d8;
  font-size: 0.68rem;
}

.pill.blue {
  color: #174a9e;
  background: #e4efff;
}

.pill.cyan {
  color: #006c82;
  background: #dcf8ff;
}

.field-grid,
.question-list {
  display: grid;
  gap: 16px;
}

.input-field {
  display: grid;
  gap: 8px;
}

.input-field span,
.question legend {
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 800;
}

em {
  color: var(--rose-500);
  font-style: normal;
}

input[type="text"],
input[type="tel"],
input[type="password"],
textarea {
  width: 100%;
  border: 1px solid #bed0e8;
  border-radius: var(--radius);
  background: #f7faff;
  color: var(--ink);
  outline: none;
  transition: border 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

input[type="text"],
input[type="tel"],
input[type="password"] {
  min-height: 54px;
  padding: 0 16px;
}

textarea {
  min-height: 94px;
  padding: 14px 16px;
  resize: vertical;
}

input:focus,
textarea:focus {
  border-color: var(--blue-700);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(33, 100, 207, 0.14);
}

.question {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.question + .question,
.question + .question-text,
.question-text + .question,
.question-text + .question-text {
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.question legend {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.question legend span,
.question-text strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 26px;
  border-radius: 999px;
  color: #fff;
  background: var(--blue-700);
  font-size: 0.75rem;
  font-weight: 900;
}

.question-text > span {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hint {
  margin: -6px 0 12px 44px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.choice-grid label,
.score-grid label {
  position: relative;
  display: flex;
  min-width: 0;
  align-items: center;
}

.choice-grid input,
.score-grid input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice-grid span,
.score-grid span {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 46px;
  border: 1px solid #c5d4e8;
  border-radius: var(--radius);
  background: #f4f8fe;
  color: #23324c;
  font-size: 0.92rem;
  font-weight: 650;
  transition: transform 180ms ease, border 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.choice-grid span {
  padding: 11px 13px 11px 42px;
}

.choice-grid span::before {
  content: "";
  position: absolute;
  left: 14px;
  width: 17px;
  height: 17px;
  border: 1.5px solid #9cb3d2;
  border-radius: 50%;
  background: #fff;
}

.choice-grid.multi span::before {
  border-radius: 5px;
}

.choice-grid input:checked + span,
.score-grid input:checked + span {
  border-color: var(--blue-700);
  background: #e8f2ff;
  box-shadow: 0 12px 24px rgba(33, 100, 207, 0.13);
}

.choice-grid input:checked + span::before {
  border-color: var(--blue-700);
  background:
    radial-gradient(circle at center, var(--blue-700) 0 42%, transparent 44%),
    #fff;
}

.choice-grid.multi input:checked + span::before {
  background: var(--blue-700);
  box-shadow: inset 0 0 0 4px #fff;
}

.choice-grid label:hover span,
.score-grid label:hover span {
  transform: translateY(-1px);
  border-color: #89a9d6;
}

.score-grid {
  display: grid;
  grid-template-columns: repeat(11, minmax(36px, 1fr));
  gap: 8px;
}

.score-grid span {
  justify-content: center;
  min-height: 42px;
  padding: 0;
  font-weight: 900;
}

.score-grid input:checked + span {
  color: #fff;
  background: linear-gradient(135deg, var(--blue-700), var(--green-500));
}

.score-caption {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.submit-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  border: 0;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 900;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.submit-button {
  width: 100%;
  padding: 0 22px;
  color: #fff;
  background: linear-gradient(135deg, var(--green-500), #078a9f 48%, var(--blue-700));
  box-shadow: 0 18px 34px rgba(19, 163, 111, 0.22);
}

.submit-button:hover,
.ghost-button:hover,
.editor-fab:hover {
  transform: translateY(-2px);
}

.submit-button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.submit-button.small {
  min-height: 50px;
}

.footer-brand {
  display: grid;
  justify-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 0.82rem;
}

.footer-brand strong {
  color: var(--navy-900);
}

.editor-fab {
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: 20;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, var(--blue-700), var(--navy-900));
  box-shadow: 0 14px 32px rgba(7, 23, 51, 0.26);
  font-size: 0.86rem;
  font-weight: 900;
}

.editor-fab span {
  color: var(--orange-500);
}

.dashboard-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 24px;
}

.dashboard-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ghost-button {
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid #c3d2e7;
  color: var(--blue-800);
  background: #f5f9ff;
}

.ghost-button.dark {
  color: #fff;
  border-color: var(--navy-900);
  background: var(--navy-900);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.metric-card {
  display: grid;
  gap: 8px;
  padding: 18px;
}

.metric-card span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
}

.metric-card strong {
  color: var(--navy-900);
  font-size: clamp(1.65rem, 4vw, 2.35rem);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  gap: 16px;
}

.dashboard-panel {
  min-width: 0;
  padding: 22px;
}

.dashboard-panel.wide {
  grid-column: span 1;
}

.dashboard-grid .dashboard-panel:last-child {
  grid-column: 1 / -1;
}

.panel-heading {
  display: grid;
  gap: 4px;
  margin-bottom: 18px;
}

.panel-heading h3 {
  font-size: 1.15rem;
}

.panel-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.charts,
.text-answers,
.response-table {
  display: grid;
  gap: 14px;
}

.chart-card {
  padding: 14px 0 0;
  border-top: 1px solid var(--line);
}

.chart-card:first-child {
  padding-top: 0;
  border-top: 0;
}

.chart-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  font-weight: 900;
}

.chart-title span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(120px, 170px) 1fr minmax(34px, auto);
  align-items: center;
  gap: 10px;
  margin: 8px 0;
}

.bar-label,
.bar-value {
  color: #27364f;
  font-size: 0.82rem;
  font-weight: 750;
}

.bar-shell {
  overflow: hidden;
  height: 10px;
  border-radius: 999px;
  background: #e8eef7;
}

.bar-shell span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--orange-500), var(--blue-700), var(--cyan-500));
}

.empty-state {
  padding: 18px;
  border: 1px dashed #bdcce0;
  border-radius: var(--radius);
  color: var(--muted);
  background: #f8fbff;
  font-weight: 700;
}

.text-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: var(--radius);
  background: #f6f9fd;
  border: 1px solid #d8e3f1;
}

.text-card strong {
  font-size: 0.86rem;
}

.text-card p {
  margin: 0;
  color: #34435c;
  font-size: 0.9rem;
  line-height: 1.45;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
  background: #fff;
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 0.84rem;
}

th {
  color: var(--navy-900);
  background: #f2f7ff;
  font-weight: 900;
}

td {
  color: #33435c;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(7, 20, 43, 0.62);
}

.modal-card {
  position: relative;
  width: min(100%, 440px);
  padding: 28px;
}

.modal-card h2 {
  margin: 8px 0 6px;
}

.modal-card p {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.45;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: var(--muted);
  background: #eef4fb;
  font-size: 1.35rem;
}

.login-form {
  display: grid;
  gap: 14px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 60;
  max-width: min(420px, calc(100% - 36px));
  padding: 14px 16px;
  border-radius: var(--radius);
  color: #fff;
  background: var(--navy-900);
  box-shadow: 0 18px 38px rgba(7, 23, 51, 0.28);
  font-weight: 800;
}

.toast.success {
  background: var(--green-500);
}

.toast.error {
  background: var(--rose-500);
}

.hidden {
  display: none !important;
}

.is-invalid input,
.is-invalid textarea,
.is-invalid .choice-grid span,
.is-invalid .score-grid span {
  border-color: var(--rose-500);
  background: #fff7f9;
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .brand-strip {
    grid-template-columns: 1.15fr 0.85fr;
    border-right: 0;
    border-bottom: 4px solid var(--orange-500);
  }

  .dashboard-grid,
  .metric-grid {
    grid-template-columns: 1fr 1fr;
  }

  .dashboard-panel.wide,
  .dashboard-grid .dashboard-panel:last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 680px) {
  .main-grid {
    width: min(100% - 18px, 1160px);
    margin-top: 10px;
  }

  .choice-grid,
  .metric-grid,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .brand-strip {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 12px;
  }

  .hero-copy,
  .campaign-panel,
  .progress-panel,
  .survey-section,
  .dashboard-top,
  .dashboard-panel {
    padding-left: 16px;
    padding-right: 16px;
  }

  .brand-card {
    height: 82px;
    padding: 9px;
  }

  .campaign-panel,
  .dashboard-top {
    align-items: flex-start;
    flex-direction: column;
  }

  .counter {
    justify-items: start;
  }

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

  .question legend,
  .question-text > span {
    align-items: flex-start;
  }

  .score-grid {
    grid-template-columns: repeat(6, minmax(38px, 1fr));
  }

  .bar-row {
    grid-template-columns: 1fr minmax(32px, auto);
  }

  .bar-shell {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .editor-fab {
    left: 12px;
    bottom: 12px;
  }
}
