/* ── Google Font injected dynamically by frontend.js based on survey settings ── */

/* ── Tokens ── */
.frsurvey-root {
  --frs-navy:        #06405b;
  --frs-navy-deep:   #042f44;
  --frs-navy-mid:    #0a5270;
  --frs-teal:        #63ccca;
  --frs-teal-dim:    rgba(99,204,202,0.12);
  --frs-teal-border: rgba(99,204,202,0.35);
  --frs-white:       #ffffff;
  --frs-muted:       rgba(255,255,255,0.52);
  --frs-line:        rgba(255,255,255,0.10);

  /* Font variable — set by JS from survey settings */
  --frs-font: 'Plus Jakarta Sans', system-ui, sans-serif;

  /* legacy aliases kept for JS compatibility */
  --frs-ink:         #ffffff;
  --frs-accent:      #63ccca;
  --frs-accent-soft: rgba(99,204,202,0.12);
  --frs-bg:          #06405b;
  --frs-star-empty:  rgba(255,255,255,0.2);
  --frs-star-fill:   #63ccca;
  --frs-radius:      6px;

  font-family: var(--frs-font);
  background: var(--frs-navy);
  color: var(--frs-white);
  max-width: 780px;
  margin: 0 auto;
  padding: 36px 24px 56px;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  letter-spacing: 0.01em;
}

.frsurvey-root *,
.frsurvey-root *::before,
.frsurvey-root *::after { box-sizing: border-box; }

/* ────────────────────────────────
   Progress bar
──────────────────────────────── */
.frsurvey-progress { margin-bottom: 44px; }

.frsurvey-progress-track {
  display: none;
}

.frsurvey-progress-dots {
  display: flex;
  gap: 0;
  overflow-x: auto;
  padding-bottom: 12px;
  scrollbar-width: none;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
}
.frsurvey-progress-dots::-webkit-scrollbar { display: none; }

.frsurvey-dot {
  flex: 0 0 120px;
  text-align: center;
  position: relative;
  scroll-snap-align: center;
  padding-top: 20px; /* space above dot for the line to sit centrally */
}

/* Connecting line — sits behind dot, centred on dot vertical position */
.frsurvey-dot::after {
  content: '';
  position: absolute;
  top: 25px; /* centres on the 10px dot (20px padding + 5px = centre of 10px dot) */
  left: calc(50% + 8px); /* start after the dot edge */
  right: calc(-50% + 8px); /* end before next dot edge */
  height: 2px;
  background: rgba(255,255,255,0.12);
  z-index: 0;
}

.frsurvey-dot:last-child::after { display: none; }

.frsurvey-dot.done::after {
  background: var(--frs-teal);
}

.frsurvey-dot::before {
  content: '';
  display: block;
  width: 10px; height: 10px;
  margin: 0 auto 10px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  border: 2px solid rgba(255,255,255,0.25);
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
  position: relative;
  z-index: 1;
}

.frsurvey-dot.done::before {
  background: var(--frs-teal);
  border-color: var(--frs-teal);
}

.frsurvey-dot.active::before {
  background: var(--frs-navy);
  border-color: var(--frs-teal);
  border-width: 2px;
  box-shadow: 0 0 0 3px rgba(99,204,202,0.25);
  width: 12px;
  height: 12px;
}

.frsurvey-dot-label {
  font-family: var(--frs-font);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--frs-muted);
  line-height: 1.3;
  display: block;
  padding: 0 6px;
}

.frsurvey-dot.active .frsurvey-dot-label {
  color: var(--frs-teal);
  font-weight: 700;
}

.frsurvey-dot.done .frsurvey-dot-label {
  color: rgba(99,204,202,0.6);
}

@media (max-width: 600px) {
  .frsurvey-dot {
    flex: 0 0 40vw;
  }
}

/* ────────────────────────────────
   Page container
──────────────────────────────── */
.frsurvey-page {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.frsurvey-page.frsurvey-fade-in {
  opacity: 1;
  transform: translateY(0);
}

.frsurvey-page-image {
  width: 100%;
  height: auto;
  border-radius: var(--frs-radius);
  margin-bottom: 28px;
  display: block;
}

.frsurvey-page-title {
  font-family: var(--frs-font);
  font-size: clamp(20px, 3.5vw, 28px);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--frs-white);
  margin: 0 0 0;
  line-height: 1.2;
}

.frsurvey-page-title::after {
  content: '';
  display: block;
  width: 36px;
  height: 3px;
  background: var(--frs-teal);
  border-radius: 2px;
  margin-top: 12px;
  margin-bottom: 24px;
}

/* ────────────────────────────────
   Rich text intro
──────────────────────────────── */
.frsurvey-page-intro {
  font-size: 15px;
  line-height: 1.75;
  color: var(--frs-muted);
  margin: 0 0 32px;
}

.frsurvey-page-intro h1,
.frsurvey-page-intro h2,
.frsurvey-page-intro h3 {
  font-family: var(--frs-font);
  color: var(--frs-white);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin: 24px 0 10px;
  line-height: 1.3;
}

