/* ============================================================
   Try Tribu — Team Wellness Check
   ============================================================ */

:root {
  --teal:        #1B9AAA;
  --teal-dark:   #157a87;
  --teal-light:  #5DC8D6;
  --teal-glow:   rgba(27, 154, 170, 0.35);

  --bg:          #0a0f1a;
  --bg2:         #111827;
  --bg-card:     rgba(255, 255, 255, 0.04);
  --bg-card-h:   rgba(255, 255, 255, 0.07);
  --border:      rgba(255, 255, 255, 0.08);
  --border-h:    rgba(255, 255, 255, 0.15);

  --text:        #f0f2f8;
  --text-2:      #8b92a8;
  --text-3:      #555f7a;

  --green:       #10B981;
  --yellow:      #F59E0B;
  --red:         #EF4444;
  --purple:      #8B5CF6;
  --blue:        #2563EB;

  --radius:      12px;
  --radius-lg:   16px;
  --radius-pill: 50px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

a { color: var(--teal); text-decoration: none; }
a:hover { color: var(--teal-light); }
img { max-width: 100%; display: block; }
strong { font-weight: 600; }

/* ── Background Orbs ── */
.bg-orbs { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.12;
  will-change: transform;
}

.orb-1 {
  width: 500px; height: 500px;
  background: var(--teal);
  top: -150px; right: -120px;
  animation: float1 22s ease-in-out infinite;
}
.orb-2 {
  width: 350px; height: 350px;
  background: var(--teal-light);
  bottom: -80px; left: -80px;
  animation: float2 28s ease-in-out infinite;
}
.orb-3 {
  width: 280px; height: 280px;
  background: var(--purple);
  top: 45%; left: 55%;
  animation: float3 32s ease-in-out infinite;
}

@keyframes float1 { 0%,100% { transform: translate(0,0); } 50% { transform: translate(-80px,60px); } }
@keyframes float2 { 0%,100% { transform: translate(0,0); } 50% { transform: translate(50px,-50px); } }
@keyframes float3 { 0%,100% { transform: translate(0,0); } 33% { transform: translate(-50px,30px); } 66% { transform: translate(30px,-40px); } }

/* ── Progress Bar ── */
.progress-bar {
  position: fixed; top: 0; left: 0; right: 0;
  height: 3px; background: rgba(255,255,255,0.04);
  z-index: 200;
}
.progress-bar.hidden { display: none; }
.progress-fill {
  height: 100%; width: 0;
  background: linear-gradient(90deg, var(--teal), var(--teal-light));
  box-shadow: 0 0 12px var(--teal-glow);
  transition: width 0.4s ease;
  border-radius: 0 2px 2px 0;
}
.progress-text {
  position: absolute; top: 10px; right: 16px;
  font-size: 0.72rem; font-weight: 600;
  color: var(--text-3); letter-spacing: 0.05em;
}

/* ── Screens ── */
.screen {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 2rem 1.5rem;
  opacity: 0; transform: translateY(8px);
  transition: opacity 0.45s ease, transform 0.45s ease;
  pointer-events: none;
  z-index: 1;
}
.screen.active {
  opacity: 1; transform: translateY(0);
  pointer-events: auto;
}
.screen-scroll {
  align-items: flex-start;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.screen-inner {
  max-width: 560px; width: 100%;
  text-align: center;
  position: relative;
}
.results-inner { max-width: 640px; padding-bottom: 4rem; }

/* ── Typography ── */
h1, h2, h3 { font-weight: 700; line-height: 1.2; letter-spacing: -0.02em; }
h1 { font-size: clamp(2rem, 5vw, 3rem); }
h2 { font-size: clamp(1.4rem, 3vw, 1.8rem); margin-bottom: 0.75rem; }
h3 { font-size: clamp(1.1rem, 2.5vw, 1.35rem); }

.text-gradient {
  background: linear-gradient(135deg, var(--teal), var(--teal-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Logo ── */
.logo-mark {
  display: flex; align-items: center; justify-content: center;
  gap: 0.6rem; margin-bottom: 2rem;
}
.logo-img {
  height: 56px; width: auto;
  filter: drop-shadow(0 0 20px rgba(27,154,170,0.2));
}

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 0.5rem; padding: 0.8rem 1.6rem;
  border: none; border-radius: var(--radius);
  font-family: inherit; font-size: 0.95rem; font-weight: 600;
  cursor: pointer; transition: all 0.2s ease;
  text-decoration: none; white-space: nowrap;
}
.btn-primary {
  background: var(--teal); color: #fff;
  box-shadow: 0 2px 12px rgba(27,154,170,0.25);
}
.btn-primary:hover {
  background: var(--teal-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(27,154,170,0.35);
}
.btn-primary:active { transform: translateY(0); }
.btn-lg { padding: 1rem 2rem; font-size: 1.05rem; border-radius: var(--radius-lg); }

/* ── Inputs ── */
.input-group {
  display: flex; flex-direction: column; gap: 0.75rem;
  max-width: 400px; margin: 2rem auto 0;
}
.input-field {
  width: 100%; padding: 0.9rem 1.2rem;
  background: rgba(255,255,255,0.05);
  border: 1.5px solid var(--border);
  border-radius: var(--radius); color: var(--text);
  font-family: inherit; font-size: 1rem;
  outline: none; transition: border-color 0.2s, box-shadow 0.2s;
  text-align: center;
}
.input-field::placeholder { color: var(--text-3); }
.input-field:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(27,154,170,0.15);
}

.error-msg {
  color: var(--red); font-size: 0.85rem; font-weight: 500;
  margin-top: 0.5rem;
}
.hidden { display: none !important; }

.hint {
  font-size: 0.82rem; color: var(--text-3);
  margin-top: 1.5rem;
}

.shake {
  animation: shake 0.4s ease;
}
@keyframes shake {
  0%,100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

/* ── Badge / Pill ── */
.badge {
  display: inline-block;
  font-size: 0.78rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--teal); margin-bottom: 1rem;
}
.step-indicator {
  font-size: 0.82rem; font-weight: 600;
  color: var(--text-3); margin-bottom: 1.5rem;
}

/* ── Hero (team screen) ── */
.hero-title { margin-bottom: 0.75rem; }
.hero-sub {
  font-size: clamp(1rem, 2vw, 1.15rem);
  color: var(--text-2); max-width: 420px;
  margin: 0 auto 0.5rem; line-height: 1.6;
}

/* ── Welcome Screen ── */
.welcome-desc {
  font-size: 1rem; color: var(--text-2);
  max-width: 460px; margin: 0 auto 2rem;
  line-height: 1.7;
}

.radar-pills {
  display: flex; flex-wrap: wrap;
  justify-content: center; gap: 0.5rem;
  margin-bottom: 2.5rem;
}
.radar-pill {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.4rem 0.85rem;
  background: color-mix(in srgb, var(--pill-color) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--pill-color) 30%, transparent);
  border-radius: var(--radius-pill);
  font-size: 0.82rem; font-weight: 600;
  color: var(--pill-color);
}

.what-you-get {
  display: flex; flex-direction: column; gap: 1rem;
  text-align: left; max-width: 400px; margin: 0 auto 2.5rem;
}
.perk-item {
  display: flex; align-items: flex-start; gap: 0.85rem;
  padding: 0.85rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.perk-icon { font-size: 1.4rem; flex-shrink: 0; margin-top: 0.1rem; }
.perk-item strong { font-size: 0.92rem; color: var(--text); display: block; margin-bottom: 0.15rem; }
.perk-item p { font-size: 0.82rem; color: var(--text-2); line-height: 1.5; margin: 0; }

/* ── Name Screen: Teammates ── */
.teammates-joined { margin-top: 2rem; }
.teammates-label { font-size: 0.82rem; color: var(--text-3); margin-bottom: 0.75rem; }
.teammates-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; }
.teammate-chip {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 0.82rem; color: var(--text-2);
}
.teammate-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--green);
  animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%,100% { opacity: 1; } 50% { opacity: 0.4; }
}

/* ── Quiz Screen ── */
.quiz-inner { display: flex; flex-direction: column; min-height: 70vh; justify-content: center; }

.quiz-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 2rem;
}
.radar-badge {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-pill);
  font-size: 0.82rem; font-weight: 600;
  transition: all 0.35s ease;
}
.radar-emoji { font-size: 1rem; }
.radar-qnum {
  font-weight: 500; opacity: 0.6;
  margin-left: 0.25rem; font-size: 0.75rem;
}
.question-counter { font-size: 0.82rem; color: var(--text-3); font-weight: 500; }

