/* fyibest.com — light theme, colours sampled from the design mock. */

:root {
  --bg: #fdf5f1;
  --ink: #212936;
  --muted: #5a6472;
  --faint: #8d95a1;
  --accent: #d0742d;
  --accent-2: #d8642c;
  --link: #c96a28;
  --card: #ffffff;
  --line: #f0e2d8;
  --ok: #2f855a;
  --warn: #b7791f;
  --err: #c53030;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto,
               "Helvetica Neue", Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}

#page-main {
  max-width: 640px;
  margin: 0 auto;
  padding: 3rem 1.25rem 4rem;
}

/* ── Hero ─────────────────────────────────────────────────────────────────── */

#hero-section { text-align: center; }

#hero-sparkle { font-size: 3.25rem; line-height: 1; margin-bottom: 1.75rem; }

#hero-question {
  font-size: clamp(2rem, 8vw, 3.1rem);
  line-height: 1.12;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 1.5rem;
  color: var(--ink);
}

#hero-subtitle {
  font-size: 1.05rem;
  color: var(--muted);
  margin: 0 0 2.25rem;
  line-height: 1.5;
}

/* ── Answer button ────────────────────────────────────────────────────────── */

#answer-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 1rem 2.4rem;
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  border: 0;
  border-radius: 14px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(208, 116, 45, 0.28);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  font-family: inherit;
}
#answer-btn:hover { transform: translateY(-1px); box-shadow: 0 10px 26px rgba(208,116,45,.34); }
#answer-btn:active { transform: translateY(1px); }
#answer-btn:disabled { opacity: 0.55; cursor: default; transform: none; }

#answer-btn-icon { font-size: 1.15rem; }

#answer-hint, #unsupported-note {
  margin: 1.1rem 0 0;
  font-size: 0.92rem;
  color: var(--faint);
}
#unsupported-note { color: var(--muted); }
#unsupported-email, #footer-email { color: var(--link); }

/* ── Recorder ─────────────────────────────────────────────────────────────── */

#recorder-panel {
  margin: 0 auto;
  max-width: 340px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.1rem 1.25rem 1.25rem;
  box-shadow: 0 6px 18px rgba(33, 41, 54, 0.06);
}

#recorder-meter {
  height: 6px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 0.85rem;
}
#recorder-meter-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 999px;
  transition: width 0.08s linear;
}

#recorder-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  font-size: 0.98rem;
  margin-bottom: 0.9rem;
}
#recorder-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--err);
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.25; } }
@media (prefers-reduced-motion: reduce) { #recorder-dot { animation: none; } }

#recorder-timer { font-variant-numeric: tabular-nums; font-weight: 700; }
#recorder-state { color: var(--muted); }

#stop-btn {
  width: 100%;
  padding: 0.7rem 1rem;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 11px;
  cursor: pointer;
}
#stop-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ── Messages ─────────────────────────────────────────────────────────────── */

#messages-section { margin-top: 3.5rem; }

#messages-heading {
  font-size: 1.15rem;
  margin: 0 0 0.3rem;
  color: var(--ink);
}
#messages-note {
  margin: 0 0 1.1rem;
  font-size: 0.85rem;
  color: var(--faint);
}

.msg-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.95rem 1.1rem;
  margin-bottom: 0.85rem;
  box-shadow: 0 3px 10px rgba(33, 41, 54, 0.05);
}

