@font-face {
  font-family: 'Julius Sans One';
  src: url('../fonts/julius-sans-one-regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Manrope';
  src: url('../fonts/manrope-variable.woff2') format('woff2-variations'),
       url('../fonts/manrope-variable.woff2') format('woff2');
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --color-blue: #005486;
  --color-gold: #bc823c;
  --color-dark: #383838;
  --color-bg: #F7F2EA;
  --color-white: #ffffff;
  --color-track: #ece2d1;
  --font-heading: 'Julius Sans One', Georgia, 'Times New Roman', serif;
  --font-body: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 10% 12%, rgba(0, 84, 134, 0.14), transparent 45%),
    radial-gradient(circle at 90% 28%, rgba(188, 130, 60, 0.16), transparent 42%),
    radial-gradient(circle at 15% 88%, rgba(188, 130, 60, 0.13), transparent 44%),
    radial-gradient(circle at 92% 92%, rgba(0, 84, 134, 0.14), transparent 42%),
    var(--color-bg);
  background-attachment: fixed;
  color: var(--color-dark);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

.container {
  max-width: 640px;
  margin: 0 auto;
  padding: 40px 20px 72px;
}

@media (min-width: 900px) {
  .container {
    max-width: 680px;
    padding-top: 64px;
  }
}

h1, h2 {
  font-family: var(--font-heading);
  font-weight: 400;
  color: var(--color-blue);
  margin: 0 0 20px;
  line-height: 1.3;
}

h1 {
  font-size: 1.3rem;
  text-align: center;
}

.hero-title {
  text-transform: uppercase;
}

.hero-title-main {
  display: block;
  font-weight: 700;
  font-size: 1.6rem;
}

.hero-title-sub {
  display: block;
  font-weight: 400;
  font-size: 1.05rem;
  margin-top: 6px;
}

h2 {
  font-size: 1.2rem;
  text-align: center;
}

p {
  margin: 0 0 16px;
}

/* Logo */

.site-header {
  display: flex;
  justify-content: center;
  margin-top: 40px;
}

.logo {
  width: 48px;
  height: auto;
  display: block;
}

@media (min-width: 600px) {
  .logo {
    width: 64px;
  }
}

/* Portrait */

.portrait-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 28px;
}

.portrait {
  width: 168px;
  height: 168px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

/* Audio player */

.audio-player {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 280px;
  margin: 0 auto;
  background: var(--color-white);
  border-radius: 16px;
  padding: 12px 16px;
  box-shadow: 0 2px 14px rgba(56, 56, 56, 0.06);
}

.play-btn {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: var(--color-blue);
  color: var(--color-white);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.play-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.play-btn svg[hidden] {
  display: none;
}

.audio-progress {
  flex: 1;
  cursor: pointer;
  padding: 10px 0;
  outline-offset: 4px;
}

.audio-bars {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 20px;
}

.audio-bar {
  flex: 1;
  min-width: 2px;
  border-radius: 2px;
  background: var(--color-track);
  height: 40%;
}

.audio-bar.active {
  background: var(--color-gold);
}

.audio-bar:nth-child(4n+1) { height: 75%; }
.audio-bar:nth-child(4n+2) { height: 45%; }
.audio-bar:nth-child(4n+3) { height: 95%; }
.audio-bar:nth-child(4n)   { height: 30%; }

.audio-time {
  flex-shrink: 0;
  font-size: 0.82rem;
  color: var(--color-dark);
  white-space: nowrap;
  min-width: 84px;
  text-align: right;
}

/* Transcript */

.transcript {
  margin-top: 32px;
  text-align: center;
}

.transcript-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: 1px solid var(--color-blue);
  color: var(--color-blue);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 12px 20px;
  border-radius: 8px;
  cursor: pointer;
}

.transcript-arrow {
  transition: transform 0.2s ease;
}

.transcript-toggle[aria-expanded="true"] .transcript-arrow {
  transform: rotate(180deg);
}

.transcript-content {
  text-align: left;
  margin-top: 16px;
  background: var(--color-white);
  border-radius: 12px;
  padding: 24px;
  font-size: 0.95rem;
  line-height: 1.75;
}

.transcript-content p {
  margin: 0 0 16px;
}

.transcript-content p:last-child {
  margin-bottom: 0;
}

/* Form section */

.form-locked-message {
  text-align: center;
  color: var(--color-dark);
  opacity: 0.6;
  font-size: 0.8rem;
  font-style: italic;
  margin: -8px 0 24px;
}

.tally-container {
  margin-top: 32px;
}

.tally-container iframe {
  width: 100%;
  border: none;
  display: block;
}

/* Mosaïque photo décorative */

.mosaic-tile {
  border-radius: 6px;
  overflow: hidden;
  opacity: 0;
  animation-name: mosaicFade;
  animation-iteration-count: infinite;
  animation-timing-function: ease-in-out;
}

.mosaic-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(0.7);
}

.mosaic-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.45);
}

@keyframes mosaicFade {
  0%, 100% { opacity: 0; }
  50% { opacity: 0.85; }
}

.mosaic-desktop {
  display: none;
}

.mosaic-mobile {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 28px 0;
}

.mosaic-slot {
  position: relative;
  width: 66px;
  height: 80px;
  flex-shrink: 0;
}

.mosaic-slot .mosaic-tile {
  position: absolute;
  inset: 0;
}

