:root {
  color-scheme: light;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  text-rendering: optimizeLegibility;
}

::selection {
  background: rgb(255 114 141 / 0.35);
}

/* --------------------------------------------------------------------------
   Cartes
   -------------------------------------------------------------------------- */
.card {
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  background: #ffffff;
  box-shadow: 0 1px 2px 0 rgb(15 23 42 / 0.04), 0 10px 30px -24px rgb(15 23 42 / 0.18);
}

.card-hover {
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.card-hover:hover {
  border-color: #cbd5e1;
  box-shadow: 0 1px 2px 0 rgb(15 23 42 / 0.04), 0 18px 36px -24px rgb(15 23 42 / 0.25);
  transform: translateY(-1px);
}

/* --------------------------------------------------------------------------
   Formulaires
   -------------------------------------------------------------------------- */
.field-label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #334155;
}

.field-input {
  display: block;
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 0.65rem;
  background: #ffffff;
  padding: 0.625rem 0.85rem;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: #0f172a;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.field-input::placeholder {
  color: #94a3b8;
}

.field-input:hover {
  border-color: #94a3b8;
}

.field-input:focus {
  outline: none;
  border-color: #ff4a63;
  box-shadow: 0 0 0 3px rgb(255 74 99 / 0.16);
}

.field-input:disabled {
  background: #f8fafc;
  color: #94a3b8;
  cursor: not-allowed;
}

textarea.field-input {
  min-height: 96px;
}

select.field-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-position: right 0.75rem center;
  background-repeat: no-repeat;
  background-size: 1rem;
  padding-right: 2.4rem;
}

.field-error {
  border-color: #f43f5e !important;
  background-color: #fff1f2;
}

.field-error:focus {
  border-color: #f43f5e !important;
  box-shadow: 0 0 0 3px rgb(244 63 94 / 0.14);
}

.field-error-text {
  margin-top: 0.35rem;
  font-size: 0.7rem;
  font-weight: 500;
  color: #e11d48;
}

.field-hint {
  margin-top: 0.35rem;
  font-size: 0.68rem;
  line-height: 1.5;
  color: #94a3b8;
}

