/* ===== PREMIUM UX — animations, toast, célébrations, onboarding ===== */

:root {
  --ux-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ux-dur: 0.38s;
}

.screen {
  animation: uxScreenIn var(--ux-dur) var(--ux-ease) both;
}

@keyframes uxScreenIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.btn {
  transition: transform 0.2s var(--ux-ease), box-shadow 0.2s var(--ux-ease), background 0.2s;
}

.btn:active:not(:disabled) {
  transform: scale(0.97);
}

.btn-terra {
  box-shadow: 0 4px 14px rgba(212, 88, 26, 0.28);
}

.btn-terra:hover {
  box-shadow: 0 6px 20px rgba(212, 88, 26, 0.38);
}

.modal.on {
  animation: uxModalIn 0.32s var(--ux-ease) both;
}

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

.modal.on .modal-box {
  animation: uxModalBoxIn 0.36s var(--ux-ease) both;
}

@keyframes uxModalBoxIn {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

/* Toast */
.ux-toast {
  position: fixed;
  bottom: calc(var(--nbh, 64px) + 1rem);
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  z-index: 9200;
  max-width: min(92vw, 360px);
  padding: 0.7rem 1rem;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text);
  background: var(--white);
  border: 0.5px solid var(--bd);
  box-shadow: var(--sh2);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s, transform 0.28s var(--ux-ease);
}

.ux-toast.on {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.ux-toast-ok { border-left: 3px solid var(--sage); }
.ux-toast-err { border-left: 3px solid var(--red); }

/* Célébration */
.ux-celebration {
  position: fixed;
  inset: 0;
  z-index: 9500;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 12, 8, 0.55);
  backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s;
}

.ux-celebration.on {
  opacity: 1;
  pointer-events: auto;
}

.ux-celebration-inner {
  text-align: center;
  padding: 2rem 1.5rem;
  background: var(--white);
  border-radius: var(--r);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
  animation: uxCelebratePop 0.5s var(--ux-ease) both;
  max-width: 320px;
  margin: 1rem;
}

@keyframes uxCelebratePop {
  0% { opacity: 0; transform: scale(0.85); }
  60% { transform: scale(1.04); }
  100% { opacity: 1; transform: scale(1); }
}

.ux-celebration-emoji {
  font-size: 2.8rem;
  margin-bottom: 0.5rem;
  animation: uxCelebrateBounce 0.6s 0.15s var(--ux-ease) both;
}

@keyframes uxCelebrateBounce {
  0%, 100% { transform: translateY(0); }
  40% { transform: translateY(-10px); }
}

.ux-celebration-t {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
}

.ux-celebration-s {
  font-size: 0.78rem;
  color: var(--text2);
  margin-top: 0.35rem;
  line-height: 1.5;
}

/* First EDL hero — valeur perçue */
.first-edl-hero {
  animation: uxHeroIn 0.55s var(--ux-ease) both;
  position: relative;
  overflow: hidden;
}

.first-edl-hero::before {
  content: '';
  position: absolute;
  inset: -50% -20%;
  background: radial-gradient(circle at 30% 20%, rgba(212, 88, 26, 0.15), transparent 55%);
  pointer-events: none;
}

@keyframes uxHeroIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.first-edl-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--terra);
  margin-bottom: 0.4rem;
}

.first-edl-steps {
  display: flex;
  gap: 0.35rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
}

.first-edl-step {
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--text2);
  background: rgba(255, 255, 255, 0.6);
  border: 0.5px solid var(--bd);
  border-radius: 100px;
  padding: 0.28rem 0.55rem;
}

.first-edl-step-num {
  color: var(--terra);
  font-weight: 800;
}

.dash-value-line {
  font-size: 0.72rem;
  color: var(--text2);
  line-height: 1.55;
  margin-top: 0.2rem;
  max-width: 28rem;
}

.dash-value-line strong {
  color: var(--terra);
  font-weight: 700;
}

/* Onboarding coach */
.onboarding-coach.on .onboarding-tooltip {
  animation: uxTooltipIn 0.4s var(--ux-ease) both;
}

@keyframes uxTooltipIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.onboarding-target-active {
  position: relative;
  z-index: 8100;
  box-shadow: 0 0 0 3px rgba(212, 88, 26, 0.45), 0 8px 24px rgba(0, 0, 0, 0.12);
  border-radius: var(--rsm);
  transition: box-shadow 0.25s var(--ux-ease);
}

.onboarding-step-item.current .onboarding-step-dot {
  background: var(--terra);
  color: #fff;
  animation: uxPulse 1.5s ease infinite;
}

@keyframes uxPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(212, 88, 26, 0.4); }
  50% { box-shadow: 0 0 0 6px rgba(212, 88, 26, 0); }
}

.onboarding-welcome-step .onboarding-step-title {
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

/* Empty states — aide contextuelle */
.empty .empty-s {
  line-height: 1.6;
}

/* Form errors inline */
.ux-field-hint {
  font-size: 0.65rem;
  color: var(--text3);
  margin-top: 0.25rem;
  line-height: 1.45;
}

.ai-result.ai-pending {
  border-color: rgba(24, 95, 165, 0.45);
  animation: aiPendingPulse 1.6s ease-in-out infinite;
}

.ai-result.ai-pending .ai-result-txt {
  color: var(--blue);
  font-weight: 600;
}

@keyframes aiPendingPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(24, 95, 165, 0.15); }
  50% { box-shadow: 0 0 0 6px rgba(24, 95, 165, 0); }
}

.photo-thumb.ai-analyzing::after {
  content: '🤖';
  position: absolute;
  bottom: 4px;
  left: 4px;
  font-size: 0.65rem;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 100px;
  padding: 1px 5px;
}