.question-text {
  font-size: clamp(1.15rem, 2.5vw, 1.4rem);
  line-height: 1.4; margin-bottom: 2rem;
  text-align: left; font-weight: 600;
}
.question-enter {
  animation: fadeSlideIn 0.35s ease;
}

.answers-container {
  display: flex; flex-direction: column; gap: 0.65rem;
}
.answer-btn {
  width: 100%; padding: 1rem 1.25rem;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  color: var(--text); font-family: inherit;
  font-size: 0.95rem; font-weight: 500;
  text-align: left; cursor: pointer;
  transition: all 0.2s ease;
  animation: fadeSlideIn 0.3s ease backwards;
}
.answer-btn:nth-child(2) { animation-delay: 0.06s; }
.answer-btn:nth-child(3) { animation-delay: 0.12s; }

.answer-btn:hover {
  background: rgba(27,154,170,0.06);
  border-color: rgba(27,154,170,0.35);
  transform: translateX(4px);
}
.answer-btn.selected {
  background: rgba(27,154,170,0.12);
  border-color: var(--teal);
  box-shadow: 0 0 20px rgba(27,154,170,0.15);
  transform: translateX(4px);
}
.answer-btn.dimmed {
  opacity: 0.25; transform: scale(0.98);
  pointer-events: none;
}

