:root {
  --background: #07070a;
  --foreground: #f4f4f5;
  --accent: #6ee7b7;
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-fade-up {
  animation: fade-up 0.8s ease-out both;
}

.stat-card h3 { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: #71717a; }
.stat-card p { margin-top: 0.5rem; font-size: 1.25rem; font-weight: 600; color: #6ee7b7; }

/* ── Prédictions historiques (predictions.js → classes at-pred-*) ── */
.predictions-container {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .predictions-container {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1200px) {
  .predictions-container {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.at-pred-wrap {
  min-width: 0;
  display: flex;
}

.at-pred-card {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.05) 0%, rgba(0, 0, 0, 0.45) 100%);
  padding: 1.25rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

.at-pred-card--cta {
  border-color: rgba(110, 231, 183, 0.28);
  background: linear-gradient(145deg, rgba(110, 231, 183, 0.1) 0%, rgba(0, 0, 0, 0.5) 55%);
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 22rem;
  padding: 2rem 1.5rem;
}

.at-pred-date {
  margin: 0 2rem 1rem 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #6ee7b7;
  letter-spacing: -0.01em;
}

.at-pred-info {
  position: absolute;
  top: 1rem;
  right: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.06);
  color: #a1a1aa;
  cursor: pointer;
  font-size: 0.75rem;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.at-pred-info:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.at-pred-table {
  flex: 1;
}

.at-pred-row {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 2.75rem 2.75rem !important;
  gap: 0.5rem !important;
  align-items: center !important;
  padding: 0.45rem 0.5rem;
  border-radius: 0.5rem;
  font-size: 0.8125rem;
  line-height: 1.2;
}

.at-pred-row + .at-pred-row:not(.at-pred-row--head) {
  margin-top: 0.125rem;
}

.at-pred-row--head {
  margin-bottom: 0.375rem;
  padding-bottom: 0.625rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #71717a;
}

.at-pred-row--head span:nth-child(2),
.at-pred-row--head span:nth-child(3) {
  text-align: center;
}

.at-pred-row--highlight {
  background: rgba(110, 231, 183, 0.08);
  outline: 1px solid rgba(110, 231, 183, 0.18);
}

.at-pred-ticker {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #f4f4f5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.at-pred-signal,
.at-pred-result {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.at-pred-muted {
  color: #52525b;
  font-size: 0.875rem;
}

.at-pred-icon {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 0.4375rem;
  font-size: 0.75rem;
}

.at-pred-icon--up {
  background: rgba(52, 211, 153, 0.15);
  color: #34d399;
}

.at-pred-icon--down {
  background: rgba(251, 113, 133, 0.15);
  color: #fb7185;
}

.at-pred-icon--ok {
  background: rgba(52, 211, 153, 0.12);
  color: #34d399;
}

.at-pred-icon--ko {
  background: rgba(251, 113, 133, 0.12);
  color: #fb7185;
}

.at-pred-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
  padding-top: 0.875rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.8125rem;
  color: #a1a1aa;
}

.at-pred-stat {
  color: #f4f4f5;
  font-weight: 600;
}

.at-pred-pnl {
  font-weight: 600;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.8125rem;
}

.at-pred-pnl--pos {
  color: #34d399;
}

.at-pred-pnl--neg {
  color: #fb7185;
}

.at-pred-cta-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  margin-bottom: 1rem;
  border-radius: 9999px;
  background: rgba(110, 231, 183, 0.12);
  color: #6ee7b7;
  font-size: 1.25rem;
}

.at-pred-cta-title {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
  font-weight: 600;
  color: #fff;
}

.at-pred-cta-desc {
  margin: 0 auto 1.25rem;
  max-width: 16rem;
  font-size: 0.875rem;
  line-height: 1.55;
  color: #a1a1aa;
}

.at-pred-cta-actions {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  width: 100%;
  max-width: 14rem;
}

.at-pred-btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.625rem 1.25rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none !important;
  transition: opacity 0.2s, background 0.2s, border-color 0.2s;
}

.at-pred-btn--primary {
  background: #fff !important;
  color: #000 !important;
}

.at-pred-btn--primary:hover {
  opacity: 0.92;
}

.at-pred-btn--ghost {
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  background: transparent !important;
  color: #fff !important;
}

.at-pred-btn--ghost:hover {
  border-color: rgba(255, 255, 255, 0.35) !important;
  background: rgba(255, 255, 255, 0.05) !important;
}

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

.box-appear {
  animation: atPredAppear 0.45s ease-out both;
}

#more.hidden {
  display: none !important;
}

#more:not(.hidden) {
  display: block;
}

/* ── Pill tabs (auth + langue) — slide sur les boutons uniquement ── */
.pill-tabs-track {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.25rem;
  padding: 0.25rem;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
}

.pill-tabs--sm .pill-tabs-track {
  gap: 0.125rem;
  padding: 0.125rem;
}

.pill-tab-btn {
  position: relative;
  z-index: 1;
  border: none;
  background: transparent;
  border-radius: 9999px;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  color: #a1a1aa;
  cursor: pointer;
  transition: color 0.25s ease;
}

.pill-tabs--sm .pill-tab-btn {
  padding: 0.35rem 0.65rem;
  font-size: 0.75rem;
  min-width: 2.25rem;
}

.pill-tab-btn.is-active {
  color: #000;
  font-weight: 500;
}

.pill-tabs-indicator {
  position: absolute;
  top: 0.25rem;
  bottom: 0.25rem;
  left: 0.25rem;
  width: calc(50% - 0.25rem);
  border-radius: 9999px;
  background: #fff;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.pill-tabs--sm .pill-tabs-indicator {
  top: 0.125rem;
  bottom: 0.125rem;
  left: 0.125rem;
  width: calc(50% - 0.125rem);
}

/* Formulaires auth : bascule instantanée, pas de swipe */
.auth-form-panel {
  display: none;
}

.auth-form-panel.is-active {
  display: block;
  animation: authPanelIn 0.2s ease-out;
}

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

@media (prefers-reduced-motion: reduce) {
  .pill-tabs-indicator,
  .auth-form-panel.is-active {
    transition: none;
    animation: none;
  }
}

.skeleton {
  background: linear-gradient(90deg, #1a1a1f 25%, #27272a 50%, #1a1a1f 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 0.5rem;
}
.skeleton.box { min-height: 120px; }
.skeleton.stat { display: inline-block; min-width: 3rem; min-height: 1rem; }

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

#info-popup-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,0.7);
  display: flex; align-items: center; justify-content: center;
}
#info-popup-overlay.hidden { display: none; }
#info-popup {
  background: #111; border: 1px solid rgba(255,255,255,0.1);
  border-radius: 1rem; padding: 1.5rem; max-width: 400px; position: relative;
}
#info-popup .close-btn {
  position: absolute; top: 0.75rem; right: 0.75rem;
  background: none; border: none; color: #71717a; cursor: pointer; font-size: 1.25rem;
}

.modal { display: none; position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,0.7); }
.modal-content {
  margin: 15% auto; max-width: 420px;
  background: #111; border: 1px solid rgba(255,255,255,0.1);
  border-radius: 1rem; padding: 1.5rem;
}

.faq-answer { display: none; }
.faq-question.active + .faq-answer { display: block; }

.stat-card {
  border-radius: 0.75rem;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.03);
  padding: 1rem;
}

/* ── Graphique performance (Chart.js) ── */
.at-chart-card {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 24px 48px rgba(0, 0, 0, 0.35);
}

.at-chart-wrap {
  isolation: isolate;
}

.at-chart-wrap canvas {
  display: block;
}

#chart-delta-badges span {
  white-space: nowrap;
}
