/* ============================================================
   THERMIPRO LYON — COMPONENTS.CSS
   Composants réutilisables, utilitaires visuels
   ============================================================ */

/* ─── CERTIFICATIONS STRIP ──────────────────────────────── */
.certifs-strip {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
}

.certif-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: white;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
  color: var(--neutral-700);
  box-shadow: var(--shadow-xs);
  transition: all var(--transition-fast);
}

.certif-pill svg { color: var(--color-accent); }

.certif-pill:hover {
  border-color: var(--accent-400);
  color: var(--accent-600);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

/* ─── RATING STARS COMPOSANT ────────────────────────────── */
.stars-group {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.stars-group svg {
  color: #FBBF24;
  transition: transform var(--transition-fast);
}

.stars-group:hover svg { transform: scale(1.15); }

/* ─── PILL TAGS ──────────────────────────────────────────── */
.pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 0.25em 0.75em;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--fw-medium);
  line-height: 1;
}

.pill-blue    { background: var(--primary-100); color: var(--primary-700); }
.pill-orange  { background: #FEF0E6; color: var(--secondary-700); }
.pill-cyan    { background: #E0F8FF; color: var(--accent-700); }
.pill-gray    { background: var(--neutral-100); color: var(--neutral-600); }

/* ─── CARDS GÉNÉRIQUES ───────────────────────────────────── */
.card {
  background: white;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: all var(--transition-base);
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

.card-body { padding: var(--space-6); }

.card-footer {
  padding: var(--space-4) var(--space-6);
  background: var(--neutral-50);
  border-top: 1px solid var(--color-border);
}

/* ─── ICON BOX ───────────────────────────────────────────── */
.icon-box {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
}

.icon-box-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--primary-50);
  color: var(--color-primary);
}

.icon-box-icon.lg {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-xl);
}

.icon-box-icon.round { border-radius: 50%; }
.icon-box-icon.filled { background: var(--color-primary); color: white; }
.icon-box-icon.outlined {
  background: transparent;
  border: 2px solid var(--color-primary);
}

.icon-box-content h4 {
  margin-bottom: var(--space-1);
  font-size: var(--text-base);
}

.icon-box-content p {
  font-size: var(--text-sm);
  color: var(--neutral-500);
  margin: 0;
}

/* ─── GRADIENT BACKGROUNDS ───────────────────────────────── */
.bg-gradient-primary {
  background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-900) 100%);
}

.bg-gradient-dark {
  background: linear-gradient(135deg, var(--neutral-800) 0%, var(--neutral-900) 100%);
}

.bg-gradient-warm {
  background: linear-gradient(135deg, #FFF7ED 0%, #FFEDD5 100%);
}

/* ─── GLASSMORPHISM ──────────────────────────────────────── */
.glass {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-xl);
}

.glass-dark {
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-xl);
}

/* ─── DIVIDERS ───────────────────────────────────────────── */
.divider {
  border: none;
  border-top: 1px solid var(--color-border);
  margin-block: var(--space-6);
}

.divider-dashed { border-top-style: dashed; }

.divider-with-text {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  color: var(--neutral-400);
  font-size: var(--text-sm);
}

.divider-with-text::before,
.divider-with-text::after {
  content: '';
  flex: 1;
  border-top: 1px solid var(--color-border);
}

/* ─── ALERT / NOTICE ─────────────────────────────────────── */
.alert {
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  border: 1px solid transparent;
}

.alert svg { flex-shrink: 0; margin-top: 1px; }

.alert-info    { background: var(--primary-50); border-color: var(--primary-200); color: var(--primary-800); }
.alert-success { background: #D1FAE5; border-color: #6EE7B7; color: #065F46; }
.alert-warning { background: #FEF3C7; border-color: #FDE68A; color: #92400E; }
.alert-error   { background: #FEE2E2; border-color: #FECACA; color: #991B1B; }

/* ─── SPINNER / LOADER ───────────────────────────────────── */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.spinner-primary {
  border-color: var(--primary-200);
  border-top-color: var(--color-primary);
}

/* ─── SKELETON LOADER ────────────────────────────────────── */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--neutral-200) 25%,
    var(--neutral-100) 50%,
    var(--neutral-200) 75%
  );
  background-size: 200% 100%;
  border-radius: var(--radius-md);
  animation: skeleton-wave 1.5s ease-in-out infinite;
}