.mosaic-mobile .t1 { animation-duration: 9s;   animation-delay: 0s;   }
.mosaic-mobile .t2 { animation-duration: 9s;   animation-delay: 4.5s; }
.mosaic-mobile .t3 { animation-duration: 10s;  animation-delay: 1s;   }
.mosaic-mobile .t4 { animation-duration: 10s;  animation-delay: 6s;   }
.mosaic-mobile .t5 { animation-duration: 11s;  animation-delay: 2s;   }
.mosaic-mobile .t6 { animation-duration: 11s;  animation-delay: 7.5s; }
.mosaic-mobile .t7 { animation-duration: 9.5s; animation-delay: 3s;   }
.mosaic-mobile .t8 { animation-duration: 9.5s; animation-delay: 8s;   }

@media (min-width: 1200px) {
  .mosaic-desktop {
    display: block;
  }

  .mosaic-desktop .mosaic-tile {
    position: fixed;
    width: 175px;
    height: 220px;
    z-index: 0;
    pointer-events: none;
  }

  /* Positionnées à distance fixe du bord du conteneur (680px max, moitié 340px)
     plutôt que du bord de l'écran, pour rester proches du centre sur les grands écrans. */
  .mosaic-desktop .left-1  { left: calc(50% - 565px); top: 8vh;   animation-duration: 9s;    animation-delay: 0s;    }
  .mosaic-desktop .left-2  { left: calc(50% - 615px); top: 34vh;  animation-duration: 11s;   animation-delay: 3s;    }
  .mosaic-desktop .left-3  { left: calc(50% - 545px); top: 60vh;  animation-duration: 10s;   animation-delay: 6s;    }
  .mosaic-desktop .left-4  { left: calc(50% - 595px); top: 86vh;  animation-duration: 12s;   animation-delay: 9s;    }
  .mosaic-desktop .right-1 { left: calc(50% + 390px); top: 14vh;  animation-duration: 10s;   animation-delay: 1.5s;  }
  .mosaic-desktop .right-2 { left: calc(50% + 440px); top: 40vh;  animation-duration: 9s;    animation-delay: 4.5s;  }
  .mosaic-desktop .right-3 { left: calc(50% + 370px); top: 66vh;  animation-duration: 11s;   animation-delay: 7.5s;  }
  .mosaic-desktop .right-4 { left: calc(50% + 420px); top: 92vh;  animation-duration: 12.5s; animation-delay: 10.5s; }

  .mosaic-mobile {
    display: none;
  }

  .container {
    position: relative;
    z-index: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mosaic-tile {
    animation: none;
    opacity: 0.5;
  }
}

/* Indicateur d'étapes */

.step-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: 48px;
}

.step-dots {
  display: flex;
  gap: 8px;
}

.step-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-track);
}

.step-dot.active {
  background: var(--color-gold);
}

.step-label {
  font-size: 0.8rem;
  color: var(--color-dark);
  opacity: 0.6;
  margin: 0;
}

/* Page 2 : confirmation + calendrier */

.confirmation {
  text-align: center;
  margin-bottom: 32px;
}

.cal-embed {
  width: 100%;
  min-height: 700px;
  overflow: hidden;
}

@media (min-width: 600px) {
  h1 {
    font-size: 1.5rem;
  }

  .portrait {
    width: 200px;
    height: 200px;
  }
}

/* Compacité mobile, pour que le logo apparaisse sans trop de scroll */

.mobile-break {
  display: none;
}

.desktop-break {
  display: none;
}

@media (min-width: 900px) {
  .desktop-break {
    display: inline;
  }
}

@media (max-width: 899px) {
  .mobile-break {
    display: inline;
  }

  .container {
    padding-top: 24px;
    padding-bottom: 32px;
  }

  h1, h2 {
    margin-bottom: 12px;
  }

  .portrait {
    width: 150px;
    height: 150px;
  }

  .portrait-wrap {
    margin-bottom: 16px;
  }

  .form-locked-message {
    line-height: 1.35;
    font-size: 0.72rem;
    margin: -6px 0 14px;
  }

  .audio-player {
    gap: 10px;
    padding: 8px 12px;
  }

  .play-btn {
    width: 36px;
    height: 36px;
  }

  .play-btn svg {
    width: 16px;
    height: 16px;
  }

  .audio-bars {
    height: 16px;
  }

  .transcript-toggle {
    padding: 8px 16px;
    font-size: 0.85rem;
  }

  .mosaic-mobile {
    margin: 12px 0;
  }

  .transcript {
    margin-top: 16px;
  }

  .step-indicator {
    margin-top: 22px;
  }

  .site-header {
    margin-top: 18px;
  }
}

/* Bandeau dégradé desktop, du haut vers le bas de la page, centré,
   séparé du fond beige de la page qui reste visible sur les côtés. */

body {
  position: relative;
}

body::before {
  content: "";
  display: none;
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 680px;
  background: linear-gradient(160deg, #ffffff, #f3ece0);
  z-index: 0;
}

@media (min-width: 900px) {
  body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100vh;
  }

  body::before {
    display: block;
  }

  .container {
    position: relative;
    z-index: 1;
    padding-left: 48px;
    padding-right: 48px;
    padding-bottom: 56px;
  }

  h1, h2 {
    margin-bottom: 28px;
  }

  .hero-title {
    margin-bottom: 48px;
  }

  .hero-title-main {
    font-size: 2rem;
  }

  h2 {
    font-weight: 700;
  }

  .portrait-wrap {
    margin-bottom: 40px;
  }

  .form-locked-message {
    margin-top: -16px;
    margin-bottom: 36px;
    font-size: 0.72rem;
  }

  .transcript {
    margin-top: 28px;
  }

  .step-indicator {
    margin-top: 28px;
  }

  .site-header {
    margin-top: 56px;
  }
}
