/* ============================================================
   Yedda.ai — engagement survey
   Brand palette (from the Yedda.ai logo):
     teal    #2fa4b4  (primary)
     orange  #f47c20  (accent — the dots in the logo)
   Typeface: Montserrat
   ============================================================ */

@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800&display=swap");

:root {
  --bg: #f4f5f7;
  --panel: #ffffff;
  --ink: #1b2230;
  --muted: #5f6360;
  --muted-2: #8a8d92;
  --line: #e3e5ea;
  --line-strong: #c9ccd2;

  /* Primary brand (Yedda teal). --brand is the bright logo teal used for
     decorative fills; --brand-deep is a touch darker so white text on it
     (buttons) and teal text on white (links) stay legible. Old rules
     referenced --navy*, kept as aliases to avoid a sweeping rename. */
  --brand: #2fa4b4;
  --brand-deep: #1a7b8a;
  --brand-darker: #146776;
  --brand-soft: #e3f3f5;
  --navy: var(--brand-deep);
  --navy-dark: var(--brand-darker);
  --navy-soft: var(--brand-soft);

  /* Accent (Yedda orange) — used sparingly, like the logo's dots. */
  --accent: #f47c20;
  --accent-dark: #db6713;
  --accent-soft: #fdecdd;

  --grey: #5f6360;
  --grey-soft: #eceef0;

  --good: #1a6d3a;
  --good-soft: #e2f1e6;
  --warn: #8a5a00;
  --warn-soft: #fbeed0;
  --bad: #8a1f23;
  --bad-soft: #f7dfe0;

  --shadow: 0 1px 2px rgba(16, 24, 48, 0.04), 0 4px 14px rgba(16, 24, 48, 0.06);
  --shadow-strong: 0 2px 6px rgba(16, 24, 48, 0.08), 0 12px 32px rgba(16, 24, 48, 0.10);
  --radius: 6px;
  --radius-lg: 10px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--navy); }
a:hover { color: var(--navy-dark); }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.92em;
  background: var(--grey-soft);
  padding: 1px 6px;
  border-radius: 3px;
  color: var(--ink);
}

h1, h2, h3, h4 { font-family: "Montserrat", inherit; letter-spacing: -0.005em; }

/* ===== Brand bar (the band at the top of every page) ===== */

.brand-bar {
  background: #fff;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(47, 164, 180, 0.10);
}
.brand-bar__inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand-bar__logo {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: inherit;
}
.brand-bar__logo img {
  height: 104px;
  width: auto;
  display: block;
}
.brand-bar__divider {
  display: inline-block;
  width: 1px;
  height: 28px;
  background: var(--line);
}
.brand-bar__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.brand-bar nav a {
  margin-left: 18px;
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.brand-bar nav a:hover { color: var(--navy); }
.brand-bar nav a.btn { color: var(--ink); text-transform: none; letter-spacing: 0.02em; }
.brand-bar nav a.btn:hover { color: var(--navy); }

@media (max-width: 600px) {
  .brand-bar__title { display: none; }
  .brand-bar nav a { margin-left: 12px; font-size: 12px; }
}

/* Accent stripe — teal with an orange tail, echoing the logo's dots */
.accent-stripe {
  height: 4px;
  background: linear-gradient(90deg, var(--brand) 0 72%, var(--accent) 72% 100%);
}

/* ===== Layout ===== */

.page { max-width: 880px; margin: 0 auto; padding: 36px 20px 96px; }
.page--wide { max-width: 1100px; }

.page-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin: 0 0 8px; }

/* ===== Hero panel ===== */