@keyframes skeleton-wave {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ─── TOOLTIP ────────────────────────────────────────────── */
[data-tooltip] {
  position: relative;
  cursor: help;
}

[data-tooltip]::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--neutral-800);
  color: white;
  font-size: var(--text-xs);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast);
  z-index: 10;
}

[data-tooltip]::after {
  content: '';
  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: var(--neutral-800);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast);
}

[data-tooltip]:hover::before,
[data-tooltip]:hover::after { opacity: 1; }

/* ─── PROGRESS BAR ───────────────────────────────────────── */
.progress-bar {
  height: 8px;
  background: var(--neutral-200);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary), var(--primary-400));
  border-radius: var(--radius-full);
  transition: width 1.2s ease-out;
}

/* ─── SECTION WAVE ───────────────────────────────────────── */
.wave-bottom {
  position: relative;
}

.wave-bottom::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 60px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 60'%3E%3Cpath fill='%23ffffff' d='M0,60L1440,0L1440,60L0,60Z'/%3E%3C/svg%3E");
  background-size: cover;
}

/* ─── FLOATING LABEL FORM ────────────────────────────────── */
.form-floating {
  position: relative;
}

.form-floating .form-input {
  padding-top: 1.5em;
  padding-bottom: 0.5em;
}

.form-floating .form-label {
  position: absolute;
  top: 50%;
  left: 1em;
  transform: translateY(-50%);
  transition: all var(--transition-fast);
  pointer-events: none;
  color: var(--neutral-400);
  font-weight: var(--fw-normal);
  font-size: var(--text-sm);
}

.form-floating .form-input:focus ~ .form-label,
.form-floating .form-input:not(:placeholder-shown) ~ .form-label {
  top: 0.75em;
  transform: none;
  font-size: var(--text-xs);
  font-weight: var(--fw-semibold);
  color: var(--color-primary);
}

/* ─── BACK TO TOP ────────────────────────────────────────── */
.back-to-top {
  position: fixed;
  bottom: var(--space-6);
  left: var(--space-6);
  z-index: 299;
  width: 48px;
  height: 48px;
  background: var(--color-primary);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(20px);
  transition: all var(--transition-base);
  pointer-events: none;
}

.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

.back-to-top:hover {
  background: var(--primary-700);
  transform: translateY(-3px);
}

/* ─── COOKIE BANNER ──────────────────────────────────────── */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--neutral-900);
  color: white;
  padding: var(--space-6);
  transform: translateY(100%);
  transition: transform var(--transition-slow);
  box-shadow: 0 -10px 30px rgba(0,0,0,0.3);
}

.cookie-banner.visible { transform: translateY(0); }

.cookie-banner-inner {
  max-width: var(--container-max);
  margin: auto;
  display: flex;
  align-items: center;
  gap: var(--space-6);
  flex-wrap: wrap;
}

.cookie-text {
  flex: 1;
  font-size: var(--text-sm);
  color: rgba(255,255,255,0.7);
  min-width: 200px;
}

.cookie-text a { color: var(--primary-300); }

.cookie-actions {
  display: flex;
  gap: var(--space-3);
  flex-shrink: 0;
}

.cookie-btn {
  padding: 0.6em 1.5em;
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--transition-fast);
}

.cookie-btn-accept {
  background: var(--color-primary);
  color: white;
}

.cookie-btn-accept:hover { background: var(--primary-700); }

.cookie-btn-refuse {
  background: transparent;
  color: rgba(255,255,255,0.7);
  border-color: rgba(255,255,255,0.3);
}