.quiz-footer { margin-top: auto; padding-top: 2rem; }
.quiz-note { font-size: 0.78rem; color: var(--text-3); }

/* ── Calculating Screen ── */
.calc-inner { text-align: center; }
.calc-animation {
  width: 140px; height: 140px;
  margin: 0 auto 2rem; position: relative;
}
.calc-pentagon { width: 100%; height: 100%; }
.calc-pentagon polygon:first-child {
  animation: drawPentagon 1.2s ease-in-out forwards;
}
.calc-fill {
  opacity: 0;
  animation: fillPentagon 0.6s ease-in-out 1s forwards;
}
.calc-sub { color: var(--text-2); font-size: 0.95rem; }

@keyframes drawPentagon {
  to { stroke-dashoffset: 0; }
}
@keyframes fillPentagon {
  to { opacity: 1; }
}

/* ── Results Screen ── */
.results-section {
  margin-bottom: 3rem;
  padding-bottom: 2rem;
}
.results-section + .results-section {
  border-top: 1px solid var(--border);
  padding-top: 2.5rem;
}

.section-divider {
  text-align: center; margin-bottom: 2rem;
}
.section-divider span {
  display: inline-block;
  font-size: 0.82rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-2);
  padding: 0.4rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
}

/* Score Circle */
.score-hero { display: flex; justify-content: center; margin: 2rem 0; }
.score-circle {
  position: relative; width: 140px; height: 140px;
}
.score-circle svg { width: 100%; height: 100%; }
#score-ring, #team-score-ring {
  transition: stroke-dashoffset 1.5s cubic-bezier(0.4, 0, 0.2, 1) 0.2s, stroke 0.4s ease;
}
.score-value {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.score-number { font-size: 2.2rem; font-weight: 800; line-height: 1; }
.score-unit { font-size: 1rem; font-weight: 600; opacity: 0.5; margin-left: 1px; }
.score-label {
  font-size: 0.72rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-3); margin-top: 0.25rem;
}

/* Spider Chart */
.chart-container {
  max-width: 380px; margin: 0 auto 2.5rem;
}
.chart-container svg { width: 100%; height: auto; }
.chart-data-animate {
  animation: chartGrow 0.8s ease-out 0.3s backwards;
}
@keyframes chartGrow {
  from { opacity: 0; transform: scale(0.4); transform-origin: center; }
  to { opacity: 1; transform: scale(1); transform-origin: center; }
}

/* Radar Breakdowns */
.radar-breakdowns {
  display: flex; flex-direction: column; gap: 1rem;
}
.breakdown-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  text-align: left;
  animation: fadeSlideIn 0.4s ease backwards;
}
.breakdown-card:nth-child(2) { animation-delay: 0.08s; }
.breakdown-card:nth-child(3) { animation-delay: 0.16s; }
.breakdown-card:nth-child(4) { animation-delay: 0.24s; }
.breakdown-card:nth-child(5) { animation-delay: 0.32s; }

.breakdown-header {
  display: flex; align-items: center; gap: 0.6rem;
  margin-bottom: 0.85rem;
}
.breakdown-emoji { font-size: 1.2rem; }
.breakdown-name { font-size: 0.92rem; font-weight: 600; flex: 1; }
.breakdown-score { font-size: 1.1rem; font-weight: 800; }

.breakdown-bar {
  height: 5px; background: rgba(255,255,255,0.06);
  border-radius: 10px; overflow: hidden;
  margin-bottom: 1rem;
}
.breakdown-fill {
  height: 100%; border-radius: 10px;
  transition: width 1s ease 0.3s;
}

.breakdown-insight { margin-top: 0.5rem; }
.insight-text {
  font-size: 0.88rem; color: var(--text-2);
  line-height: 1.65; font-style: italic;
  margin-bottom: 0.75rem;
}
.insight-action {
  font-size: 0.85rem; color: var(--text-2);
  line-height: 1.6;
  padding: 0.75rem 1rem;
  background: rgba(27,154,170,0.06);
  border-left: 3px solid var(--teal);
  border-radius: 0 8px 8px 0;
}
.insight-action strong { color: var(--teal); }

