/* =========================================================
   TypeForm Component — typeform.css  v1
   Drop-in alongside typeform.js. No framework required.
   ========================================================= */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Root ── */
.tf-root {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  background: var(--tf-bg, #191919);
  color: var(--tf-text, #ffffff);
  -webkit-font-smoothing: antialiased;
}

/* ── Progress bar ── */
.tf-progress {
  position: absolute;
  top: 0; left: 0;
  height: 3px;
  background: var(--tf-accent, #0445AF);
  width: 0%;
  transition: width 0.45s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 10;
}

/* ── Question stage ── */
.tf-stage {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 24px 80px;
}

/* ── Individual question ── */
.tf-question {
  position: absolute;
  width: 100%;
  max-width: 680px;
  padding: 0 40px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(60px);
  /* JS controls transitions inline for direction-awareness */
}

@media (max-width: 600px) {
  .tf-question { padding: 0 24px; }
}

/* ── Question meta ── */
.tf-q-num {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.55;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.tf-q-num svg { flex-shrink: 0; }

.tf-q-text {
  font-size: clamp(1.45rem, 4vw, 2.2rem);
  font-weight: 500;
  line-height: 1.3;
  margin-bottom: 6px;
}

.tf-required {
  color: var(--tf-accent, #0445AF);
  margin-left: 3px;
}

.tf-q-desc {
  font-size: 1rem;
  opacity: 0.6;
  margin-bottom: 28px;
  line-height: 1.6;
}

/* ── Text inputs ── */
.tf-input {
  background: transparent;
  border: none;
  border-bottom: 2px solid rgba(255,255,255,0.25);
  color: inherit;
  font-size: 1.2rem;
  font-family: inherit;
  width: 100%;
  padding: 10px 0;
  outline: none;
  transition: border-color 0.2s;
  caret-color: var(--tf-accent, #0445AF);
  display: block;
}
.tf-input:focus { border-bottom-color: var(--tf-accent, #0445AF); }
.tf-input::placeholder { color: rgba(255,255,255,0.28); }
.tf-textarea { resize: none; line-height: 1.6; }

/* ── OK button ── */
.tf-ok-btn {
  margin-top: 20px;
  background: var(--tf-accent, #0445AF);
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 10px 20px 10px 16px;
  font-size: 1rem;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  transition: filter 0.15s, transform 0.1s;
  line-height: 1;
}
.tf-ok-btn:hover { filter: brightness(1.18); }
.tf-ok-btn:active { transform: scale(0.97); }

/* ── Hint ── */
.tf-hint {
  margin-top: 14px;
  font-size: 0.78rem;
  opacity: 0.4;
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}
.tf-hint kbd {
  background: rgba(255,255,255,0.13);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 3px;
  padding: 1px 5px;
  font-size: 0.72rem;
  font-family: inherit;
}

/* ── Error ── */
.tf-error {
  margin-top: 10px;
  font-size: 0.82rem;
  color: #ff6b6b;
  opacity: 0;
  transition: opacity 0.2s;
  min-height: 1.2em;
}
.tf-error.visible { opacity: 1; }

/* ── Multiple choice ── */
.tf-choices {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-bottom: 4px;
}

.tf-choice {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  border: 2px solid rgba(255,255,255,0.18);
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  user-select: none;
  -webkit-user-select: none;
}
.tf-choice:hover {
  border-color: rgba(255,255,255,0.45);
  background: rgba(255,255,255,0.04);
}
.tf-choice.selected {
  border-color: var(--tf-accent, #0445AF);
  background: rgba(4, 69, 175, 0.15);
}

.tf-choice-key {
  min-width: 22px;
  height: 22px;
  border: 1.5px solid rgba(255,255,255,0.35);
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s;
}
.tf-choice.selected .tf-choice-key {
  background: var(--tf-accent, #0445AF);
  border-color: var(--tf-accent, #0445AF);
}

.tf-choice-label { font-size: 0.95rem; line-height: 1.4; }

/* ── Rating ── */
.tf-rating-row {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.tf-rating-opt {
  min-width: 46px;
  height: 46px;
  border: 2px solid rgba(255,255,255,0.2);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  transition: border-color 0.15s, background 0.15s;
  user-select: none;
  -webkit-user-select: none;
}
.tf-rating-opt:hover {
  border-color: rgba(255,255,255,0.55);
  background: rgba(255,255,255,0.07);
}
.tf-rating-opt.selected {
  background: var(--tf-accent, #0445AF);
  border-color: var(--tf-accent, #0445AF);
}

.tf-rating-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  opacity: 0.45;
  margin-bottom: 4px;
  padding: 0 2px;
}

/* ── Welcome / End ── */
.tf-welcome-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.55;
  margin-bottom: 16px;
}

.tf-welcome-title {
  font-size: clamp(1.9rem, 5.5vw, 3rem);
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 14px;
}

.tf-welcome-desc {
  font-size: 1.05rem;
  opacity: 0.65;
  line-height: 1.65;
  margin-bottom: 32px;
  max-width: 540px;
}

.tf-start-btn {
  background: var(--tf-accent, #0445AF);
  color: #fff;
  border: none;
  border-radius: 5px;
  padding: 14px 26px;
  font-size: 1.05rem;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: filter 0.15s, transform 0.1s;
  letter-spacing: 0.01em;
}
.tf-start-btn:hover { filter: brightness(1.18); }
.tf-start-btn:active { transform: scale(0.97); }

.tf-end-icon {
  font-size: 2.5rem;
  margin-bottom: 16px;
}

.tf-end-title {
  font-size: clamp(1.9rem, 5.5vw, 3rem);
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 14px;
}

.tf-end-desc {
  font-size: 1.05rem;
  opacity: 0.65;
  line-height: 1.65;
  margin-bottom: 32px;
}

/* ── Nav arrows ── */
.tf-nav {
  position: absolute;
  bottom: 22px;
  right: 22px;
  display: flex;
  gap: 6px;
  z-index: 10;
}

.tf-nav-btn {
  width: 38px;
  height: 38px;
  border-radius: 5px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.12);
  color: #fff;
  transition: background 0.15s;
  flex-shrink: 0;
}
.tf-nav-btn:hover:not(:disabled) { background: rgba(255,255,255,0.22); }
.tf-nav-btn:disabled { opacity: 0.25; cursor: not-allowed; }

/* ── Shake animation for validation error ── */
@keyframes tf-shake {
  0%,100% { transform: translateX(0); }
  20%,60%  { transform: translateX(-9px); }
  40%,80%  { transform: translateX(9px); }
}
.tf-shake { animation: tf-shake 0.38s ease; }

/* ── Scrollbar ── */
.tf-root ::-webkit-scrollbar { width: 3px; }
.tf-root ::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.18); border-radius: 2px; }
