/**
 * Cartoon French — Placement Test UI
 */

body.placement-page {
  background:
    radial-gradient(ellipse 80% 50% at 10% -5%, rgba(20, 184, 166, 0.14), transparent 55%),
    radial-gradient(ellipse 60% 40% at 90% 10%, rgba(56, 189, 248, 0.08), transparent 50%),
    var(--bg, #020617);
}
[data-theme="light"] body.placement-page {
  background:
    radial-gradient(ellipse 80% 50% at 10% -5%, rgba(20, 184, 166, 0.1), transparent 55%),
    #f4f7f9;
}

.placement-section {
  padding-top: 1.25rem !important;
  padding-bottom: 4rem !important;
}

/* Hero */
.placement-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin-bottom: 1.35rem;
  padding: 1.2rem 1.35rem;
  border-radius: 20px;
  border: 1px solid rgba(20, 184, 166, 0.22);
  background:
    linear-gradient(135deg, rgba(20, 184, 166, 0.1) 0%, rgba(56, 189, 248, 0.04) 55%, transparent 100%),
    rgba(15, 23, 42, 0.35);
  animation: plRise 0.55s cubic-bezier(0.16, 1, 0.3, 1) both;
}
[data-theme="light"] .placement-hero {
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.1), #fff 55%);
  box-shadow: 0 14px 36px -18px rgba(15, 23, 42, 0.12);
}

.placement-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--teal, #14b8a6);
  background: rgba(20, 184, 166, 0.12);
  border: 1px solid rgba(20, 184, 166, 0.28);
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  margin-bottom: 0.55rem;
}

.placement-title {
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 3.2vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin: 0 0 0.35rem;
  line-height: 1.2;
}

.placement-lead {
  margin: 0;
  max-width: 52ch;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.55;
}

.placement-hero-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.85rem;
}
.placement-hero-pills span {
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-line);
  color: var(--muted);
}
[data-theme="light"] .placement-hero-pills span {
  background: #fff;
  border-color: rgba(15, 23, 42, 0.08);
}

.placement-hero-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 96px;
  padding: 0.85rem 1rem;
  border-radius: 16px;
  background: rgba(20, 184, 166, 0.1);
  border: 1px solid rgba(20, 184, 166, 0.28);
}
.placement-hero-stat strong {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--teal, #14b8a6);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.placement-hero-stat span {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
  margin-top: 0.25rem;
}

@keyframes plRise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Shell */
.placement-shell {
  border-radius: 22px;
  border: 1px solid rgba(20, 184, 166, 0.18);
  background:
    radial-gradient(ellipse 70% 40% at 100% 0%, rgba(20, 184, 166, 0.08), transparent 55%),
    var(--surface, #0f172a);
  box-shadow: 0 20px 50px -18px rgba(0, 0, 0, 0.5);
  padding: 1.25rem 1.35rem 1.5rem;
  animation: plRise 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.08s both;
}
[data-theme="light"] .placement-shell {
  background: #fff;
  box-shadow: 0 20px 50px -20px rgba(15, 23, 42, 0.12);
}

.placement-progress-wrap {
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
[data-theme="light"] .placement-progress-wrap {
  border-bottom-color: rgba(15, 23, 42, 0.06);
}

.placement-progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 0.55rem;
}
.placement-progress-meta span:last-child {
  color: var(--muted);
  font-weight: 600;
}

.placement-progress-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}
[data-theme="light"] .placement-progress-track {
  background: rgba(15, 23, 42, 0.08);
}
.placement-progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #14b8a6, #38bdf8);
  box-shadow: 0 0 16px rgba(20, 184, 166, 0.45);
  transition: width 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.placement-level-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.75rem;
}
.pl-dot {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  opacity: 0.55;
  border: 1px solid transparent;
  transition: opacity 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.pl-dot.is-current {
  opacity: 1;
  transform: translateY(-1px);
  box-shadow: 0 0 14px rgba(20, 184, 166, 0.25);
}

/* Question card */
.placement-q-card {
  min-height: 280px;
}
.placement-q-card.placement-pop,
.placement-pop {
  animation: plPop 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes plPop {
  from { opacity: 0; transform: translateX(12px); }
  to { opacity: 1; transform: translateX(0); }
}

.placement-q-top {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.85rem;
}
.placement-q-num {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--muted);
  letter-spacing: 0.04em;
}
.placement-q-level {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
}

.placement-q-text {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 2.4vw, 1.4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0 0 1.15rem;
  line-height: 1.35;
}

.placement-options {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.placement-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.025);
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}
[data-theme="light"] .placement-option {
  background: rgba(15, 23, 42, 0.02);
  border-color: rgba(15, 23, 42, 0.1);
}
.placement-option:hover {
  transform: translateY(-1px);
  border-color: rgba(20, 184, 166, 0.4);
  background: rgba(20, 184, 166, 0.08);
}
.placement-option.is-selected {
  border-color: rgba(20, 184, 166, 0.55);
  background: rgba(20, 184, 166, 0.12);
  box-shadow: 0 0 0 1px rgba(20, 184, 166, 0.2), 0 10px 24px rgba(20, 184, 166, 0.12);
}
.placement-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.placement-option-key {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 800;
  background: rgba(20, 184, 166, 0.12);
  border: 1px solid rgba(20, 184, 166, 0.28);
  color: #5eead4;
}
[data-theme="light"] .placement-option-key {
  color: #0f766e;
}
.placement-option-text {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.4;
}