.frsurvey-page-intro p        { margin: 0 0 14px; }
.frsurvey-page-intro ul,
.frsurvey-page-intro ol       { margin: 0 0 14px; padding-left: 20px; }
.frsurvey-page-intro li       { margin-bottom: 6px; }
.frsurvey-page-intro strong   { color: var(--frs-white); font-weight: 700; }
.frsurvey-page-intro a        { color: var(--frs-teal); }

/* ────────────────────────────────
   Intro fields (email, checkbox)
──────────────────────────────── */
.frsurvey-fields {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 8px;
}

.frsurvey-field label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--frs-teal);
  margin-bottom: 8px;
}

.frsurvey-field input[type="text"],
.frsurvey-field input[type="email"] {
  width: 100%;
  padding: 13px 16px;
  font-family: var(--frs-font);
  font-size: 15px;
  letter-spacing: 0.02em;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--frs-line);
  border-radius: var(--frs-radius);
  color: var(--frs-white);
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}

.frsurvey-field input[type="text"]:focus,
.frsurvey-field input[type="email"]:focus {
  border-color: var(--frs-teal);
  background: rgba(99,204,202,0.06);
}

.frsurvey-field input::placeholder { color: rgba(255,255,255,0.22); }

.frsurvey-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-family: var(--frs-font);
  font-size: 14px;
  color: var(--frs-muted);
  line-height: 1.6;
  cursor: pointer;
}

.frsurvey-checkbox-label input[type="checkbox"] {
  margin-top: 3px;
  accent-color: var(--frs-teal);
  width: 16px; height: 16px;
  flex-shrink: 0;
}

/* ────────────────────────────────
   Questions
──────────────────────────────── */
.frsurvey-questions {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.frsurvey-question {
  border-bottom: 1px solid var(--frs-line);
  padding-bottom: 28px;
}

.frsurvey-question:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.frsurvey-question-text {
  font-family: var(--frs-font);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--frs-white);
  margin: 0 0 16px;
  line-height: 1.5;
}

/* ────────────────────────────────
   Radio options — 5-column grid
──────────────────────────────── */
.frsurvey-options {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.frsurvey-option {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px 8px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--frs-radius);
  cursor: pointer;
  user-select: none;
  transition: border-color 0.15s, background 0.15s;
}

.frsurvey-option input[type="radio"] { display: none; }

.frsurvey-option-label {
  font-family: var(--frs-font);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.78);
  line-height: 1.35;
  transition: color 0.15s;
}

.frsurvey-option:hover {
  border-color: var(--frs-teal-border);
  background: var(--frs-teal-dim);
}

.frsurvey-option:hover .frsurvey-option-label { color: var(--frs-teal); }

.frsurvey-option.is-selected {
  border-color: #4ab8b6;
  background: #4ab8b6;
}

.frsurvey-option.is-selected .frsurvey-option-label {
  color: #032535;
  font-weight: 700;
}

/* ────────────────────────────────
   Navigation
──────────────────────────────── */
.frsurvey-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 44px;
  padding-top: 24px;
  border-top: 1px solid var(--frs-line);
}

.frsurvey-btn {
  font-family: var(--frs-font);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 13px 32px;
  border-radius: var(--frs-radius);
  border: none;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.15s;
}

.frsurvey-btn-primary {
  background: var(--frs-teal);
  color: var(--frs-navy-deep);
  margin-left: auto;
}

.frsurvey-btn-primary:hover       { opacity: 0.85; transform: translateY(-1px); }
.frsurvey-btn-primary:disabled    { opacity: 0.4; cursor: default; transform: none; }

.frsurvey-btn-secondary {
  background: transparent;
  color: var(--frs-muted);
  border: 1px solid var(--frs-line);
}

.frsurvey-btn-secondary:hover {
  border-color: rgba(255,255,255,0.3);
  color: var(--frs-white);
}

/* ────────────────────────────────
   Error
──────────────────────────────── */
.frsurvey-error {
  margin-top: 20px;
  padding: 13px 16px;
  background: rgba(220,60,60,0.1);
  border: 1px solid rgba(255,100,100,0.25);
  border-radius: var(--frs-radius);
  font-family: var(--frs-font);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #ff7a7a;
}

/* ────────────────────────────────
   Mobile
──────────────────────────────── */
@media (max-width: 600px) {
  .frsurvey-root { padding: 24px 16px 40px; }

  .frsurvey-options {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .frsurvey-option {
    justify-content: flex-start;
    text-align: left;
    padding: 13px 14px;
  }

  .frsurvey-page-title { font-size: 18px; }

  .frsurvey-nav {
    flex-direction: column-reverse;
    gap: 10px;
  }

  .frsurvey-btn {
    width: 100%;
    margin-left: 0 !important;
    text-align: center;
  }

  .frsurvey-dot-label { font-size: 9px; }
}

/* ── Unanswered question highlight ── */
.frsurvey-question--unanswered {
  position: relative;
  padding-left: 14px;
  border-left: 3px solid #ff7a7a;
  margin-left: -17px;
  transition: border-color 0.3s;
}

.frsurvey-question--unanswered .frsurvey-question-text {
  color: #ff9f9f;
}

.frsurvey-question--unanswered .frsurvey-option {
  border-color: rgba(255,122,122,0.3);
}
