/* ══════════════════════════════════════════════════
   register.css — Page Inscription (créer compte parent)
   Stains Espoir · Symfony 7 · Asset Mapper
   Scoped under .rg-page — overrides app.css where needed.
   IMPORTANT: Aucun opacity:0 sur du contenu réel —
   GSAP anime uniquement transform (y).
══════════════════════════════════════════════════ */

/* ── Container ── */
.rg-page {
  --rg-r: min(760px, 100% - 3rem);
  --rg-serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  background: var(--cream, #FFFBF7);
}
.rg-r { width: var(--rg-r); margin-inline: auto; }
.rg-anim { will-change: transform; }

/* ══ SKELETON ══ */
#rg-skeleton {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--warm, #FFF8F0);
  overflow: hidden;
  transition: opacity .5s ease;
  pointer-events: all;
}
@keyframes rg-shimmer {
  0%   { background-position: -600px 0; }
  100% { background-position:  600px 0; }
}
.rg-sk-bone {
  background: linear-gradient(90deg, #ede0f5 0%, #ddc8f0 40%, #ede0f5 80%);
  background-size: 600px 100%;
  animation: rg-shimmer 1.6s infinite linear;
  border-radius: 10px;
}
.rg-sk-layout {
  max-width: 760px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* ══ HERO ══ */
.rg-hero {
  background: #FFF8F0;
  padding: 3rem 0 2.5rem;
  position: relative;
  overflow: hidden;
  border-bottom: 2px solid var(--text, #2B1A1A);
}
.rg-hero-bg {
  position: absolute;
  bottom: -0.15em;
  right: -0.04em;
  font-family: var(--rg-serif);
  font-size: clamp(6rem, 18vw, 14rem);
  font-weight: 900;
  font-style: italic;
  color: var(--brand, #6A1B9A);
  opacity: .055;
  line-height: 1;
  pointer-events: none;
  user-select: none;
}
/* Decorative star moved from HTML to CSS to avoid emoji rendering */
.rg-hero-bg::after { content: '\2756'; }
.rg-hero-pill {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: var(--brand-light, #F3E5F5);
  color: var(--brand, #6A1B9A);
  font-size: .72rem;
  font-weight: 700;
  padding: .25rem .85rem;
  border-radius: 20px;
  margin-bottom: .85rem;
  width: fit-content;
}
.rg-hero-title {
  font-family: var(--rg-serif);
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 900;
  font-style: italic;
  color: var(--text, #2B1A1A);
  line-height: 1.15;
  margin-bottom: .55rem;
}
.rg-hero-title em {
  color: var(--brand, #6A1B9A);
  font-style: italic;
}
.rg-hero-lead {
  font-size: .93rem;
  color: var(--muted, #7B5B5B);
  line-height: 1.65;
  max-width: 46ch;
  margin-bottom: .85rem;
}
.rg-hero-meta {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  font-size: .75rem;
  color: var(--muted, #7B5B5B);
}
.rg-hero-meta span { display: flex; align-items: center; gap: .3rem; }

/* ══ WIZARD BAR ══ */
.rg-wizard-wrap {
  background: #2B1A1A;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.rg-wizard-wrap::-webkit-scrollbar { display: none; }
/* Reset and replace app.css .wizard styles under .rg-page */
.rg-page .wizard {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  width: max-content;
  min-width: var(--rg-r);
  display: flex;
  flex-direction: row; /* explicit — cancels app.css @media 900px flex-direction:column */
  gap: 0;
}
.rg-page .wizard li {
  flex: 1 0 auto;
  padding: .8rem .75rem;
  display: flex;
  align-items: center;
  gap: .55rem;
  position: relative;
  cursor: default;
  border: none;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  transition: background .2s;
}
.rg-page .wizard li + li::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 1px; height: 40%;
  background: rgba(255,255,255,.1);
}
/* Scoped under .rg-page .wizard li to beat app.css ".wizard li span" (0,1,1) */
.rg-page .wizard li .rg-step-num {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: rgba(255,255,255,.1);
  color: rgba(255,255,255,.35);
  font-family: var(--rg-serif);
  font-weight: 900;
  font-style: italic;
  font-size: .9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  flex-grow: 0;
  transition: all .3s;
  place-items: unset; /* cancel app.css place-items:center */
}
/* Reset circle styling that app.css ".wizard li span" forces on every span */
.rg-page .wizard li .rg-step-label {
  display: inline;         /* cancel app.css display:grid */
  width: auto;             /* cancel app.css width:28px */
  height: auto;            /* cancel app.css height:28px */
  border-radius: 0;        /* cancel app.css border-radius:999px */
  background: transparent; /* cancel app.css background:#f4ecff */
  place-items: unset;      /* cancel app.css place-items:center */
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: rgba(255,255,255,.3);
  line-height: 1.3;
  transition: color .3s;
  font-style: normal;
}
.rg-page .wizard li.active .rg-step-num { background: var(--brand, #6A1B9A); color: #fff; }
.rg-page .wizard li.active .rg-step-label { color: rgba(255,255,255,.7); background: transparent; }
/* Clickable step bullets — visited steps only */
.rg-page .wizard li { cursor: default; }
.rg-page .wizard li.active:not(.current) { cursor: pointer; }
.rg-page .wizard li.active:not(.current):hover { background: rgba(255,255,255,.06); }
.rg-page .wizard li.active:not(.current):hover .rg-step-num { background: #8e3cc4; }
.rg-page .wizard li.current .rg-step-num {
  background: #e9c8ff;
  color: #2B1A1A;
  box-shadow: 0 0 0 3px rgba(233,200,255,.3);
}
/* app.css ".wizard li.current span" sets background:var(--brand) — must reset */
.rg-page .wizard li.current .rg-step-label { color: #e9c8ff; font-weight: 800; background: transparent; }

/* ══ FORM BODY ══ */
.rg-body { padding: 2rem 0 3rem; background: var(--cream, #FFFBF7); }

/* ══ STEP PANE ══ */
.rg-pane {
  background: #fff;
  border: 1px solid #EDE5D8;
  border-radius: 14px;
  padding: 1.8rem 2rem;
  position: relative;
  overflow: hidden;
}
.rg-pane-bg-num {
  position: absolute;
  top: -.1em; right: -.04em;
  font-family: var(--rg-serif);
  font-size: 9rem;
  font-weight: 900;
  font-style: italic;
  color: var(--brand, #6A1B9A);
  opacity: .04;
  line-height: 1;
  pointer-events: none;
  user-select: none;
}
.rg-pane-title {
  font-family: var(--rg-serif);
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text, #2B1A1A);
  margin-bottom: 1.2rem;
  position: relative;
}
.rg-pane-eyebrow {
  display: block;
  font-family: sans-serif;
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted, #7B5B5B);
  margin-bottom: .3rem;
  font-style: normal;
}

/* ══ FORM FIELDS ══ */
.rg-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: .85rem;
  row-gap: 2rem;        /* extra room for absolute error messages above each field */
  padding-top: 1.4rem;  /* space for error on the first row */
}
.rg-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  column-gap: .75rem;
  row-gap: 2rem;
  padding-top: 1.4rem;
}
.rg-field { position: relative; display: block; }
.rg-page .wide { grid-column: 1 / -1; }

/* Override app.css .fgroup + new .rg-field — both used (fgroup by register.js kids) */
.rg-page .fgroup input,
.rg-page .fgroup select,
.rg-page .fgroup textarea,
.rg-field input,
.rg-field select,
.rg-field textarea {
  width: 100%;
  border: 1.5px solid #EDE5D8;
  border-radius: 9px;
  background: #FFFBF7;
  padding: 1.1rem .9rem .45rem;
  font-size: .9rem;
  color: var(--text, #2B1A1A);
  outline: none;
  transition: border-color .2s, background .2s;
  -webkit-appearance: none;
  appearance: none;
}
.rg-page .fgroup input:focus,
.rg-page .fgroup select:focus,
.rg-page .fgroup textarea:focus,
.rg-field input:focus,
.rg-field select:focus,
.rg-field textarea:focus {
  border-color: var(--brand, #6A1B9A);
  background: #fff;
}
/* Floating labels — fixed position (not animated, overrides app.css) */
/* :not(.rg-field-error) — exclude error messages from label rules */
.rg-page .fgroup.floating > span:not(.rg-field-error),
.rg-field > span:not(.rg-field-error) {
  position: absolute;
  left: .9rem;
  top: .38rem;
  font-size: .63rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted, #7B5B5B);
  pointer-events: none;
  background: transparent;    /* reset app.css background:#fff */
  padding: 0;                 /* reset app.css padding:0 6px */
  transform-origin: unset;    /* reset app.css transform-origin:left top */
  transition: none;           /* prevent color animation from app.css transition:all */
}
/* Cancel app.css floating animation under .rg-page */
.rg-page .fgroup.floating input:not(:placeholder-shown) + span,
.rg-page .fgroup.floating input:focus + span,
.rg-page .fgroup.floating select:focus + span,
.rg-page .fgroup.floating textarea:not(:placeholder-shown) + span,
.rg-page .fgroup.floating textarea:focus + span {
  transform: none;
  color: var(--muted, #7B5B5B);
}
/* Password input row — isolates showpass positioning from meter+hint */
.rg-input-row { position: relative; }
/* Password input — extra right padding so typed text never overlaps the eye */
.rg-field.password input { padding-right: 2.6rem; }
/* Show/hide password toggle */
.rg-page .showpass {
  position: absolute;
  right: .7rem; top: 50%;
  transform: translateY(-50%);
  border: 0; background: transparent;
  cursor: pointer; padding: .2rem; line-height: 1;
  color: var(--muted, #7B5B5B);
  display: flex; align-items: center; justify-content: center;
  border-radius: 4px;
  transition: color .15s;
}
.rg-page .showpass:hover { color: var(--brand, #6A1B9A); }
/* Placeholder — muted hint text visible inside the input */
.rg-field input::placeholder,
.rg-field textarea::placeholder {
  color: #bfae9e;
  font-size: .82rem;
  font-weight: 400;
}
/* Password meter */
.rg-page .meter {
  height: 3px;
  background: #EDE5D8;
  border-radius: 2px;
  margin-top: .35rem;
  overflow: hidden;
}
/* Hint badge */
.rg-hint {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .7rem;
  color: #9b6b2a;
  background: #FFF8F0;
  border: 1px solid #E8D5C0;
  padding: .22rem .75rem;
  border-radius: 20px;
  margin-top: .5rem;
}
/* Actions row */
.rg-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1.5rem;
  padding-top: 1.2rem;
  border-top: 1px solid #EDE5D8;
  gap: .75rem;
}
.rg-already { font-size: .77rem; color: var(--muted, #7B5B5B); }
.rg-already a { color: var(--brand, #6A1B9A); text-decoration: none; font-weight: 700; }
.rg-already a:hover { text-decoration: underline; }

/* ══ INLINE VALIDATION ERRORS ══════════════════════════════════════════ */

/* 1 — Border + glow transition (smooth, no shake) */
.rg-field.is-error input,
.rg-field.is-error select,
.rg-field.is-error textarea,
.fgroup.is-error input,
.fgroup.is-error select,
.fgroup.is-error textarea {
  border-color: #e53935 !important;
  box-shadow: 0 0 0 3px rgba(229,57,53,.13) !important;
  background: #fff !important;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
/* 2 — Red label */
.rg-field.is-error > span:not(.rg-field-error),
.fgroup.is-error > span {
  color: #e53935 !important;
}
/* 3 — Checkbox consent */
.rg-check.is-error > span { color: #e53935; }

/* 4 — Error message: positioned ABOVE the field, slides up from bottom */
@keyframes rg-err-in {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: translateY(0); }
}
.rg-field-error {
  position: absolute !important;
  bottom: calc(100% + .3rem);
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: .38rem;
  font-size: .72rem;
  font-weight: 600;
  color: #e53935;
  line-height: 1.3;
  white-space: nowrap;
  /* Reset app.css .fgroup.floating > span properties */
  background: transparent;
  padding: 0;
  transition: none;
  transform-origin: unset;
  animation: rg-err-in .2s cubic-bezier(.2,.8,.4,1) both;
}
/* .fgroup (kid cards) needs position:relative for absolute error positioning */
.rg-page .fgroup { position: relative; }
/* Override .grid-2/.grid-3 (app.css gap:--s-5=1.5rem) for error clearance */
.rg-page .grid-2,
.rg-page .grid-3 {
  row-gap: 2rem;
  padding-top: 1.4rem;
}
/* Warning triangle SVG icon */
.rg-field-error::before {
  content: '';
  flex-shrink: 0;
  width: 14px; height: 14px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e53935' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z'/%3E%3Cline x1='12' y1='9' x2='12' y2='13'/%3E%3Cline x1='12' y1='17' x2='12.01' y2='17'/%3E%3C/svg%3E") no-repeat center / contain;
}
/* 5 — Keep focus ring red when invalid */
.rg-field.is-error input:focus,
.rg-field.is-error select:focus {
  box-shadow: 0 0 0 3px rgba(229,57,53,.2) !important;
}

/* ══ KID CARDS (generated by register.js) ══ */
.rg-page .kid {
  background: #FFFBF7;
  border: 1px solid #EDE5D8;
  border-radius: 10px;
  padding: 1rem 1.2rem;
  margin-bottom: .75rem;
}
.rg-page .kid .grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .65rem;
}
.rg-add-kid-btn {
  display: block; width: 100%;
  background: var(--brand-light, #F3E5F5);
  border: none; border-radius: 10px;
  color: var(--brand, #6A1B9A);
  font-size: .85rem; font-weight: 700;
  padding: .65rem 1rem;
  cursor: pointer; text-align: center;
  margin-bottom: .75rem;
  transition: background .2s;
}
.rg-add-kid-btn:hover { background: var(--brand-pale, #FAF5FF); }

/* ══ RECAP GRID (also has .recap-grid for JS) ══ */
.rg-recap-grid,
.rg-page .recap-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .75rem;
  margin-bottom: 1.2rem;
}
.rg-page .recap-card {
  background: #FFFBF7;
  border: 1px solid #EDE5D8;
  border-radius: 10px;
  padding: .85rem;
}
.rg-page .recap-card h4 {
  font-size: .65rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted, #7B5B5B); margin-bottom: .4rem;
}

/* ══ CONSENTS ══ */
.rg-consents {
  background: #FFF8F0;
  border: 1px solid #E8D5C0;
  border-radius: 10px;
  padding: 1rem 1.2rem;
  margin-bottom: 1rem;
  display: flex; flex-direction: column; gap: .65rem;
}
.rg-check {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: .84rem; color: #5a3a3a;
  cursor: pointer; line-height: 1.5;
}
.rg-check input[type="checkbox"] {
  margin-top: 2px; flex-shrink: 0;
  accent-color: var(--brand, #6A1B9A);
  width: 16px; height: 16px;
}

/* ══ SUCCESS ══ */
.rg-success-section { padding: 3rem 0; background: var(--cream, #FFFBF7); }
.rg-success {
  background: linear-gradient(140deg, #FFF8F0 0%, var(--brand-pale, #FAF5FF) 100%);
  border: 1px solid #EDE5D8; border-radius: 16px;
  padding: 3rem 2rem; text-align: center;
  max-width: 600px; margin: 0 auto;
}
.rg-success-icon {
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1.25rem;
  color: var(--brand, #6A1B9A);
}
.rg-success-icon svg { width: 3.5rem; height: 3.5rem; }
.rg-success h2 {
  font-family: var(--rg-serif);
  font-size: clamp(1.3rem, 3vw, 1.7rem);
  font-weight: 800; font-style: italic;
  color: var(--text, #2B1A1A); margin-bottom: .55rem;
}
.rg-success p {
  font-size: .92rem; color: var(--muted, #7B5B5B);
  line-height: 1.65; max-width: 42ch;
  margin: 0 auto 1.25rem;
}
.rg-success-badge {
  display: inline-flex; align-items: center; gap: .45rem;
  background: var(--brand-light, #F3E5F5);
  color: var(--brand, #6A1B9A);
  border: 1px solid #e9c8ff; border-radius: 10px;
  padding: .65rem 1.25rem; font-size: .8rem; font-weight: 700;
  margin-bottom: 1.5rem;
}
.rg-success-btns { display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; }

/* ══ ERROR MESSAGE ══ */
.rg-page .form-msg {
  color: #c0392b; font-size: .84rem; font-weight: 600;
  margin-top: .75rem; min-height: 1.2em; padding: 0 .25rem;
}
.rg-page .form-msg:not(:empty) {
  background: #fff0f0; border: 1px solid #f5c6cb;
  border-radius: 8px; padding: .55rem .85rem;
}

/* ══ RESPONSIVE ══ */
@media (max-width: 640px) {
  .rg-grid-2 { grid-template-columns: 1fr; }
  .rg-grid-3 { grid-template-columns: 1fr; }
  .rg-page .kid .grid-3 { grid-template-columns: 1fr; }
  .rg-recap-grid,
  .rg-page .recap-grid { grid-template-columns: 1fr; }
  .rg-step-label { display: none; }
  .rg-pane { padding: 1.2rem 1rem; }
  .rg-actions { flex-wrap: wrap; }
  .rg-actions .btn { flex: 1; justify-content: center; text-align: center; }
  .rg-hero-meta { gap: .75rem; font-size: .7rem; }
  .rg-hero { padding: 2rem 0 1.75rem; }
}

/* ══ HIDE HERO WHEN SUCCESS IS SHOWN ══ */
/* register.js hides #formSection on success but not the hero.
   CSS :has() hides the hero when successBlock is visible. */
.rg-page:has(#successBlock:not([hidden])) .rg-hero {
  display: none;
}
