/* JooL-QA — UI pro + responsive */

/* ——— Base ——— */
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
html.is-loading,
html.is-loading body {
  cursor: wait;
  overflow: hidden;
}
body {
  overflow-x: hidden;
  min-height: 100dvh;
}
img, svg, video {
  max-width: 100%;
  height: auto;
}

/* Safe area (iPhone notch / home indicator) */
.safe-px {
  padding-left: max(1rem, env(safe-area-inset-left));
  padding-right: max(1rem, env(safe-area-inset-right));
}
.safe-pb {
  padding-bottom: max(1rem, env(safe-area-inset-bottom));
}

/* ——— Loaders ——— */
.loader-spinner {
  width: 1.25rem;
  height: 1.25rem;
  border: 2.5px solid #d1fae5;
  border-top-color: #55aaa0;
  border-radius: 9999px;
  animation: spin 0.7s linear infinite;
  display: inline-block;
  flex-shrink: 0;
}
.loader-spinner-sm {
  width: 0.95rem;
  height: 0.95rem;
  border-width: 2px;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

.toast-enter {
  animation: toast-in 0.25s ease-out;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(-8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Toasts : full-width sur mobile */
#toast-root {
  left: 0.75rem;
  right: 0.75rem;
  top: max(0.75rem, env(safe-area-inset-top));
  max-width: none;
  width: auto;
}
@media (min-width: 640px) {
  #toast-root {
    left: auto;
    right: 1rem;
    width: 100%;
    max-width: 24rem;
  }
}

/* ——— Progress / status ——— */
.progress-track {
  height: 0.5rem;
  border-radius: 9999px;
  background: #e2e8f0;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 9999px;
  background: linear-gradient(90deg, #55aaa0, #7dcdc3);
  transition: width 0.4s ease;
}
.status-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 9999px;
  display: inline-block;
  flex-shrink: 0;
}
.status-dot-passed { background: #059669; }
.status-dot-failed { background: #dc2626; }
.status-dot-blocked { background: #d97706; }
.status-dot-untested { background: #94a3b8; }
.status-dot-na { background: #2563eb; }

/* ——— Accueil Monitor-like ——— */
.home-shell {
  min-height: 100dvh;
  background: #f0f0f0;
  position: relative;
  overflow-x: hidden;
}
.home-blob {
  position: absolute;
  border-radius: 9999px;
  filter: blur(2px);
  pointer-events: none;
  z-index: 0;
}
.home-blob-1 {
  width: min(55vw, 420px);
  height: min(55vw, 420px);
  background: radial-gradient(circle, rgba(125, 205, 195, 0.55) 0%, rgba(125, 205, 195, 0) 70%);
  top: -8%;
  right: -10%;
}
.home-blob-2 {
  width: min(45vw, 360px);
  height: min(45vw, 360px);
  background: radial-gradient(circle, rgba(85, 170, 160, 0.35) 0%, rgba(85, 170, 160, 0) 70%);
  bottom: 5%;
  right: 10%;
}
.home-blob-3 {
  width: min(40vw, 280px);
  height: min(40vw, 280px);
  background: radial-gradient(circle, rgba(167, 243, 208, 0.45) 0%, rgba(167, 243, 208, 0) 70%);
  top: 45%;
  left: -12%;
}
@media (max-width: 640px) {
  .home-blob-2 { display: none; }
  .home-blob-3 { opacity: 0.5; }
}

.glass-panel {
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow:
    0 8px 32px rgba(15, 23, 42, 0.06),
    0 1px 0 rgba(255, 255, 255, 0.8) inset;
}

.home-illustration {
  animation: float-y 5s ease-in-out infinite;
}
@keyframes float-y {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
@media (prefers-reduced-motion: reduce) {
  .home-illustration,
  .home-check-card {
    animation: none;
  }
}

/* ——— Nav mobile ——— */
.nav-desktop { display: none; }
.nav-mobile-toggle { display: inline-flex; }
@media (min-width: 768px) {
  .nav-desktop { display: flex; }
  .nav-mobile-toggle { display: none; }
}
.nav-mobile-panel {
  display: none;
}
.nav-mobile-panel.is-open {
  display: block;
}

/* ——— Fiche campagne : lignes résultats ——— */
.result-row {
  display: grid;
  gap: 0.75rem;
  padding: 1rem;
}
@media (min-width: 768px) {
  .result-row {
    grid-template-columns: 6.5rem 1fr minmax(12rem, 18rem) auto;
    align-items: start;
  }
}

/* Boutons full-width sur très petit écran */
@media (max-width: 380px) {
  .btn-stack-xs {
    width: 100%;
    justify-content: center;
  }
}

/* Table scroll hint */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}
.table-scroll table {
  min-width: 640px;
}

/* Forms : inputs jamais plus larges que le viewport */
form input,
form select,
form textarea {
  max-width: 100%;
}

input:focus, select:focus, textarea:focus, button:focus-visible {
  outline: none;
}

/* Sticky bottom bar (actions campagne mobile) */
.sticky-actions-mobile {
  position: sticky;
  bottom: 0;
  z-index: 30;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-top: 1px solid #e2e8f0;
  padding: 0.65rem 1rem;
  padding-bottom: max(0.65rem, env(safe-area-inset-bottom));
}
@media (min-width: 640px) {
  .sticky-actions-mobile { display: none; }
}