/* Nav */
.placement-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1.35rem;
  padding-top: 1.1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  flex-wrap: wrap;
}
[data-theme="light"] .placement-nav {
  border-top-color: rgba(15, 23, 42, 0.06);
}
.placement-nav-center {
  display: flex;
  gap: 0.5rem;
}
.placement-nav .btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.placement-skip-hint {
  font-size: 0.82rem !important;
}

/* Result */
.placement-result {
  margin-top: 1.35rem;
}
.placement-result-inner {
  border-radius: 22px;
  border: 1px solid rgba(20, 184, 166, 0.22);
  overflow: hidden;
  background: var(--surface, #0f172a);
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.55);
}
[data-theme="light"] .placement-result-inner {
  background: #fff;
  box-shadow: 0 24px 60px -24px rgba(15, 23, 42, 0.14);
}

.placement-result-hero {
  padding: 1.75rem 1.5rem 1.5rem;
  text-align: center;
  background:
    radial-gradient(ellipse 70% 60% at 50% 0%, rgba(20, 184, 166, 0.16), transparent 60%);
}

.placement-level-orb {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  margin: 0.85rem auto 1rem;
  border: 2px solid currentColor;
  box-shadow: 0 0 40px rgba(20, 184, 166, 0.25);
  animation: plOrb 2.8s ease-in-out infinite;
}
@keyframes plOrb {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}
.placement-level-orb strong {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
}
.placement-level-orb span {
  font-size: 0.7rem;
  font-weight: 700;
  margin-top: 0.35rem;
  opacity: 0.85;
  max-width: 9ch;
  line-height: 1.2;
}