.msg-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}
.msg-time { font-size: 0.82rem; color: var(--faint); }
.msg-status { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.msg-status.is-done { color: var(--ok); }
.msg-status.is-working { color: var(--warn); }
.msg-status.is-failed { color: var(--err); }

.msg-actions { margin-left: auto; display: flex; gap: 0.35rem; }

.msg-btn {
  font-family: inherit;
  font-size: 0.78rem;
  padding: 0.28rem 0.6rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  cursor: pointer;
}
.msg-btn:hover { border-color: var(--accent); color: var(--accent); }
.msg-sync { color: var(--accent); border-color: var(--accent); font-weight: 700; }

.msg-clean {
  margin: 0;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.msg-clean:empty::before { content: "…"; color: var(--faint); }

.msg-raw {
  margin: 0.7rem 0 0;
  padding-top: 0.7rem;
  border-top: 1px dashed var(--line);
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
/* A display class beats the UA's [hidden], so restore it explicitly. */
[hidden] { display: none !important; }

/* ── Footer ───────────────────────────────────────────────────────────────── */

#page-footer { margin-top: 3rem; text-align: center; }
#footer-contact { color: var(--faint); font-size: 0.95rem; margin: 0 0 0.9rem; }
#footer-privacy {
  color: var(--faint);
  font-size: 0.78rem;
  line-height: 1.5;
  max-width: 30rem;
  margin: 0 auto;
}

/* ── Toasts ───────────────────────────────────────────────────────────────── */

#toast-stack {
  position: fixed;
  left: 50%;
  bottom: 1.25rem;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column-reverse;
  gap: 0.5rem;
  z-index: 50;
  width: min(92vw, 26rem);
}
.toast {
  background: var(--ink);
  color: #fff;
  padding: 0.7rem 0.95rem;
  border-radius: 11px;
  font-size: 0.9rem;
  box-shadow: 0 8px 22px rgba(33, 41, 54, 0.25);
  cursor: pointer;
  display: flex;
  gap: 0.6rem;
  align-items: center;
}
.toast.is-err { background: var(--err); }

/* ── Consent line under the Answer button ─────────────────────────────────── */

#answer-consent {
  margin: 1rem 0 0;
  font-size: 0.75rem;
  color: var(--faint);
}

#answer-consent a { color: var(--link); }

/* ── Footer links ─────────────────────────────────────────────────────────── */

#footer-legal {
  margin: 0.5rem 0 0;
  font-size: 0.8rem;
  color: var(--faint);
}

#footer-legal a, #legal-footer-links a { color: var(--link); }
.footer-sep { margin: 0 0.4rem; color: var(--line); }

/* ── Cookie banner ────────────────────────────────────────────────────────
   Built by consent.js, so it only exists when analytics is configured. */

#cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem 1.25rem;
  padding: 0.9rem 1.25rem calc(0.9rem + env(safe-area-inset-bottom));
  background: var(--card);
  border-top: 1px solid var(--line);
  box-shadow: 0 -4px 20px rgba(33, 41, 54, 0.08);
}

#cookie-banner[hidden] { display: none; }

#cookie-banner-text {
  margin: 0;
  max-width: 34rem;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--muted);
}

#cookie-banner-text a { color: var(--link); }

#cookie-banner-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

.cookie-btn {
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
}

.cookie-btn:hover { border-color: var(--accent); color: var(--accent); }

.cookie-btn-primary {
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  border-color: transparent;
  color: #fff;
}

.cookie-btn-primary:hover { color: #fff; opacity: 0.92; }

/* ── Legal pages ──────────────────────────────────────────────────────────── */

#legal-main {
  max-width: 46rem;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--ink);
}

#legal-back { margin: 0 0 2rem; font-size: 0.85rem; }
#legal-back-link { color: var(--link); text-decoration: none; }
#legal-back-link:hover { text-decoration: underline; }

#legal-title {
  margin: 0 0 0.35rem;
  font-size: 1.85rem;
  line-height: 1.2;
}

#legal-updated {
  margin: 0 0 2rem;
  font-size: 0.8rem;
  color: var(--faint);
}

#legal-main h2 {
  margin: 2.25rem 0 0.6rem;
  font-size: 1.02rem;
  color: var(--ink);
}

#legal-main p { margin: 0 0 0.9rem; color: var(--muted); }
#legal-main strong { color: var(--ink); }
#legal-main a { color: var(--link); }

#legal-main ul {
  margin: 0 0 1rem;
  padding-left: 1.15rem;
  color: var(--muted);
}

#legal-main li { margin-bottom: 0.45rem; }

#legal-footer {
  margin-top: 3rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  text-align: center;
}

#legal-footer-links {
  margin: 0;
  font-size: 0.8rem;
  color: var(--faint);
}

/* With analytics unconfigured the site sets no cookies at all, so a "Cookie
   settings" link would open a banner that has nothing to decide. data-ga is
   substituted at serve time and is empty when MAIN_GA_ID is unset. */
.cookie-link-wrap[data-ga=""] { display: none; }