.cookie-btn-refuse:hover {
  border-color: rgba(255,255,255,0.6);
  color: white;
}

/* ─── PRELOADER ──────────────────────────────────────────── */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--neutral-900);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: var(--space-6);
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.preloader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.preloader-logo {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: var(--fw-extrabold);
  color: white;
}

.preloader-logo span { color: var(--color-secondary); }

.preloader-bar {
  width: 200px;
  height: 3px;
  background: rgba(255,255,255,0.1);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.preloader-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
  border-radius: var(--radius-full);
  animation: preloader-fill 1.5s ease-out forwards;
}

@keyframes preloader-fill {
  from { width: 0; }
  to { width: 100%; }
}

/* ─── NOTIFICATION TOAST ─────────────────────────────────── */
.toast-container {
  position: fixed;
  top: var(--space-6);
  right: var(--space-6);
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  pointer-events: none;
}

.toast {
  background: white;
  border-radius: var(--radius-xl);
  padding: var(--space-4) var(--space-5);
  box-shadow: var(--shadow-xl);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 300px;
  max-width: 420px;
  transform: translateX(120%);
  transition: transform var(--transition-spring);
  pointer-events: all;
  border-left: 4px solid var(--color-primary);
}

.toast.visible { transform: translateX(0); }

.toast-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-lg);
  background: var(--primary-50);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.toast-title {
  font-weight: var(--fw-semibold);
  font-size: var(--text-sm);
  color: var(--neutral-800);
}

.toast-desc {
  font-size: var(--text-xs);
  color: var(--neutral-500);
}

.toast-close {
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--neutral-400);
  padding: var(--space-1);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.toast-close:hover { background: var(--neutral-100); color: var(--neutral-700); }

/* ─── FAQ ACCORDION ──────────────────────────────────────── */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.faq-item {
  background: white;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: all var(--transition-fast);
}

.faq-item.open {
  border-color: var(--primary-200);
  box-shadow: var(--shadow-md);
}

.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-5) var(--space-6);
  cursor: pointer;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--fw-semibold);
  color: var(--neutral-800);
  transition: color var(--transition-fast);
}

.faq-question:hover { color: var(--color-primary); }

.faq-item.open .faq-question { color: var(--color-primary); }

.faq-chevron {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--neutral-400);
  transition: transform var(--transition-base);
}

.faq-item.open .faq-chevron {
  transform: rotate(180deg);
  color: var(--color-primary);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0, 1, 0, 1);
}

.faq-item.open .faq-answer {
  max-height: 500px;
  transition: max-height 0.6s ease-out;
}

.faq-answer-inner {
  padding: 0 var(--space-6) var(--space-5);
  color: var(--neutral-600);
  font-size: var(--text-sm);
  line-height: 1.75;
}

/* ─── PROCESS STEPS ──────────────────────────────────────── */
.process-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-6);
  position: relative;
}

.process-steps::before {
  content: '';
  position: absolute;
  top: 32px;
  left: calc(12.5% + 32px);
  right: calc(12.5% + 32px);
  height: 2px;
  background: linear-gradient(90deg, var(--color-primary), var(--primary-300));
  z-index: 0;
}

.process-step {
  text-align: center;
  position: relative;
  z-index: 1;
}

.process-step-number {
  width: 64px;
  height: 64px;
  background: white;
  border: 3px solid var(--color-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: var(--fw-extrabold);
  font-size: var(--text-2xl);
  color: var(--color-primary);
  margin: 0 auto var(--space-4);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
}

.process-step:hover .process-step-number {
  background: var(--color-primary);
  color: white;
  transform: scale(1.1);
  box-shadow: var(--shadow-primary);
}

.process-step h4 {
  font-size: var(--text-base);
  margin-bottom: var(--space-2);
}

.process-step p {
  font-size: var(--text-sm);
}

@media (max-width: 768px) {
  .process-steps {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-6);
  }

  .process-steps::before { display: none; }
}

@media (max-width: 480px) {
  .process-steps { grid-template-columns: 1fr; }
}