.placement-result-advice {
  max-width: 48ch;
  margin: 0 auto 1.15rem;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

.placement-result-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.55rem;
}
.pl-meta-chip {
  min-width: 110px;
  padding: 0.65rem 0.85rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-line);
  text-align: center;
}
[data-theme="light"] .pl-meta-chip {
  background: #fff;
  border-color: rgba(15, 23, 42, 0.08);
}
.pl-meta-chip strong {
  display: block;
  font-size: 0.95rem;
  color: var(--ink);
  margin-bottom: 0.15rem;
}
.pl-meta-chip span {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 600;
}
.pl-meta-chip.conf-high { border-color: rgba(16, 185, 129, 0.4); }
.pl-meta-chip.conf-high strong { color: #34d399; }
.pl-meta-chip.conf-med { border-color: rgba(245, 158, 11, 0.4); }
.pl-meta-chip.conf-med strong { color: #fbbf24; }
.pl-meta-chip.conf-low { border-color: rgba(248, 113, 113, 0.4); }
.pl-meta-chip.conf-low strong { color: #fb7185; }

.placement-result-body {
  padding: 1.35rem 1.5rem 1.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
[data-theme="light"] .placement-result-body {
  border-top-color: rgba(15, 23, 42, 0.06);
}
.placement-result-body h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--ink);
  margin: 0 0 0.35rem;
}
.placement-result-body > .muted {
  font-size: 0.88rem;
  margin-bottom: 1rem;
  line-height: 1.55;
}

.pl-band-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-bottom: 1.35rem;
}
.pl-band {
  display: grid;
  grid-template-columns: 88px 1fr 44px;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.7rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid transparent;
  animation: plRise 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.pl-band:nth-child(1) { animation-delay: 0.05s; }
.pl-band:nth-child(2) { animation-delay: 0.1s; }
.pl-band:nth-child(3) { animation-delay: 0.15s; }
.pl-band:nth-child(4) { animation-delay: 0.2s; }
.pl-band:nth-child(5) { animation-delay: 0.25s; }
.pl-band:nth-child(6) { animation-delay: 0.3s; }
.pl-band:nth-child(7) { animation-delay: 0.35s; }
.pl-band.is-pass {
  border-color: rgba(16, 185, 129, 0.25);
  background: rgba(16, 185, 129, 0.06);
}
.pl-band.is-fail {
  border-color: rgba(248, 113, 113, 0.22);
  background: rgba(248, 113, 113, 0.05);
}
.pl-band-label {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  font-size: 0.78rem;
}
.pl-band-label strong {
  font-size: 0.88rem;
  color: var(--ink);
}
.pl-band-label span { color: var(--muted); }
.pl-band-track {
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}
[data-theme="light"] .pl-band-track {
  background: rgba(15, 23, 42, 0.08);
}
.pl-band-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #14b8a6, #34d399);
  transition: width 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.pl-band.is-fail .pl-band-track span {
  background: linear-gradient(90deg, #f87171, #fb923c);
}
.pl-band-pct {
  font-size: 0.78rem;
  font-weight: 800;
  text-align: right;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.placement-result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  justify-content: center;
}

/* Level pill colors reused */
.pill-a0 { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.pill-a1 { background: rgba(6, 182, 212, 0.15); color: #38bdf8; border: 1px solid rgba(6, 182, 212, 0.3); }
.pill-a2 { background: rgba(59, 130, 246, 0.15); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.3); }
.pill-b1 { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.pill-b2 { background: rgba(139, 92, 246, 0.15); color: #c084fc; border: 1px solid rgba(139, 92, 246, 0.3); }
.pill-c1 { background: rgba(236, 72, 153, 0.15); color: #f472b6; border: 1px solid rgba(236, 72, 153, 0.3); }
.pill-c2 { background: rgba(244, 63, 94, 0.15); color: #fb7185; border: 1px solid rgba(244, 63, 94, 0.3); }

.pl-dot-a0 { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.pl-dot-a1 { background: rgba(6, 182, 212, 0.15); color: #38bdf8; }
.pl-dot-a2 { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.pl-dot-b1 { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.pl-dot-b2 { background: rgba(139, 92, 246, 0.15); color: #c084fc; }
.pl-dot-c1 { background: rgba(236, 72, 153, 0.15); color: #f472b6; }
.pl-dot-c2 { background: rgba(244, 63, 94, 0.15); color: #fb7185; }

@media (max-width: 640px) {
  .placement-hero { padding: 1rem; }
  .placement-shell { padding: 1rem; }
  .placement-nav { justify-content: stretch; }
  .placement-nav .btn { flex: 1; justify-content: center; }
  .placement-skip-hint { width: 100%; }
  .pl-band {
    grid-template-columns: 72px 1fr 40px;
    gap: 0.45rem;
  }
  .placement-result-actions .btn {
    width: 100%;
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .placement-hero,
  .placement-shell,
  .placement-q-card.placement-pop,
  .placement-pop,
  .placement-level-orb,
  .pl-band {
    animation: none !important;
  }
  .placement-progress-fill,
  .pl-band-track span {
    transition: none !important;
  }
}
