/* ============================================================
   monCRPE — Waitlist — CSS pixel-perfect extrait du design Claude
   ============================================================ */

:root {
  --blue: #1E90FF;
  --blue-deep: #1577e0;
  --orange: #E67E22;
  --green: #2ECC71;
  --yellow: #F1C40F;
  --dark: #111111;
  --light: #f9f9f6;
  --ink: #111111;
  --muted: #6b6b6b;
  --line: #e6e6e0;
  --left-grad: linear-gradient(175deg, #9ac8f7 0%, #b8d9f9 25%, #ceeaf5 55%, #eef6f0 80%, #f9f9f6 100%);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; scrollbar-gutter: stable; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--ink);
  background: var(--dark);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ======================== LAYOUT ======================== */

.stage {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}

/* ======================== LEFT ======================== */

.left {
  position: relative;
  overflow: hidden;
  padding: 48px 56px 40px;
  display: flex;
  flex-direction: column;
  background: var(--left-grad);
  transition: background .5s ease;
}

/* Sheen lumineux coin haut-gauche */
.left::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(70% 55% at 2% 2%, rgba(255,255,255,0.22), transparent 55%);
  pointer-events: none;
}

/* Logo image */
.logo-img {
  display: block;
  width: 339px;
  max-width: 100%;
  height: auto;
  position: relative;
  z-index: 5;
  cursor: pointer;
  user-select: none;
}

/* Headline */
.headline {
  margin: 22px 14px 0 0;
  padding: 0 0 37px;
  position: relative;
  z-index: 5;
  line-height: 1.06;
}

.headline-main {
  line-height: 1.1;
  letter-spacing: -0.1px;
  margin-right: 54px;
  display: block;
}

.headline-main span {
  font-family: 'Fraunces', serif;
  font-weight: 800;
  font-size: 56px;
  color: #333333;
  letter-spacing: -0.5px;
}

.headline-accent {
  font-family: 'Fraunces', serif;
  font-style: normal;
  font-weight: 700;
  color: #555555;
  font-size: 40px;
  display: block;
  margin-top: 10px;
  letter-spacing: -0.3px;
}

/* ======================== FLOAT ZONE ======================== */

.float-zone {
  flex: 1;
  margin-top: 24px;
  z-index: 2;
  column-count: 2;
  column-gap: 20px;
}

/* ======================== CARDS ======================== */

.fcard {
  position: relative;
  width: auto;
  break-inside: avoid;
  margin: 0 0 18px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 18px 38px -16px rgba(28,52,84,0.32), 0 2px 6px rgba(28,52,84,0.12);
  padding: 16px;
  color: var(--ink);
  will-change: transform;
  transition: box-shadow 0.3s ease;
}

.fcard:hover {
  box-shadow: 0 24px 50px -16px rgba(28,52,84,0.40), 0 4px 10px rgba(28,52,84,0.15);
}

/* Float animations */
@keyframes float1 {
  0%   { transform: translateY(0px) rotate(-1.5deg); }
  30%  { transform: translateY(-14px) rotate(-2deg); }
  50%  { transform: translateY(-10px) rotate(-1.2deg); }
  70%  { transform: translateY(-16px) rotate(-2.2deg); }
  100% { transform: translateY(0px) rotate(-1.5deg); }
}
@keyframes float2 {
  0%   { transform: translateY(0px) rotate(1.3deg); }
  35%  { transform: translateY(12px) rotate(1.8deg); }
  55%  { transform: translateY(8px) rotate(1deg); }
  75%  { transform: translateY(14px) rotate(2deg); }
  100% { transform: translateY(0px) rotate(1.3deg); }
}
@keyframes float3 {
  0%   { transform: translateY(0px) rotate(1deg); }
  40%  { transform: translateY(-18px) rotate(0.5deg); }
  60%  { transform: translateY(-12px) rotate(1.5deg); }
  80%  { transform: translateY(-20px) rotate(0.8deg); }
  100% { transform: translateY(0px) rotate(1deg); }
}
@keyframes float4 {
  0%   { transform: translateY(0px) rotate(-0.8deg); }
  25%  { transform: translateY(-10px) rotate(-1.5deg); }
  55%  { transform: translateY(-6px) rotate(-0.5deg); }
  80%  { transform: translateY(-13px) rotate(-1.8deg); }
  100% { transform: translateY(0px) rotate(-0.8deg); }
}

.card-flash { animation: float1 7s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite; }
.card-mind  { animation: float3 9s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite; animation-delay: -2s; }
.card-todo  { animation: float2 8s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite; animation-delay: -4s; }
.card-quiz  { animation: float4 6.5s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite; animation-delay: -1s; }

.motion-pose .fcard   { animation-duration: 15s; }
.motion-vivant .fcard { animation-duration: 8s; }
.motion-fige .fcard   { animation: none; }

@media (prefers-reduced-motion: reduce) {
  .card-flash,.card-quiz,.card-mind,.card-todo { animation: none; }
  .flip-inner { transition: none; }
}

/* ---- Flashcard flip ---- */
.flip-scene { perspective: 800px; }

.flip-inner {
  position: relative;
  transition: transform 0.9s cubic-bezier(.6,.04,.2,1);
  transform-style: preserve-3d;
  min-height: 96px;
}

.flip-inner.flipped { transform: rotateY(180deg); }

.flip-face {
  position: absolute;
  inset: -16px;
  padding: 16px;
  background: #fff;
  border-radius: 16px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.flip-back { transform: rotateY(180deg); }

.flip-front .q    { font-size: 13.5px; font-weight: 600; line-height: 1.35; }
.flip-front .hint { font-size: 10.5px; color: var(--muted); margin-top: 10px; }
.flip-back .lbl   { font-size: 10px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 6px; }
.flip-back .a     { font-size: 13px; font-weight: 500; line-height: 1.4; color: var(--blue-deep); }

/* ---- Quiz ---- */
.qtitle { font-size: 13.5px; font-weight: 600; margin-bottom: 11px; line-height: 1.3; }

.opt {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
  padding: 8px 10px;
  border: 1.5px solid var(--line);
  border-radius: 9px;
  margin-bottom: 6px;
  color: #333;
}
.opt:last-child { margin-bottom: 0; }

.bullet { width: 15px; height: 15px; border-radius: 50%; border: 1.5px solid #c9c9c4; flex: 0 0 auto; }

.opt.correct { border-color: var(--green); background: rgba(46,204,113,0.08); color: #1e8e4e; }
.opt.correct .bullet { border-color: var(--green); background: var(--green); position: relative; }
.opt.correct .bullet::after {
  content: "";
  position: absolute;
  left: 4px; top: 1.5px;
  width: 4px; height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* ---- Carte mentale ---- */
.mind { position: relative; display: flex; align-items: center; gap: 22px; padding: 6px 0 4px; }
.mnode { font-size: 11px; font-weight: 600; padding: 5px 9px; border-radius: 8px; white-space: nowrap; }
.mnode.center {
  background: rgba(230,126,34,0.12);
  color: var(--orange);
  border: 1.5px solid rgba(230,126,34,0.45);
  position: relative;
  text-align: center;
  line-height: 1.2;
}
.mnode.center::after {
  content: "";
  position: absolute;
  right: -22px; top: 50%;
  width: 22px; height: 1.5px;
  background: rgba(230,126,34,0.4);
}
.mbranch { position: relative; display: flex; flex-direction: column; gap: 8px; }
.mbranch::before {
  content: "";
  position: absolute;
  left: -14px; top: 13px; bottom: 13px;
  width: 1.5px;
  background: rgba(230,126,34,0.4);
}
.mbranch .mnode {
  position: relative;
  background: #f3f3f0;
  color: #333;
  opacity: 0;
  animation: branchIn 4.6s ease-in-out infinite;
}
.mbranch .mnode::before {
  content: "";
  position: absolute;
  left: -14px; top: 50%;
  width: 12px; height: 1.5px;
  background: rgba(230,126,34,0.4);
}
.mbranch .mnode:nth-child(1) { animation-delay: .1s; }
.mbranch .mnode:nth-child(2) { animation-delay: .45s; }
.mbranch .mnode:nth-child(3) { animation-delay: .8s; }
.mbranch .mnode:nth-child(4) { animation-delay: 1.15s; }

@keyframes branchIn {
  0%       { opacity: 0; transform: translateX(-6px) scale(.95); }
  14%, 86% { opacity: 1; transform: none; }
  100%     { opacity: 0; transform: translateX(-6px) scale(.95); }
}

/* ---- Todo ---- */
.todo-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 11px; }
.todo-day { font-size: 13px; font-weight: 700; color: var(--ink); }
.todo-day b { color: var(--blue-deep); font-weight: 700; }
.todo-badge { font-size: 10.5px; font-weight: 700; color: var(--green); background: rgba(46,204,113,0.12); padding: 2px 8px; border-radius: 999px; }
.todo-item { display: flex; align-items: center; gap: 10px; padding: 7px 0; }
.todo-item + .todo-item { border-top: 1px solid #f0f0ec; }
.todo-check { width: 17px; height: 17px; flex: 0 0 auto; border-radius: 6px; border: 1.6px solid #cfcfc9; position: relative; transition: background .25s, border-color .25s; }
.todo-item.done .todo-check { background: var(--green); border-color: var(--green); }
.todo-item.done .todo-check::after { content: ""; position: absolute; left: 5px; top: 2px; width: 4px; height: 8px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.todo-label { font-size: 12px; font-weight: 500; color: #333; transition: color .25s; }
.todo-item.done .todo-label { color: var(--muted); }
.todo-tag { font-size: 12px; font-weight: 700; color: var(--blue); margin-right: 6px; }

/* ======================== RIGHT ======================== */

.right {
  background:
    radial-gradient(90% 70% at 100% 0%, rgba(30,144,255,0.05), transparent 55%),
    radial-gradient(85% 75% at 0% 100%, rgba(241,196,15,0.06), transparent 55%),
    var(--light);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 44px;
}

.form-card {
  position: relative;
  overflow: hidden;
  width: 100%;
  max-width: 410px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 24px 60px -28px rgba(0,0,0,0.22);
  padding: 40px 36px 36px;
}

.fc-title {
  font-family: 'Lora', serif;
  font-style: italic;
  font-weight: 500;
  font-size: 46px;
  line-height: 1.15;
  color: #000;
  text-align: center;
  margin-bottom: 8px;
}

.fc-sub {
  color: var(--muted);
  font-size: 13.5px;
  margin-top: 6px;
  line-height: 1.5;
  text-align: center;
}

form { margin-top: 24px; }

.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.field { margin-bottom: 14px; }

.field label {
  display: block;
  font-family: 'Inter', sans-serif;
  font-size: 11.5px;
  font-weight: 600;
  color: #3a3a3a;
  margin-bottom: 6px;
  letter-spacing: 0.03em;
}

.field input,
.field select {
  width: 100%;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  padding: 13px 16px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: #fafaf8;
  color: var(--ink);
  transition: border-color .2s, box-shadow .2s, background .2s;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}

.field input::placeholder { color: #b3b3ad; }

/* Override autofill jaune iOS/Safari */
.field input:-webkit-autofill,
.field input:-webkit-autofill:hover,
.field input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 30px #fafaf8 inset !important;
  -webkit-text-fill-color: #111111 !important;
  transition: background-color 5000s ease-in-out 0s;
}

.field input:focus,
.field select:focus {
  border-color: var(--blue);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(30,144,255,0.12);
}

.field select {
  cursor: pointer;
}

/* Wrapper pour la flèche des selects — évite le bug iOS où l'arrow SVG glisse à gauche après sélection */
.select-wrap {
  position: relative;
}
.select-wrap::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 8px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b6b6b' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: contain;
  pointer-events: none;
}
.select-wrap select {
  padding-right: 34px;
}

.field.invalid input,
.field.invalid select { border-color: #e5484d; background: #fff7f7; }

.err { color: #d93b40; font-size: 10.5px; margin-top: 5px; font-weight: 500; display: none; }
.field.invalid .err { display: block; }

.cta {
  width: 100%;
  margin-top: 24px;
  border: none;
  border-radius: 12px;
  background: var(--blue);
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 600;
  padding: 14px 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background .15s, transform .15s, box-shadow .2s;
  box-shadow: 0 8px 24px -6px rgba(30,144,255,0.65);
}

.cta:hover { background: var(--blue-deep); box-shadow: 0 12px 26px -8px rgba(30,144,255,0.7); transform: translateY(-1px); }
.cta:active { transform: translateY(1px); }
.cta .arrow { transition: transform .2s; }
.cta:hover .arrow { transform: translateX(4px); }
.cta:disabled { opacity: 0.7; cursor: not-allowed; box-shadow: none; }

.wl-spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: white;
  border-radius: 50%;
  animation: wl-spin 0.65s linear infinite;
  display: inline-block;
  flex-shrink: 0;
}
@keyframes wl-spin { to { transform: rotate(360deg); } }

.fineprint { font-size: 11px; color: #9a9a93; text-align: center; margin-top: 14px; line-height: 1.5; }

/* ======================== SUCCESS ======================== */

@keyframes rise { from { opacity:0; transform: translateY(14px); } to { opacity:1; transform:none; } }

.success {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  animation: rise .5s ease both;
}

.form-card.success-shown {
  padding: 36px;
  display: flex;
  flex-direction: column;
}

.form-card.success-shown .success {
  flex: 1;
  justify-content: space-between;
}

.success-title {
  font-family: 'Lora', serif;
  font-style: italic;
  font-weight: 500;
  font-size: 42px;
  color: var(--dark);
  margin-bottom: 0;
  line-height: 1.1;
}

.success-lottie-wrap {
  position: relative;
  flex: 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.success-lottie {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  max-height: 320px;
  display: block;
}

.success-logo {
  position: absolute;
  width: 240px;
  height: auto;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.success-logo-standalone {
  display: block;
  width: 200px;
  height: auto;
  pointer-events: none;
}

.success-teaser {
  font-size: 17px;
  font-weight: 700;
  color: var(--dark);
  line-height: 1.5;
  text-align: center;
  margin-bottom: 16px;
}

.success-socials {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding-bottom: 4px;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #f4f4f0;
  border: 1px solid var(--line);
  color: var(--dark);
  transition: background .15s, transform .12s, color .15s;
}

.social-link:hover {
  background: var(--dark);
  color: #fff;
  transform: translateY(-2px);
}

.social-link svg { width: 20px; height: 20px; }

/* ======================== ADMIN DIALOG ======================== */

.wl-admin-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.wl-admin-overlay.open { opacity: 1; pointer-events: all; }

.wl-admin-card {
  background: white;
  border-radius: 20px;
  padding: 36px;
  width: calc(100% - 40px);
  max-width: 340px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.22);
  transform: scale(0.94) translateY(8px);
  transition: transform 0.22s ease;
}
.wl-admin-overlay.open .wl-admin-card { transform: scale(1) translateY(0); }

.wl-admin-card h2 { font-family: 'Inter', sans-serif; font-size: 1.2rem; font-weight: 800; margin-bottom: 4px; color: var(--dark); }
.wl-admin-card p  { font-size: 0.8rem; color: var(--muted); margin-bottom: 22px; }

.wl-admin-error { font-size: 0.8rem; color: #e74c3c; background: rgba(231,76,60,0.07); border-radius: 8px; padding: 8px 12px; margin-bottom: 12px; display: none; }
.wl-admin-error.visible { display: block; }

.wl-admin-actions { display: flex; gap: 10px; margin-top: 18px; }

.wl-admin-cancel {
  flex: 1; padding: 10px;
  background: var(--light); border: none; border-radius: 10px;
  font-family: 'Inter', sans-serif; font-size: 0.875rem; font-weight: 500;
  cursor: pointer; color: var(--dark); transition: background 0.15s;
}
.wl-admin-cancel:hover { background: #ececea; }

.wl-admin-login {
  flex: 2; padding: 10px;
  background: var(--blue); border: none; border-radius: 10px;
  font-family: 'Inter', sans-serif; font-size: 0.875rem; font-weight: 600;
  cursor: pointer; color: white; transition: background 0.15s;
}
.wl-admin-login:hover:not(:disabled) { background: var(--blue-deep); }
.wl-admin-login:disabled { opacity: 0.6; cursor: not-allowed; }

/* ======================== RESPONSIVE ======================== */

@media (max-width: 880px) {
  body { background: #f9f9f6; }
  .stage { grid-template-columns: 1fr; gap: 0; }
  .left {
    min-height: auto;
    padding: 28px 28px 40px;
    background: linear-gradient(180deg, #9ac8f7 0%, #b8d9f9 35%, #deeef9 65%, #f9f9f6 100%);
  }
  .right { padding: 36px 22px 56px; background: #f9f9f6; }
  .logo-img { width: 250px; margin-left: auto; margin-right: auto; }
  .fc-title { font-size: 38px; margin-top: 10px; }
  .float-zone { column-count: 1; max-width: 100%; }

  .field input,
  .field select { font-size: 16px; }
}

@media (max-width: 480px) {
  .headline { text-align: center; padding-bottom: 28px; margin-top: 18px; margin-right: 0; }
  .headline-main { margin-right: 0; }
  .headline-main span { font-size: 34px; color: #333333; }
  .headline-accent { font-size: 28px; margin-top: 10px; color: #2d2d2d; }
  .fc-title { font-size: 36px; }
  .card-quiz { display: none; }
  .field input, .field select { font-size: 16px; }
}
