/* ============================================================================
   Inqbeo Feedback — styles
   Brand palette (from the slide decks / logo):
     Navy #333366  ·  Pink #E94C86  ·  Coral #F4996E  ·  Light #F2F2F2
   Primary accent is the Pink→Coral gradient. Text is Navy on a light ground.
   Shared base with the quiz-app, plus the feedback form, stars, and report.
   ========================================================================== */

/* ---- Vendored font (Nunito, SIL OFL) — offline, no Google Fonts call ------ */
@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("assets/nunito-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("assets/nunito-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7,
    U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF,
    U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --navy:   #333366;
  --pink:   #e94c86;
  --coral:  #f4996e;
  --light:  #f2f2f2;

  --ink:        #2e2e5b;
  --muted:      #7a7a96;
  --surface:    #ffffff;
  --surface-2:  #fafaff;
  --line:       #ececf4;
  --good:       #2bb673;
  --good-soft:  #e7f7ef;
  --bad:        #e8546b;
  --bad-soft:   #fdecef;
  --star:       #f5b301;

  --grad: linear-gradient(100deg, var(--pink), var(--coral));
  --radius: 16px;
  --radius-lg: 22px;
  --shadow: 0 18px 50px rgba(51, 51, 102, .14);
  --shadow-sm: 0 6px 18px rgba(51, 51, 102, .10);
  --ring: 0 0 0 4px rgba(233, 76, 134, .20);

  --font: "Nunito", system-ui, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
/* The `hidden` attribute must always win, even over component rules that set a
   `display` (e.g. .langswitch / .screen). Without this the empty language
   switcher would render as a stray pill when only one language is configured. */
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 560px at 88% -10%, #fde4ea 0%, transparent 58%),
    radial-gradient(1000px 520px at -10% 6%, #fdeede 0%, transparent 56%),
    var(--surface-2);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.page {
  max-width: 680px;
  margin: 0 auto;
  padding: 30px 18px calc(30px + env(safe-area-inset-bottom));
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
.page.wide { max-width: 880px; }

/* ---- Brand bar ----------------------------------------------------------- */
.brandbar { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.logo { display: inline-flex; align-items: center; text-decoration: none; }
.logo-img { height: 34px; width: auto; display: block; }
.spacer { flex: 1; }

.langswitch { display: inline-flex; gap: 4px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 999px; padding: 4px; box-shadow: var(--shadow-sm); }
.langswitch button {
  border: 0; background: transparent; color: var(--muted); cursor: pointer;
  font-family: inherit; font-weight: 800; font-size: .78rem; letter-spacing: .03em;
  text-transform: uppercase; padding: 5px 11px; border-radius: 999px; transition: .15s;
}
.langswitch button[aria-pressed="true"] { background: var(--grad); color: #fff; }

/* ---- Headline ------------------------------------------------------------ */
.headline { margin: 4px 0 20px; }
.headline h1 { margin: 0; font-size: clamp(1.8rem, 6vw, 2.5rem); font-weight: 800; letter-spacing: -.02em; }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.headline p { margin: 8px 0 0; font-size: 1rem; }
.muted { color: var(--muted); }
.tiny { font-size: .82rem; }

main { flex: 1; }

/* ---- Cards --------------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

/* ---- Inputs -------------------------------------------------------------- */
.text-input {
  width: 100%; font-family: inherit; font-size: 1.02rem; color: var(--ink);
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 13px;
  padding: 13px 15px; transition: border-color .15s, box-shadow .15s;
}
.text-input:focus { outline: none; border-color: var(--pink); box-shadow: var(--ring); }
.field-label { display: block; font-weight: 800; font-size: .95rem; margin-bottom: 8px; }
.field-error { color: var(--bad); font-weight: 700; font-size: .9rem; margin: 4px 2px 0; }
.check { display: flex; align-items: center; gap: 10px; margin-top: 12px; cursor: pointer; font-size: .96rem; }
.check input { width: 20px; height: 20px; accent-color: var(--pink); }

/* ---- Gate ---------------------------------------------------------------- */
.gate-card { padding: 34px 26px; text-align: center; display: grid; gap: 14px; justify-items: center; }
.gate-emoji { font-size: 2.4rem; }
.gate-card h2 { margin: 0; font-size: 1.3rem; font-weight: 800; }
.gate-card .muted { margin: 0; }
.gate-card .text-input { max-width: 280px; text-align: center; }
.gate-card .btn { width: 100%; max-width: 280px; }

/* ---- Form ---------------------------------------------------------------- */
.intro { margin: 0 0 18px; line-height: 1.5; }
.qlist { display: grid; gap: 14px; }
.q-card { padding: 18px 18px 16px; }
.q-head { display: flex; gap: 13px; align-items: flex-start; }
.q-num {
  flex: 0 0 auto; width: 30px; height: 30px; border-radius: 9px;
  display: grid; place-items: center; font-weight: 800; font-size: .9rem;
  color: #fff; background: var(--grad); box-shadow: 0 6px 14px rgba(233,76,134,.28);
}
.q-text { margin: 2px 0 0; font-size: 1.08rem; font-weight: 800; line-height: 1.35; }

/* Stars */
.stars { display: flex; align-items: center; gap: 4px; margin: 14px 0 4px; padding-left: 43px; }
.star {
  border: 0; background: transparent; cursor: pointer; padding: 2px;
  font-size: 1.9rem; line-height: 1; color: #d9d9e6;
  transition: transform .08s ease, color .12s ease;
}
.star:hover { transform: scale(1.12); }
.star.on { color: var(--star); }
.star:focus-visible { outline: none; border-radius: 8px; box-shadow: var(--ring); }
.star-clear {
  border: 0; background: transparent; cursor: pointer; color: var(--muted);
  font-size: 1rem; margin-left: 8px; padding: 6px; border-radius: 8px;
}
.star-clear:hover { color: var(--bad); }

.comment {
  width: 100%; margin-top: 10px; font-family: inherit; font-size: .98rem; color: var(--ink);
  background: var(--surface-2); border: 1.5px solid var(--line); border-radius: 12px;
  padding: 11px 13px; resize: none; overflow: hidden; line-height: 1.5;
  transition: border-color .15s, box-shadow .15s;
}
.comment:focus { outline: none; border-color: var(--pink); box-shadow: var(--ring); background: var(--surface); }

.identity-card { padding: 18px; margin-top: 16px; }
.identity-card .privacyNote, .identity-card .tiny { margin: 10px 2px 0; }

/* ---- Buttons ------------------------------------------------------------- */
.actions { display: flex; gap: 12px; margin-top: 20px; }
.actions.center { justify-content: center; }
.btn {
  border: 0; border-radius: 13px; padding: 14px 24px; font-family: inherit;
  font-size: 1.02rem; font-weight: 800; cursor: pointer;
  transition: transform .05s, filter .15s, box-shadow .15s, opacity .15s;
}
.btn.primary { color: #fff; background: var(--grad); box-shadow: 0 10px 24px rgba(233, 76, 134, .32); }
.btn.primary:hover { filter: brightness(1.04); }
.btn.primary:active { transform: translateY(1px); }
.btn.primary:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; filter: none; }
.btn.ghost { background: var(--surface); color: var(--navy); border: 1.5px solid var(--line); }
.btn.ghost:hover { border-color: var(--pink); color: var(--pink); }
.btn.small { padding: 9px 16px; font-size: .9rem; border-radius: 11px; }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
#submitBtn { flex: 1; }

/* ---- Thanks / error ------------------------------------------------------ */
.thanks-card, .error-card { padding: 38px 26px; text-align: center; }
.thanks-emoji, .error-emoji { font-size: 2.6rem; }
.thanks-card h2, .error-card h2 { margin: 12px 0 6px; font-size: 1.4rem; font-weight: 800; }
.thanks-card .muted { line-height: 1.55; max-width: 420px; margin: 0 auto; }

/* ---- Footer -------------------------------------------------------------- */
.pagefoot { margin-top: 28px; padding-top: 16px; font-size: .82rem;
  display: flex; gap: 8px; align-items: center; justify-content: center; }
.pagefoot .dot { opacity: .5; }

/* ---- Screen transition --------------------------------------------------- */
.screen { animation: rise .28s cubic-bezier(.2,.8,.2,1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ============================================================================
   Report page
   ========================================================================== */
.report-toolbar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  margin: 0 0 20px; padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.report-toolbar .grow { flex: 1; }
.token-input { max-width: 320px; }

.summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { padding: 16px 18px; text-align: center; }
.stat .num { font-size: 2rem; font-weight: 800; background: var(--grad);
  -webkit-background-clip: text; background-clip: text; color: transparent; line-height: 1; }
.stat .label { color: var(--muted); font-size: .85rem; margin-top: 6px; font-weight: 700; }

.qreport { padding: 20px 20px 18px; margin-bottom: 16px; }
.qreport h3 { margin: 0 0 4px; font-size: 1.12rem; font-weight: 800; }
.qreport .removed-tag { font-size: .75rem; font-weight: 800; color: var(--bad);
  background: var(--bad-soft); border-radius: 999px; padding: 2px 9px; margin-left: 8px; vertical-align: middle; }
.qreport .avgline { font-weight: 800; color: var(--navy); margin: 6px 0 14px; }
.qreport .avgline .big { color: var(--star); font-size: 1.15rem; }

/* SVG chart fills via currentColor on the bars */
.chart { width: 100%; height: auto; display: block; }
.chart .bar { fill: url(#barGrad); }
.chart .track { fill: var(--light); }
.chart .lbl { fill: var(--ink); font: 700 13px var(--font); }
.chart .cnt { fill: var(--muted); font: 700 12px var(--font); }

.comments { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 9px; }
.comments li { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 11px 14px; line-height: 1.5; white-space: pre-wrap; }
.comments .who { font-weight: 800; color: var(--pink); margin-right: 6px; }
.comments-head { font-weight: 800; font-size: .9rem; color: var(--muted);
  text-transform: uppercase; letter-spacing: .04em; margin: 16px 0 0; }
.empty-note { color: var(--muted); font-style: italic; margin: 8px 0 0; }

.report-error { color: var(--bad); font-weight: 700; }

/* ---- Print: clean PDF via the browser's "Save as PDF" -------------------- */
@media print {
  body { background: #fff; }
  .page { max-width: none; box-shadow: none; }
  .report-toolbar, .langswitch, .pagefoot .noprint { display: none !important; }
  .card, .qreport, .stat { box-shadow: none; break-inside: avoid; }
  .qreport { border-color: #ddd; }
  a[href]:after { content: ""; }
}

@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