input[type="checkbox"],
input[type="radio"] {
  accent-color: #ff4a63;
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

input[type="file"]::file-selector-button {
  cursor: pointer;
}

/* --------------------------------------------------------------------------
   Boutons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 1px solid transparent;
  border-radius: 0.65rem;
  padding: 0.625rem 1rem;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
  cursor: pointer;
}

.btn:active {
  transform: translateY(0.5px);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: #ff4a63;
  color: #0f172a;
  box-shadow: 0 1px 2px 0 rgb(255 74 99 / 0.35), 0 8px 18px -12px rgb(255 74 99 / 0.55);
}

.btn-primary:hover {
  background: #ff728d;
}

.btn-dark {
  background: #0f172a;
  color: #ffffff;
}

.btn-dark:hover {
  background: #1e293b;
}

.btn-secondary {
  background: #ffffff;
  border-color: #e2e8f0;
  color: #334155;
}

.btn-secondary:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.btn-danger-soft {
  background: #fff1f2;
  border-color: #fecdd3;
  color: #be123c;
}

.btn-danger-soft:hover {
  background: #ffe4e6;
  border-color: #fda4af;
}

.btn-sm {
  padding: 0.45rem 0.75rem;
  font-size: 0.75rem;
  border-radius: 0.55rem;
}

.btn-block {
  width: 100%;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2rem;
  width: 2rem;
  border-radius: 0.5rem;
  color: #64748b;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.icon-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.icon-btn-danger:hover {
  background: #fff1f2;
  color: #e11d48;
}

/* --------------------------------------------------------------------------
   Tableaux
   -------------------------------------------------------------------------- */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.table th {
  padding: 0.7rem 1rem;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
  text-align: left;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #94a3b8;
  white-space: nowrap;
}

.table td {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

.table tbody tr:last-child td {
  border-bottom: 0;
}

.table tbody tr {
  transition: background-color 0.12s ease;
}

.table tbody tr:hover {
  background: #f8fafc;
}

/* --------------------------------------------------------------------------
   Sidebar mobile
   -------------------------------------------------------------------------- */
#sidebar.sidebar-open {
  transform: translateX(0);
}

/* --------------------------------------------------------------------------
   Toasts
   -------------------------------------------------------------------------- */
.toast {
  animation: toast-in 0.3s cubic-bezier(0.21, 1.02, 0.73, 1);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast.toast-hide {
  opacity: 0;
  transform: translateX(12px);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* --------------------------------------------------------------------------
   Décor
   -------------------------------------------------------------------------- */
.bg-grid {
  background-image:
    linear-gradient(to right, rgb(255 255 255 / 0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgb(255 255 255 / 0.045) 1px, transparent 1px);
  background-size: 44px 44px;
}

::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #cbd5e1;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

#sidebar::-webkit-scrollbar-thumb {
  background: #334155;
}

/* --------------------------------------------------------------------------
   Mobile / PWA — confort tactile, débordements et zones de sécurité
   -------------------------------------------------------------------------- */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  overflow-x: hidden;
  overscroll-behavior-y: none;
}

img,
video,
canvas {
  max-width: 100%;
}

.break-anywhere {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Défilement horizontal localisé des tableaux, sans faire déborder la page. */
.table-scroll,
.table-responsive {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-scroll > .table,
.table-responsive > .table {
  min-width: 640px;
}

.mobile-tabbar {
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.mobile-tabbar a,
.mobile-tabbar button {
  min-height: 52px;
  -webkit-tap-highlight-color: transparent;
}

/* En mode application installée (iOS), le contenu commence sous l'encoche. */
@media (display-mode: standalone) {
  .mobile-header {
    padding-top: env(safe-area-inset-top, 0px);
  }

  .mobile-tabbar {
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  }
}

@media (max-width: 640px) {
  /* 16 px empêche Safari iOS de zoomer automatiquement au focus d'un champ. */
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  input[type="search"],
  input[type="tel"],
  input[type="url"],
  input[type="date"],
  select,
  textarea {
    font-size: 16px;
  }

  .btn {
    min-height: 44px;
  }

  .btn-sm {
    min-height: 40px;
  }

  .icon-btn {
    height: 44px;
    width: 44px;
  }

  .table th,
  .table td {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
}

/* --------------------------------------------------------------------------
   Formulaires de filtres : repliés derrière un bouton compact sur mobile
   -------------------------------------------------------------------------- */
.filter-form {
  padding: 1rem;
}

.filter-form-header {
  display: none;
}

.filter-form-toggle {
  display: none;
}

.filter-form-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: #ffe4ea;
  padding: 0.1rem 0.45rem;
  font-size: 0.625rem;
  font-weight: 800;
  color: #a61f36;
}

@media (max-width: 640px) {
  .filter-form {
    padding: 0;
  }

  .filter-form-body > .filter-form-title {
    display: none;
  }

  .filter-form-header {
    display: flex;
    align-items: center;
    gap: 0.25rem;
  }

  .filter-form-toggle {
    display: flex;
    flex: 1;
    min-width: 0;
    min-height: 52px;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 0.5rem 0.75rem 1rem;
    border-radius: 1rem;
    color: #0f172a;
    font-size: 0.8125rem;
    font-weight: 700;
    -webkit-tap-highlight-color: transparent;
  }

  .filter-form.is-open .filter-form-toggle {
    border-bottom-left-radius: 0;
  }

  .filter-form-reset {
    display: grid;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    place-items: center;
    border-radius: 999px;
    color: #64748b;
    -webkit-tap-highlight-color: transparent;
  }

  .filter-form-reset:hover {
    background: #f1f5f9;
    color: #0f172a;
  }

  .filter-form-body {
    display: none;
    border-top: 1px solid #f1f5f9;
    padding: 1rem;
  }

  .filter-form.is-open .filter-form-body {
    display: block;
  }

  .filter-form-chevron {
    transition: transform 0.15s ease;
  }

  .filter-form.is-open .filter-form-chevron {
    transform: rotate(180deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .filter-form-chevron {
    transition: none;
  }
}


/* Chantier Progress : comparaison avant / après d'un même angle. */
.comparison {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 14px;
  background: #0f172a;
}

.comparison img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.comparison-after {
  clip-path: inset(0 50% 0 0);
}

.comparison-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  transform: translateX(-50%);
  background: #ffffff;
  box-shadow: 0 0 10px rgb(0 0 0 / 0.45);
  pointer-events: none;
}

.comparison-range {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: ew-resize;
}

.comparison-label {
  position: absolute;
  bottom: 8px;
  max-width: 45%;
  padding: 4px 8px;
  border-radius: 7px;
  background: rgb(15 23 42 / 0.72);
  color: #ffffff;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.3;
  pointer-events: none;
}

.comparison-label-left { left: 8px; }
.comparison-label-right { right: 8px; }

/* --------------------------------------------------------------------------
   Chantier Progress : frise de l'historique photographique
   -------------------------------------------------------------------------- */
.photo-timeline {
  position: relative;
}

.photo-timeline::before {
  content: "";
  position: absolute;
  top: 18px;
  bottom: 18px;
  left: 17px;
  width: 1px;
  background: linear-gradient(to bottom, #e2e8f0 0%, #cbd5e1 50%, #e2e8f0 100%);
}

.photo-timeline-dot {
  box-shadow: 0 0 0 1px rgb(148 163 184 / 0.25), 0 2px 6px rgb(15 23 42 / 0.12);
}

@media (min-width: 640px) {
  .photo-timeline::before {
    left: 25px;
  }
}

/* --------------------------------------------------------------------------
   Chantier Progress : validation de l'avancement
   -------------------------------------------------------------------------- */
.validation-summary::-webkit-details-marker {
  display: none;
}

.validation-summary:hover {
  background: rgb(255 241 244 / 0.6);
}

.validation-panel[open] {
  border-color: #ffa3b7;
}

.validation-panel[open] .validation-summary svg {
  transform: rotate(180deg);
}

.percent-range {
  --fill: 0%;
  height: 8px;
  border-radius: 999px;
  appearance: none;
  background: linear-gradient(to right, #ff4a63 0 var(--fill), #e2e8f0 var(--fill) 100%);
  cursor: pointer;
}

.percent-range:focus {
  outline: none;
}

.percent-range:focus-visible {
  box-shadow: 0 0 0 3px rgb(255 74 99 / 0.2);
}

.percent-range::-webkit-slider-thumb {
  width: 18px;
  height: 18px;
  border: 2px solid #ff4a63;
  border-radius: 50%;
  appearance: none;
  background: #ffffff;
  box-shadow: 0 1px 5px rgb(15 23 42 / 0.22);
  cursor: grab;
}

.percent-range:active::-webkit-slider-thumb {
  cursor: grabbing;
  transform: scale(1.08);
}

.percent-range::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border: 2px solid #ff4a63;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 5px rgb(15 23 42 / 0.22);
  cursor: grab;
}

.percent-range:active::-moz-range-thumb {
  cursor: grabbing;
  transform: scale(1.08);
}

.percent-preset {
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  background: #ffffff;
  padding: 0.3rem 0.65rem;
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.percent-preset:hover {
  border-color: #ff728d;
  background: #fff1f4;
  color: #c8213d;
}

.percent-preset.is-active {
  border-color: #ff4a63;
  background: #ff4a63;
  color: #0f172a;
  box-shadow: 0 2px 6px rgb(255 74 99 / 0.28);
}

.validation-status {
  display: inline-flex;
  align-items: center;
  border-radius: 0.4rem;
  padding: 0.1rem 0.45rem;
  font-size: 10px;
  font-weight: 700;
}

.validation-status[data-status="done"] {
  background: #ecfdf5;
  color: #047857;
}

.validation-status[data-status="not_started"] {
  background: #f1f5f9;
  color: #475569;
}

.validation-status[data-status="in_progress"] {
  background: #fffbeb;
  color: #b45309;
}

/* --------------------------------------------------------------------------
   Onboarding : guide interactif selon le rôle
   -------------------------------------------------------------------------- */
.onboarding-launcher {
  position: fixed;
  right: 1rem;
  bottom: 5.5rem;
  z-index: 80;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid rgb(255 255 255 / 0.1);
  border-radius: 999px;
  padding: 0.55rem 0.9rem 0.55rem 0.55rem;
  background: #0f172a;
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 700;
  box-shadow: 0 16px 40px -18px rgb(15 23 42 / 0.65);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.onboarding-launcher:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 46px -18px rgb(15 23 42 / 0.75);
}

.onboarding-launcher-icon {
  display: grid;
  width: 1.9rem;
  height: 1.9rem;
  place-items: center;
  border-radius: 999px;
  background: #ff728d;
  color: #0f172a;
}

.onboarding-launcher-dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 999px;
  background: #ff728d;
  box-shadow: 0 0 0 3px rgb(255 114 141 / 0.18);
}

.onboarding-launcher-dot[hidden] {
  display: none;
}

/* Sur mobile, le guide devient un simple bouton rond au-dessus de la tabbar. */
@media (max-width: 640px) {
  .onboarding-launcher {
    right: 1rem;
    bottom: calc(4rem + env(safe-area-inset-bottom, 0px));
    width: 44px;
    height: 44px;
    justify-content: center;
    padding: 0;
  }

  .onboarding-launcher-label {
    display: none;
  }

  .onboarding-launcher-icon {
    width: 2rem;
    height: 2rem;
  }

  .onboarding-launcher-dot {
    position: absolute;
    top: -2px;
    right: -2px;
  }
}

@media (min-width: 1024px) {
  .onboarding-launcher {
    right: 1.5rem;
    bottom: 1.5rem;
  }
}

.onboarding-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgb(15 23 42 / 0.62);
  backdrop-filter: blur(4px);
}

.onboarding-dialog {
  width: min(580px, 100%);
  max-height: min(92vh, 780px);
  overflow-y: auto;
  border-radius: 1.5rem;
  background: #ffffff;
  box-shadow: 0 40px 90px -30px rgb(15 23 42 / 0.55);
}

.onboarding-hero {
  position: relative;
  overflow: hidden;
  padding: 1.5rem;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #ffffff;
}

.onboarding-hero-accent {
  position: absolute;
  top: -4rem;
  right: -3rem;
  width: 12rem;
  height: 12rem;
  border-radius: 999px;
  opacity: 0.2;
  pointer-events: none;
}

.onboarding-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  display: grid;
  width: 2.25rem;
  height: 2.25rem;
  place-items: center;
  border-radius: 0.7rem;
  color: rgb(255 255 255 / 0.7);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.onboarding-close:hover {
  background: rgb(255 255 255 / 0.1);
  color: #ffffff;
}

.onboarding-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: #ff728d;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.onboarding-title {
  position: relative;
  margin-top: 0.65rem;
  max-width: 26rem;
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.onboarding-description {
  position: relative;
  margin-top: 0.5rem;
  max-width: 28rem;
  color: rgb(226 232 240 / 0.8);
  font-size: 0.8125rem;
  line-height: 1.6;
}

.onboarding-meta {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
  font-size: 0.7rem;
  font-weight: 600;
}

.onboarding-meta > span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid rgb(255 255 255 / 0.12);
  border-radius: 999px;
  padding: 0.3rem 0.65rem;
  background: rgb(255 255 255 / 0.06);
  color: rgb(241 245 249 / 0.85);
}

.onboarding-role {
  border-color: rgb(255 114 141 / 0.4) !important;
  background: rgb(255 114 141 / 0.14) !important;
  color: #ffc9d5 !important;
}

.onboarding-body {
  padding: 1.25rem 1.5rem;
}

.onboarding-progress {
  height: 0.4rem;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
}

.onboarding-progress-bar {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(to right, #ff4a63, #ff728d);
  transition: width 0.3s ease;
}

.onboarding-steps {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1rem;
}

.onboarding-step-button {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.9rem;
  padding: 0.7rem 0.8rem;
  background: #ffffff;
  text-align: left;
  transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.15s ease;
}

.onboarding-step-button:hover {
  border-color: #ffa3b7;
  background: #fff1f4;
  transform: translateX(2px);
}

.onboarding-step-icon {
  position: relative;
  display: grid;
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
  place-items: center;
  border-radius: 0.7rem;
  background: #f1f5f9;
  color: #64748b;
}

.onboarding-step.is-complete .onboarding-step-icon {
  background: #ecfdf5;
  color: #047857;
}

.onboarding-step.is-complete .onboarding-step-icon svg {
  visibility: hidden;
}

.onboarding-step.is-complete .onboarding-step-icon::after {
  content: "✓";
  position: absolute;
  font-size: 0.9rem;
  font-weight: 800;
}

.onboarding-step-copy {
  display: block;
  min-width: 0;
  flex: 1;
}

.onboarding-step-title {
  display: block;
  font-size: 0.8125rem;
  font-weight: 700;
  color: #0f172a;
}

.onboarding-step-description {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.7rem;
  line-height: 1.5;
  color: #64748b;
}

.onboarding-step.is-complete .onboarding-step-title {
  color: #64748b;
  text-decoration: line-through;
}

.onboarding-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border-top: 1px solid #f1f5f9;
  padding: 1rem 1.5rem;
  background: #f8fafc;
}

.onboarding-auto {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.7rem;
  font-weight: 600;
  color: #64748b;
}

.onboarding-tour {
  position: fixed;
  inset: 0;
  z-index: 95;
  pointer-events: none;
}

.onboarding-tour-backdrop {
  position: absolute;
  inset: 0;
  background: rgb(15 23 42 / 0.62);
}

.onboarding-spotlight {
  position: absolute;
  z-index: 1;
  border: 2px solid #ff728d;
  border-radius: 0.9rem;
  box-shadow: 0 0 0 9999px rgb(15 23 42 / 0.62), 0 0 0 4px rgb(255 114 141 / 0.25);
  pointer-events: none;
  transition: top 0.2s ease, left 0.2s ease, width 0.2s ease, height 0.2s ease;
}

.onboarding-tooltip {
  position: absolute;
  z-index: 2;
  width: min(370px, calc(100vw - 2rem));
  border-radius: 1.1rem;
  padding: 1rem;
  background: #ffffff;
  box-shadow: 0 30px 70px -24px rgb(15 23 42 / 0.6);
  pointer-events: auto;
  transition: top 0.2s ease, left 0.2s ease;
}

.onboarding-tour-count {
  border-radius: 999px;
  padding: 0.25rem 0.6rem;
  background: #ffe4ea;
  font-size: 0.65rem;
  font-weight: 800;
  color: #a61f36;
}

.onboarding-tour-close {
  display: grid;
  width: 1.9rem;
  height: 1.9rem;
  place-items: center;
  border-radius: 0.5rem;
  color: #94a3b8;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.onboarding-tour-close:hover {
  background: #f1f5f9;
  color: #334155;
}

.onboarding-tour-content {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.85rem;
}

.onboarding-tour-icon {
  display: grid;
  width: 2.4rem;
  height: 2.4rem;
  flex-shrink: 0;
  place-items: center;
  border-radius: 0.8rem;
  background: #0f172a;
  color: #ff728d;
}

.onboarding-tour-title {
  font-size: 0.9rem;
  font-weight: 800;
  color: #0f172a;
}

.onboarding-tour-description {
  margin-top: 0.25rem;
  font-size: 0.75rem;
  line-height: 1.55;
  color: #64748b;
}

.onboarding-tour-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 1rem;
  border-top: 1px solid #f1f5f9;
  padding-top: 0.85rem;
}

.onboarding-tour-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.7rem;
  font-weight: 700;
  color: #c8213d;
}

@media (prefers-reduced-motion: reduce) {
  .onboarding-spotlight,
  .onboarding-tooltip,
  .onboarding-progress-bar,
  .onboarding-launcher {
    transition: none;
  }
}

/* --------------------------------------------------------------------------
   Connexion
   -------------------------------------------------------------------------- */
.auth-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  background: #f8fafc;
}

.auth-mobile-header {
  position: relative;
  overflow: hidden;
  padding: calc(1.15rem + env(safe-area-inset-top, 0px)) 1.25rem 1.6rem;
  border-radius: 0 0 1.6rem 1.6rem;
  background: linear-gradient(145deg, #0f172a 0%, #1e293b 100%);
  color: #ffffff;
}

.auth-mobile-header::after {
  position: absolute;
  top: -7rem;
  right: -5rem;
  width: 16rem;
  height: 16rem;
  border-radius: 999px;
  background: rgb(255 74 99 / 0.25);
  filter: blur(2.5rem);
  content: "";
  pointer-events: none;
}

.auth-mobile-brand,
.auth-mobile-copy {
  position: relative;
  z-index: 1;
}

.auth-mobile-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.auth-mobile-logo {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.65rem;
  background: #ffffff;
  padding: 0.25rem;
  object-fit: contain;
}

.auth-mobile-name {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.auth-mobile-copy {
  margin-top: 1.6rem;
}

.auth-mobile-eyebrow {
  color: #ff728d;
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.auth-mobile-title {
  margin-top: 0.5rem;
  max-width: 20rem;
  font-size: 1.3rem;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.auth-mobile-subtitle {
  margin-top: 0.5rem;
  max-width: 19rem;
  color: rgb(203 213 225 / 0.85);
  font-size: 0.75rem;
  line-height: 1.55;
}

.auth-panel {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  padding: 1.25rem 1rem calc(1.5rem + env(safe-area-inset-bottom, 0px));
  background: radial-gradient(circle at 50% 0%, #ffffff 0%, #f8fafc 65%);
}

.auth-panel-inner {
  width: 100%;
  max-width: 26rem;
}

.auth-card {
  border: 1px solid #e2e8f0;
  border-radius: 1.25rem;
  background: #ffffff;
  padding: 1.5rem;
  box-shadow: 0 24px 50px -28px rgb(15 23 42 / 0.3);
}

.auth-icon {
  display: grid;
  width: 2.75rem;
  height: 2.75rem;
  place-items: center;
  border-radius: 0.85rem;
  background: #fff1f4;
  color: #ec2f4d;
}

.auth-title {
  margin-top: 1rem;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #0f172a;
}

.auth-subtitle {
  margin-top: 0.35rem;
  font-size: 0.8125rem;
  color: #64748b;
}

.auth-form {
  display: grid;
  gap: 1rem;
  margin-top: 1.5rem;
}

.auth-label {
  display: block;
  margin-bottom: 0.45rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #334155;
}

.auth-input-wrap {
  position: relative;
}

.auth-input-icon {
  position: absolute;
  top: 50%;
  left: 0.9rem;
  width: 1rem;
  height: 1rem;
  transform: translateY(-50%);
  color: #94a3b8;
  pointer-events: none;
}

.auth-input {
  display: block;
  width: 100%;
  min-height: 46px;
  border: 1px solid #cbd5e1;
  border-radius: 0.75rem;
  padding: 0.7rem 2.6rem 0.7rem 2.5rem;
  outline: none;
  background: #ffffff;
  font-size: 0.9rem;
  color: #0f172a;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-input::placeholder {
  color: #94a3b8;
}

.auth-input:hover {
  border-color: #94a3b8;
}

.auth-input:focus {
  border-color: #ff4a63;
  box-shadow: 0 0 0 3px rgb(255 74 99 / 0.14);
}

.auth-input-toggle {
  position: absolute;
  top: 50%;
  right: 0.4rem;
  display: grid;
  width: 2.25rem;
  height: 2.25rem;
  place-items: center;
  transform: translateY(-50%);
  border-radius: 0.6rem;
  color: #64748b;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.auth-input-toggle:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.auth-submit {
  display: flex;
  width: 100%;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 0.75rem;
  background: linear-gradient(135deg, #ff4a63 0%, #ec2f4d 100%);
  box-shadow: 0 12px 22px -12px rgb(236 47 77 / 0.85);
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 700;
  transition: filter 0.15s ease, transform 0.15s ease;
}

.auth-submit:hover {
  filter: brightness(1.05);
}

.auth-submit:active {
  transform: translateY(1px);
}

.auth-help {
  margin-top: 1rem;
  color: #94a3b8;
  font-size: 0.7rem;
  line-height: 1.5;
  text-align: center;
}

@media (min-width: 640px) {
  .auth-card {
    padding: 2rem;
  }

  .auth-mobile-title {
    font-size: 1.5rem;
  }
}

@media (max-height: 700px) {
  .auth-mobile-header {
    padding-top: calc(0.75rem + env(safe-area-inset-top, 0px));
    padding-bottom: 1rem;
  }

  .auth-mobile-copy {
    margin-top: 0.9rem;
  }

  .auth-mobile-title {
    font-size: 1.1rem;
  }

  .auth-mobile-subtitle {
    font-size: 0.7rem;
  }

  .auth-card {
    padding: 1.15rem;
  }

  .auth-form {
    gap: 0.8rem;
    margin-top: 1.15rem;
  }
}

@media (min-width: 1024px) {
  .auth-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .auth-panel {
    padding: 3rem;
  }

  .auth-panel-inner {
    max-width: 25rem;
  }
}