/* Breakdown comparison (team view) */
.breakdown-comparison {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.82rem; color: var(--text-3);
  margin-top: 0.5rem; padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}
.diff { font-weight: 600; }
.diff.positive { color: var(--green); }
.diff.negative { color: var(--red); }

/* ── Team Waiting ── */
.team-waiting { text-align: center; padding: 2rem 0; }
.team-waiting h3 { color: var(--text-2); font-weight: 600; margin-bottom: 0.5rem; }
.team-waiting p { color: var(--text-3); font-size: 0.88rem; margin-bottom: 1.5rem; }

.waiting-dots {
  display: flex; justify-content: center; gap: 6px;
  margin-bottom: 1.25rem;
}
.waiting-dots span {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--teal);
  animation: waitDot 1.4s ease-in-out infinite;
}
.waiting-dots span:nth-child(2) { animation-delay: 0.2s; }
.waiting-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes waitDot {
  0%,80%,100% { opacity: 0.2; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1.1); }
}

.team-members-status {
  display: flex; flex-direction: column; gap: 0.5rem;
  max-width: 300px; margin: 0 auto;
}
.member-status {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.5rem 0.85rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.85rem;
}
.member-dot {
  width: 8px; height: 8px; border-radius: 50;
  flex-shrink: 0;
}
.member-status.done .member-dot { background: var(--green); }
.member-status.in-progress .member-dot {
  background: var(--yellow);
  animation: pulse-dot 2s ease-in-out infinite;
}
.member-name { flex: 1; font-weight: 500; }
.member-state { font-size: 0.78rem; color: var(--text-3); }

.team-unavailable {
  color: var(--text-3); font-size: 0.88rem;
  font-style: italic; padding: 1rem 0;
}

/* ── Team Insight Card ── */
.team-insight-card {
  background: rgba(27,154,170,0.06);
  border: 1px solid rgba(27,154,170,0.2);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem; text-align: left;
}
.team-insight-card .insight-label {
  font-size: 0.72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--teal); margin-bottom: 0.6rem;
}
.team-insight-card p {
  font-size: 0.9rem; color: var(--text-2);
  line-height: 1.65;
}

/* ── CTA Section ── */
.cta-section { text-align: center; }
.cta-card {
  background: linear-gradient(135deg, rgba(27,154,170,0.08), rgba(27,154,170,0.02));
  border: 1px solid rgba(27,154,170,0.2);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  margin-bottom: 2rem;
}
.cta-card h3 { margin-bottom: 1rem; }
.cta-card > p {
  font-size: 0.92rem; color: var(--text-2);
  line-height: 1.7; max-width: 460px;
  margin: 0 auto 1.5rem;
}
.cta-perks {
  list-style: none; text-align: left;
  max-width: 340px; margin: 0 auto 2rem;
}
.cta-perks li {
  font-size: 0.88rem; color: var(--text-2);
  padding: 0.3rem 0;
  display: flex; align-items: center; gap: 0.5rem;
}
.cta-perks li::before {
  content: '\2713';
  color: var(--teal); font-weight: 700; font-size: 0.82rem;
  flex-shrink: 0;
}
.cta-contact {
  font-size: 0.82rem; color: var(--text-3); margin-top: 1rem;
}

.powered-by {
  padding: 1.5rem 0;
}
.powered-by p { font-size: 0.82rem; color: var(--text-3); margin-bottom: 0.5rem; }
.research-note { font-size: 0.75rem !important; font-style: italic; }
.restart-link {
  background: none; border: none;
  color: var(--text-3); font-family: inherit;
  font-size: 0.82rem; cursor: pointer;
  margin-top: 0.75rem;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius);
  transition: color 0.2s;
}
.restart-link:hover { color: var(--teal); }

/* ── Animations ── */
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .screen { padding: 1.5rem 1rem; }
  .results-inner { padding-bottom: 3rem; }
  h1 { font-size: 1.8rem; }
  .input-group { max-width: 100%; }
  .quiz-header { flex-direction: column; gap: 0.5rem; align-items: flex-start; }
  .question-text { font-size: 1.1rem; }
  .answer-btn { padding: 0.85rem 1rem; font-size: 0.9rem; }
  .chart-container { max-width: 320px; }
  .cta-card { padding: 1.75rem 1.25rem; }
  .breakdown-card { padding: 1rem 1.15rem; }
  .radar-pills { gap: 0.4rem; }
  .radar-pill { font-size: 0.75rem; padding: 0.3rem 0.65rem; }
  .score-circle { width: 120px; height: 120px; }
  .score-number { font-size: 1.8rem; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }
