.cesu-assistant {
  font-family: 'Google Sans Flex', 'SF Pro', Arial, sans-serif;
}

.cesu-assistant strong {
  font-weight: 700;
}

body.cesu-assistant {
  padding-bottom: 10rem;
}

@media (max-width: 640px) {
  body.cesu-assistant {
    padding-bottom: 11.5rem;
  }
}

/* Sur la page CESU, le fond doit commencer en haut sans decalage vertical. */
body.cesu-assistant.site-bg {
  background-position: center top;
}

body.cesu-assistant .hero-bg-layer::after {
  background-position: center top;
}

.cesu-assistant .fade-in {
  animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  opacity: 0;
  transform: translateY(10px);
}

.cesu-assistant .slide-up {
  animation: slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  opacity: 0;
  transform: translateY(20px);
}

.cesu-assistant .delay-100 {
  animation-delay: 100ms;
}

.cesu-assistant .delay-200 {
  animation-delay: 200ms;
}

.cesu-assistant .delay-300 {
  animation-delay: 300ms;
}

.cesu-progress-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: #e7e5e4;
  overflow: hidden;
}

.cesu-progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #059669, #10b981);
  transition: width 220ms ease;
}

@keyframes fadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Styles pour le formulaire de verrouillage du guide CESU */
.cesu-pass-card {
  background: rgba(17, 24, 39, 0.72);
  border-radius: 20px;
  border: none;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}
.cesu-pass-input {
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.98);
  outline: none;
}
.cesu-pass-input:focus {
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.2);
  border-color: rgba(34, 197, 94, 0.65);
}
.cesu-pass-error {
  color: #fecaca;
}

.cesu-pass-field {
  position: relative;
  margin-top: 12px;
  margin-bottom: 8px;
}

.cesu-pass-card {
  position: relative;
  z-index: 9999;
}
.cesu-pass-card .cesu-pass-input {
  background: #ffffff !important;
  color: #292524 !important;
  border: 1px solid #e7e5e4 !important;
  padding: 0.5rem 1rem !important;
  padding-right: 3.5rem !important;
  font-size: 1rem;
  border-radius: 9999px !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}
.cesu-pass-card .cesu-pass-input::placeholder {
  color: #78716c !important;
  opacity: 1;
}
.cesu-pass-visibility {
  position: absolute;
  top: 50%;
  right: 0.5rem;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: none;
  border-radius: 9999px;
  background: transparent;
  color: #57534e;
  cursor: pointer;
  transition: color 0.18s ease, background-color 0.18s ease;
}
.cesu-pass-visibility:hover {
  color: #166534;
  background: rgba(34, 197, 94, 0.1);
}
.cesu-pass-visibility:focus-visible {
  outline: 2px solid rgba(34, 197, 94, 0.7);
  outline-offset: 2px;
}
.cesu-pass-visibility-icon {
  display: inline-flex;
  width: 1.2rem;
  height: 1.2rem;
}
.cesu-pass-visibility-icon svg {
  width: 100%;
  height: 100%;
}
.cesu-pass-visibility .cesu-pass-visibility-icon--off {
  display: none;
}
.cesu-pass-visibility.is-visible .cesu-pass-visibility-icon--on {
  display: none;
}
.cesu-pass-visibility.is-visible .cesu-pass-visibility-icon--off {
  display: inline-flex;
}
.cesu-pass-card .glass-button,
.cesu-pass-card .glass-button--accent {
  display: inline-block;
  margin: 0 auto;
}
.cesu-pass-card .glass-button:focus,
.cesu-pass-card .glass-button:hover {
  transform: translateY(-1px);
}
/* Message bloqué centré */
.cesu-pass-card {
  text-align: center;
}

.cesu-remaining-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.65rem;
  border-radius: 999px;
  border: 1px solid #d6d3d1;
  font-size: 0.76rem;
  font-weight: 600;
  color: #44403c;
  background: #fafaf9;
}

.cesu-step-card.is-done {
  border-color: #34d399 !important;
  background: #f0fdf4;
}

.cesu-step-card {
  position: relative;
}

.cesu-step-done-badge {
  position: absolute;
  top: 0.95rem;
  right: 0.95rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 999px;
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
  box-shadow: 0 6px 18px rgba(5, 150, 105, 0.08);
}

.cesu-step-actions {
  margin-top: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.cesu-step-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid #d6d3d1;
  background: #ffffff;
  color: #44403c;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.42rem 0.8rem;
  transition: all 0.18s ease;
}

.cesu-step-action-btn:hover,
.cesu-step-action-btn:focus-visible {
  border-color: #10b981;
  color: #065f46;
  outline: none;
}

.cesu-step-action-btn.is-done {
  border-color: #059669;
  background: #059669;
  color: #ffffff;
}

.cesu-step-action-btn__img {
  width: 0.95rem;
  height: 0.95rem;
  object-fit: contain;
  flex: 0 0 auto;
}

.cesu-hint-toggle {
  margin-top: 0.7rem;
  border: 1px solid #d6d3d1;
  border-radius: 0.75rem;
  background: #ffffff;
  padding: 0.5rem 0.7rem;
}

.cesu-hint-toggle summary {
  cursor: pointer;
  color: #065f46;
  font-size: 0.8rem;
  font-weight: 700;
  list-style: none;
}

.cesu-hint-toggle summary::-webkit-details-marker {
  display: none;
}

.cesu-hint-toggle p {
  margin: 0.5rem 0 0;
  color: #57534e;
  font-size: 0.8rem;
  line-height: 1.5;
}

.cesu-primary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid #10b981;
  background: #10b981;
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  padding: 0.6rem 1rem;
  transition: background-color 0.18s ease;
}

.cesu-primary-link:hover,
.cesu-primary-link:focus-visible {
  background: #059669;
  outline: none;
}

.cesu-help-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.cesu-help-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 23, 14, 0.55);
  backdrop-filter: blur(2px);
}

.cesu-help-modal__panel {
  position: relative;
  width: min(100%, 34rem);
  border-radius: 1rem;
  background: #ffffff;
  padding: 1.25rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.cesu-help-input {
  margin-top: 0.4rem;
  width: 100%;
  border-radius: 0.75rem;
  border: 1px solid #d6d3d1;
  padding: 0.65rem 0.85rem;
  font-size: 0.95rem;
  color: #292524;
  background: #fff;
}

.cesu-help-input:focus {
  outline: none;
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18);
}

.cesu-help-success-icon {
  margin: 0 auto;
  color: #16a34a;
  display: flex;
  align-items: center;
  justify-content: center;
}

body.cesu-modal-open {
  overflow: hidden;
}

.cesu-client-wizard {
  position: fixed;
  inset: 0;
  z-index: 20000;
  isolation: isolate;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  padding:
    max(clamp(0.75rem, 2vw, 2rem), env(safe-area-inset-top))
    max(clamp(0.75rem, 2vw, 2rem), env(safe-area-inset-right))
    max(clamp(0.75rem, 2vw, 2rem), env(safe-area-inset-bottom))
    max(clamp(0.75rem, 2vw, 2rem), env(safe-area-inset-left));
  box-sizing: border-box;
}

.cesu-client-wizard[hidden] {
  display: none;
}

.cesu-client-wizard__backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(circle at 50% 20%, rgba(52, 211, 153, 0.16), transparent 38%),
    rgba(3, 14, 7, 0.76);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.cesu-client-wizard__panel {
  position: relative;
  z-index: 1;
  width: min(72rem, 100%);
  margin: auto;
  max-height: calc(100vh - clamp(1.5rem, 4vw, 4rem));
  max-height: calc(100dvh - clamp(1.5rem, 4vw, 4rem));
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  border: 0;
  border-radius: 2rem;
  background: #fcfcfb;
  color: #292524;
  box-shadow:
    0 28px 90px rgba(0, 0, 0, 0.28),
    0 4px 22px rgba(0, 0, 0, 0.14);
}

.cesu-client-wizard__close {
  position: relative;
  z-index: 2;
  display: inline-flex;
  width: 4.1rem;
  height: 4.1rem;
  flex: 0 0 4.1rem;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  transition:
    transform 160ms ease,
    background-color 160ms ease;
}

.cesu-client-wizard__close:hover {
  transform: scale(1.04);
  background: rgba(255, 255, 255, 0.24);
}

.cesu-client-wizard__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.2rem 0.85rem 1.5rem;
  background:
    linear-gradient(135deg, rgba(15, 118, 66, 0.98), rgba(5, 150, 105, 0.95)),
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.18), transparent 28%);
  color: #fff;
}

.cesu-client-wizard__badge {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  padding: 0.55rem 1rem;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  backdrop-filter: blur(8px);
}

.cesu-client-wizard__badge-logo {
  width: 1.35rem;
  height: 1.35rem;
  flex: 0 0 1.35rem;
  object-fit: contain;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  padding: 0.12rem;
}

.cesu-client-wizard__body {
  padding: 3rem 3.25rem 3.25rem;
  background:
    linear-gradient(180deg, #fcfcfb 0%, #f7f7f5 100%);
}

.cesu-client-wizard__results-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e7e5e4;
}

.cesu-client-wizard .cesu-step-card {
  border: 1px solid #e7e5e4;
  border-radius: 1.35rem;
  background: #fff;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.cesu-client-wizard .cesu-step-card--done {
  padding: 1rem 1.2rem;
}

.cesu-step-card__done-shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.cesu-step-card__done-main {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  min-width: 0;
}

.cesu-step-card__done-icon {
  display: inline-flex;
  width: 2.8rem;
  height: 2.8rem;
  align-items: center;
  justify-content: center;
  border-radius: 0.95rem;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  box-shadow: 0 10px 24px rgba(5, 150, 105, 0.2);
  flex-shrink: 0;
}

.cesu-step-card__done-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #1c1917;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cesu-step-card__done-toggle {
  display: inline-flex;
  width: 2.75rem;
  height: 2.75rem;
  align-items: center;
  justify-content: center;
  border: 1px solid #a7f3d0;
  border-radius: 999px;
  background: #ecfdf5;
  color: #047857;
  flex-shrink: 0;
  transition:
    transform 160ms ease,
    background-color 160ms ease,
    border-color 160ms ease;
}

.cesu-step-card__done-toggle:hover {
  transform: scale(1.04);
  background: #d1fae5;
  border-color: #6ee7b7;
}

.cesu-client-wizard .cesu-step-card:hover {
  border-color: #cbd5cf;
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.09);
}

.cesu-client-wizard .cesu-step-card .bg-stone-50\/50 {
  background: #f7f7f5;
}

.cesu-client-wizard .cesu-hint-toggle {
  background: #f4f4f1;
  border: 1px solid #eceae5;
}

.cesu-client-wizard .cesu-step-action-btn {
  border-radius: 999px;
}

.cesu-client-employee-data {
  margin-top: 1rem;
}

.cesu-client-employee-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.cesu-client-employee-row {
  min-width: 0;
  border: 1px solid #e7e5e4;
  border-radius: 0.8rem;
  background: #fff;
  padding: 0.95rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.cesu-client-employee-row strong {
  display: block;
  margin-bottom: 0.25rem;
  color: #047857;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.cesu-client-employee-row span {
  overflow-wrap: anywhere;
  color: #292524;
}

.cesu-client-copy {
  display: inline-flex;
  margin-top: 0.5rem;
  color: #047857;
  font-size: 0.74rem;
  font-weight: 800;
}

.cesu-client-employee-row__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.cesu-client-employee-loading,
.cesu-client-employee-error {
  border-radius: 0.75rem;
  padding: 0.85rem;
  background: #f5f5f4;
}

.cesu-client-employee-error {
  color: #b91c1c;
}

.cesu-client-employee-error .cesu-step-action-btn {
  margin-top: 0.75rem;
  color: #991b1b;
}

@media (max-width: 640px) {
  .cesu-client-wizard {
    align-items: center;
    padding:
      max(0.75rem, env(safe-area-inset-top))
      max(0.75rem, env(safe-area-inset-right))
      max(0.75rem, env(safe-area-inset-bottom))
      max(0.75rem, env(safe-area-inset-left));
  }

  .cesu-client-wizard__panel {
    margin: 0;
    width: 100%;
    max-height: calc(100vh - 1.5rem);
    max-height: calc(100dvh - 1.5rem);
    border-radius: 1.25rem;
  }

  .cesu-client-wizard__header,
  .cesu-client-wizard__body {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .cesu-client-wizard__header {
    padding: 0.65rem 0.75rem;
  }

  .cesu-client-wizard__badge {
    max-width: 100%;
    padding: 0.45rem 0.7rem;
    gap: 0.5rem;
    font-size: 0.7rem;
  }

  .cesu-client-wizard__body {
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
  }

  .cesu-client-employee-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-height: 700px) and (min-width: 641px) {
  .cesu-client-wizard__header {
    padding-top: 0.65rem;
    padding-bottom: 0.65rem;
  }

  .cesu-client-wizard__body {
    padding-top: 1.75rem;
    padding-bottom: 1.75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cesu-assistant .fade-in,
  .cesu-assistant .slide-up {
    animation: none !important;
    opacity: 1;
    transform: none;
  }

  .cesu-progress-fill,
  .cesu-step-action-btn {
    transition: none !important;
  }
}