.hero {
  background: var(--panel);
  border: 1px solid var(--line);
  border-top: 4px solid var(--navy);
  border-radius: var(--radius-lg);
  padding: 36px;
  box-shadow: var(--shadow);
}
.hero h2 { margin: 0 0 12px; font-size: 30px; font-weight: 700; color: var(--ink); }
.hero p { color: var(--muted); font-size: 16px; }
.lede { font-size: 17px; color: #2c3340; margin-bottom: 24px; }

/* ===== Cards ===== */

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-top: 28px; }
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  display: flex; flex-direction: column; gap: 10px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.card:hover { border-color: var(--navy); }
.card h3 { margin: 0; font-size: 16px; font-weight: 700; }
.card p { margin: 0; color: var(--muted); font-size: 14px; }
.card a.btn { margin-top: auto; align-self: flex-start; }

/* ===== Buttons ===== */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 20px;
  border-radius: var(--radius);
  background: var(--navy); color: #fff; text-decoration: none;
  font-weight: 600; font-size: 14px; font-family: inherit;
  letter-spacing: 0.02em;
  border: 1px solid var(--navy);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.btn:hover { background: var(--navy-dark); border-color: var(--navy-dark); color: #fff; }
.btn--ghost {
  background: transparent; color: var(--ink); border-color: var(--line-strong);
}
.btn--ghost:hover { background: var(--bg); color: var(--navy); border-color: var(--navy); }
.btn--danger { background: var(--bad); border-color: var(--bad); }
.btn--danger:hover { background: #6c181c; border-color: #6c181c; }
.btn--sm { padding: 6px 12px; font-size: 12.5px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ===== Notices, errors, success ===== */

.notice {
  background: var(--navy-soft);
  border: 1px solid #c8d4ea;
  border-left: 4px solid var(--navy);
  color: #1a2a4a;
  padding: 14px 18px;
  border-radius: var(--radius);
  font-size: 14px;
  margin-bottom: 24px;
}
.errors {
  background: var(--bad-soft); border: 1px solid #e4b1b3; color: var(--bad);
  padding: 12px 16px; border-radius: var(--radius); font-size: 14px; margin-bottom: 16px;
}
.success {
  background: var(--good-soft); border: 1px solid #b6dcc1; color: var(--good);
  padding: 16px; border-radius: var(--radius); margin-bottom: 16px;
}
.muted { color: var(--muted); font-size: 14px; }
.tiny { font-size: 12.5px; color: var(--muted); }

/* ===== Section panel ===== */

.section {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.section h2 { margin: 0 0 6px; font-size: 20px; font-weight: 700; }
.section h3 { margin: 0 0 6px; font-size: 16px; font-weight: 700; }
.section .section-meta { color: var(--muted); font-size: 14px; margin-bottom: 16px; }

/* ===== Survey questions ===== */

.q { padding: 20px 0; border-top: 1px solid var(--line); }
.q:first-of-type { border-top: none; padding-top: 8px; }
.q-prompt { font-weight: 600; margin-bottom: 14px; font-size: 15.5px; color: var(--ink); }

.likert { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.likert label {
  position: relative; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 6px; text-align: center; cursor: pointer; font-size: 12.5px;
  color: var(--muted);
  transition: background 0.12s, border-color 0.12s, color 0.12s;
  background: #fff;
  font-weight: 500;
}
.likert input { position: absolute; opacity: 0; pointer-events: none; }
.likert label:hover { background: var(--bg); border-color: var(--line-strong); }
.likert label.is-selected {
  background: var(--navy-soft); border-color: var(--navy); color: var(--navy-dark);
}
.likert .num { display: block; font-size: 17px; font-weight: 800; color: var(--ink); margin-bottom: 4px; }
.likert label.is-selected .num { color: var(--navy); }

/* eNPS 0–10 scale on the survey */
.nps { display: grid; grid-template-columns: repeat(11, 1fr); gap: 5px; }
.nps label {
  position: relative; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 0; text-align: center; cursor: pointer; background: #fff;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.nps input { position: absolute; opacity: 0; pointer-events: none; }
.nps label:hover { background: var(--bg); border-color: var(--line-strong); }
.nps label.is-selected { background: var(--navy-soft); border-color: var(--navy); }
.nps-num { font-size: 15px; font-weight: 800; color: var(--ink); }
.nps label.is-selected .nps-num { color: var(--navy); }
.nps-ends { display: flex; justify-content: space-between; margin-top: 6px; }
@media (max-width: 560px) {
  .nps { grid-template-columns: repeat(6, 1fr); }
}

/* eNPS distribution bar on the report */
.enps-bar { display: flex; height: 14px; border-radius: 999px; overflow: hidden; background: var(--line); }
.enps-bar__seg { height: 100%; }
.enps-bar__seg--det { background: var(--bad); }
.enps-bar__seg--pas { background: var(--line-strong); }
.enps-bar__seg--pro { background: var(--good); }

/* Significance markers in segment & driver tables */
.sig { font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.sig--up { color: var(--good); }
.sig--down { color: var(--bad); }
.sig--sig { color: var(--good); }

/* Trend deltas vs a comparison survey */
.delta { font-size: 12px; font-weight: 700; white-space: nowrap; padding: 1px 7px; border-radius: 999px; margin-left: 6px; }
.delta--up { color: var(--good); background: var(--good-soft); }
.delta--down { color: var(--bad); background: var(--bad-soft); }
.delta--flat { color: var(--muted); background: var(--grey-soft); }

/* AI comment-analysis card */
.ai-card { border: 1px solid var(--brand); background: var(--brand-soft); border-radius: var(--radius-lg); padding: 16px 18px; margin: 0 0 14px; }
.ai-card__tag { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--brand-deep); margin-bottom: 4px; }
.ai-themes { display: grid; gap: 8px; }
.ai-theme { background: #fff; border: 1px solid var(--line); border-left: 3px solid var(--line-strong); border-radius: var(--radius); padding: 9px 12px; }
.ai-theme--pos { border-left-color: var(--good); }
.ai-theme--neg { border-left-color: var(--bad); }
.ai-theme--mix { border-left-color: var(--accent); }
.ai-h { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; margin: 12px 0 4px; color: var(--ink); }
.ai-h--good { color: var(--good); }
.ai-h--bad { color: var(--bad); }
.ai-list { margin: 0 0 6px; padding-left: 20px; }
.ai-list li { margin: 3px 0; }

/* Question editor */
.q-edits { display: grid; gap: 10px; }
.q-edit { padding: 8px 0; border-top: 1px solid var(--line); }
.q-edit:first-child { border-top: none; }

.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choices label {
  position: relative; border: 1px solid var(--line); background: #fff;
  border-radius: var(--radius); padding: 9px 16px; font-size: 14px; cursor: pointer;
  font-weight: 500; transition: background 0.12s, border-color 0.12s;
}
.choices label:hover { border-color: var(--line-strong); }
.choices label.is-selected { background: var(--navy-soft); border-color: var(--navy); color: var(--navy-dark); font-weight: 600; }
.choices input { position: absolute; opacity: 0; pointer-events: none; }

/* ===== Form fields ===== */

textarea, input[type="text"], input[type="password"], input[type="email"], select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  font-family: inherit; font-size: 14.5px;
  background: #fff; color: var(--ink);
  transition: border-color 0.12s, box-shadow 0.12s;
}
textarea:focus, input:focus, select:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(47, 164, 180, 0.18);
}
textarea { min-height: 90px; resize: vertical; }
.select--sm { width: auto; padding: 5px 8px; font-size: 13px; }

/* "or" divider between the email form and the Google button on sign-in */
.signin-divider { display: flex; align-items: center; gap: 12px; margin: 16px 0; color: var(--muted-2); font-size: 13px; }
.signin-divider::before, .signin-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--ink); text-transform: uppercase; letter-spacing: 0.04em; }
.field .help { color: var(--muted); font-size: 13px; margin-top: 4px; text-transform: none; letter-spacing: 0; font-weight: 400; }

.actions { display: flex; gap: 12px; align-items: center; margin-top: 24px; flex-wrap: wrap; }

.progress { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; margin: 0 0 28px; }
.progress > div { height: 100%; background: var(--brand); width: 0; transition: width 0.25s ease; }

/* ===== Admin: report tables, scores, pills ===== */

.score-hero { display: grid; grid-template-columns: 220px 1fr; gap: 32px; align-items: center; }
@media (max-width: 700px) { .score-hero { grid-template-columns: 1fr; } }
.score-circle {
  width: 200px; height: 200px; border-radius: 50%;
  background: conic-gradient(var(--brand) 0%, var(--brand) var(--p), var(--line) var(--p), var(--line) 100%);
  display: flex; align-items: center; justify-content: center; position: relative;
}
.score-circle::after { content: ""; position: absolute; inset: 12px; background: #fff; border-radius: 50%; }
.score-circle span { position: relative; z-index: 1; font-size: 38px; font-weight: 800; letter-spacing: -0.02em; color: var(--navy); }

.tbl-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: #fafbfc; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 700; }
td .row-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.bar-track { display: inline-block; width: 120px; height: 8px; background: var(--line); border-radius: 4px; vertical-align: middle; overflow: hidden; }
.bar-track > span { display: block; height: 100%; background: var(--navy); }

.kpi-band { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.kpi-band--good { background: var(--good-soft); color: var(--good); }
.kpi-band--ok { background: var(--warn-soft); color: var(--warn); }
.kpi-band--bad { background: var(--bad-soft); color: var(--bad); }

.status-pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.status-pill--draft { background: var(--grey-soft); color: var(--grey); }
.status-pill--open { background: var(--good-soft); color: var(--good); }
.status-pill--closed { background: var(--navy-soft); color: var(--navy); }
.status-pill--owner { background: var(--navy-soft); color: var(--navy); }

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 16px; }

.quote {
  background: #fafbfc; border-left: 3px solid var(--navy);
  padding: 10px 14px; margin: 8px 0; font-size: 14.5px;
  white-space: pre-wrap; word-break: break-word; color: var(--ink);
}

/* ===== Open-ended theme groups ===== */
.themes { margin-top: 4px; }
.theme-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin: 6px 0;
  background: #fff;
}
.theme-item[open] { border-color: var(--line-strong); }
.theme-item > summary {
  list-style: none;
  cursor: pointer;
  padding: 11px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
}
.theme-item > summary::-webkit-details-marker { display: none; }
.theme-item > summary::after {
  content: "\25B8"; /* ▸ */
  color: var(--muted);
  font-size: 12px;
  transition: transform 0.12s;
}
.theme-item[open] > summary::after { transform: rotate(90deg); }
.theme-item[open] > summary { border-bottom: 1px solid var(--line); }
.theme-label { flex: 1; }
.theme-count {
  background: var(--navy-soft); color: var(--navy);
  border-radius: 999px; padding: 2px 11px;
  font-size: 12px; font-weight: 700;
}
.theme-count--muted { background: var(--grey-soft); color: var(--grey); }
.theme-item--muted > summary { color: var(--muted); }
.theme-bodies { padding: 6px 14px 12px; }
.theme-bodies .quote:first-child { margin-top: 8px; }

.report-meta { display: flex; gap: 24px; flex-wrap: wrap; margin-top: 16px; font-size: 14px; color: var(--muted); }
.report-meta strong { color: var(--ink); }

.copy-link {
  display: flex; gap: 8px; align-items: center; margin-top: 12px;
  background: #fafbfc; border: 1px dashed var(--line-strong); padding: 12px 14px;
  border-radius: var(--radius);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px; word-break: break-all;
}

.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.toolbar h2 { margin: 0; }

.subnav { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.subnav a {
  padding: 12px 16px; text-decoration: none; color: var(--muted);
  border-bottom: 2px solid transparent; font-size: 13px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.subnav a:hover { color: var(--navy); }
.subnav a.is-active { color: var(--navy); border-bottom-color: var(--navy); }
.subnav__company { margin-left: auto; align-self: center; color: var(--muted); font-weight: 600; font-size: 13px; }

.hidden { display: none !important; }

/* ===== Info tooltips (the little "?" next to section headings) ===== */

.info { position: relative; display: inline-flex; vertical-align: middle; margin-left: 8px; }
.info__btn {
  width: 19px; height: 19px; border-radius: 50%;
  border: 1px solid var(--line-strong); background: #fff; color: var(--muted);
  font-size: 11px; font-weight: 700; line-height: 1; cursor: help;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0; font-family: inherit;
  transition: border-color 0.12s, color 0.12s, background 0.12s;
}
.info__btn:hover, .info__btn:focus-visible { border-color: var(--navy); color: var(--navy); background: var(--navy-soft); outline: none; }
.info__bubble {
  position: absolute; top: calc(100% + 9px); left: 0; z-index: 60;
  width: min(340px, 78vw);
  background: var(--ink); color: #fff;
  font-size: 12.5px; font-weight: 400; line-height: 1.5;
  letter-spacing: 0; text-transform: none;
  padding: 11px 13px; border-radius: var(--radius);
  box-shadow: var(--shadow-strong);
  opacity: 0; visibility: hidden; transform: translateY(-4px);
  transition: opacity 0.12s, transform 0.12s, visibility 0.12s;
  pointer-events: none;
}
.info:hover .info__bubble, .info:focus-within .info__bubble {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.info__bubble::before {
  content: ""; position: absolute; bottom: 100%; left: 7px;
  border: 6px solid transparent; border-bottom-color: var(--ink);
}

/* ===== Footer ===== */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 20px;
  text-align: center;
  font-size: 12px;
  color: var(--muted-2);
  background: #fff;
  margin-top: 40px;
}
.site-footer a { color: var(--muted); }

/* ===== Mobile ===== */

@media (max-width: 640px) {
  html, body { font-size: 15px; }

  .page { padding: 22px 14px 72px; }
  .brand-bar__inner { padding: 12px 14px; }
  .brand-bar__logo img { height: 76px; }

  .hero { padding: 24px 18px; border-radius: var(--radius); }
  .hero h2 { font-size: 23px; }
  .lede { font-size: 15.5px; }

  .section { padding: 20px 16px; }
  .section h2 { font-size: 18px; }

  .cards { gap: 12px; }

  /* Likert: keep the 5-across layout but tighten so it never overflows */
  .likert { gap: 5px; }
  .likert label { padding: 9px 2px; font-size: 10.5px; border-radius: 5px; }
  .likert .num { font-size: 15px; margin-bottom: 3px; }

  /* Demographic chips go full width and stack for easy tapping */
  .choices { flex-direction: column; }
  .choices label { width: 100%; }

  /* Report visuals shrink so tables mostly fit without scrolling */
  .bar-track { width: clamp(56px, 16vw, 120px); }
  th, td { padding: 9px 8px; }
  table { font-size: 13px; }

  .score-hero { gap: 20px; justify-items: center; text-align: left; }
  .score-circle { width: 150px; height: 150px; }
  .score-circle span { font-size: 30px; }

  .info__bubble { width: min(300px, 86vw); }

  .copy-link { flex-direction: column; align-items: stretch; }
}

@media (max-width: 380px) {
  .likert label { font-size: 9.5px; padding: 8px 1px; }
  .likert .num { font-size: 14px; }
}

/* ===== Print ===== */

@media print {
  body { background: #fff; }
  .brand-bar nav, .no-print, .subnav, .info { display: none !important; }
  .accent-stripe { display: none; }
  .section, .hero { box-shadow: none; border: 1px solid #ddd; page-break-inside: avoid; }
}
