/* RQuiz — pages publiques et d'authentification (complète home.css) */

.hidden { display: none !important; }
.s-hide-sm { display: inline; }

/* ---------- Auth layout ---------- */

.s-auth-body { min-height: 100vh; }
.s-auth { display: grid; grid-template-columns: minmax(320px, 0.85fr) minmax(0, 1.15fr); min-height: 100vh; }

.s-auth__aside {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 2.5rem;
  overflow: hidden;
  color: #F3F0FF;
  background:
    radial-gradient(ellipse 80% 60% at 15% 0%, rgba(192, 38, 211, 0.35), transparent 60%),
    radial-gradient(ellipse 70% 50% at 100% 100%, rgba(124, 58, 237, 0.4), transparent 60%),
    #0D0A1E;
}
.s-auth__aside::after {
  content: '';
  position: absolute;
  right: -120px;
  bottom: 18%;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 40px rgba(255, 255, 255, 0.02), 0 0 0 90px rgba(255, 255, 255, 0.015);
  pointer-events: none;
}
.s-auth__logo img { height: 54px; width: auto; }
.s-auth__pitch { position: relative; z-index: 1; max-width: 420px; }
.s-auth__kicker { display: inline-block; padding: 0.35rem 0.85rem; border-radius: 999px; background: rgba(255, 255, 255, 0.1); color: #E9D5FF; font-size: 0.82rem; font-weight: 700; }
.s-auth__claim { margin-top: 1.1rem; font-size: clamp(1.6rem, 2.4vw, 2.2rem); font-weight: 800; line-height: 1.15; letter-spacing: -0.02em; color: #FFFFFF; }
.s-auth__spaces { margin: 2rem 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 0.9rem; }
.s-auth__spaces li { display: flex; gap: 0.85rem; align-items: center; padding: 0.85rem 1rem; border-radius: 16px; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.1); }
.s-auth__spaces strong { display: block; color: #FFFFFF; font-size: 0.95rem; }
.s-auth__spaces span { color: #C9C3E6; font-size: 0.86rem; }
.s-auth__dot { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 1.2rem; flex-shrink: 0; }
.s-auth__dot span, .s-auth__dot i { color: inherit; }
.s-auth__dot--student { background: rgba(167, 139, 250, 0.18); color: #C4B5FD; }
.s-auth__dot--parent { background: rgba(52, 211, 153, 0.16); color: #6EE7B7; }
.s-auth__dot--teacher { background: rgba(251, 191, 36, 0.16); color: #FCD34D; }
.s-auth__foot { position: relative; z-index: 1; color: #8E88AE; font-size: 0.85rem; }

.s-auth__main { display: flex; flex-direction: column; align-items: center; padding: 1.5rem 1.5rem 3rem; }
.s-auth__bar { width: 100%; max-width: 560px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 2rem; }
.s-auth__back { display: inline-flex; align-items: center; gap: 0.4rem; font-weight: 600; font-size: 0.92rem; color: var(--h-muted); }
.s-auth__back:hover { color: var(--h-primary); }
.s-auth__logo-sm { display: none; }
.s-auth__logo-sm img { height: 40px; width: auto; }

/* ---------- Card ---------- */

.s-card {
  width: 100%;
  max-width: 460px;
  margin: auto 0;
  padding: 2.2rem 2rem;
  border-radius: 24px;
  background: var(--h-surface);
  border: 1px solid var(--h-border);
  box-shadow: var(--h-shadow-lg);
}
.s-card--wide { max-width: 640px; }
.s-card__head { margin-bottom: 1.6rem; }
.s-card__title { font-size: 1.75rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; }
.s-card__subtitle { margin-top: 0.45rem; color: var(--h-muted); }
.s-card__foot { margin-top: 1.6rem; padding-top: 1.3rem; border-top: 1px solid var(--h-border); text-align: center; color: var(--h-muted); font-size: 0.94rem; }
.s-stack { display: flex; flex-direction: column; gap: 1.1rem; }

/* ---------- Fields ---------- */

.s-field { display: flex; flex-direction: column; gap: 0.4rem; }
.s-field > label, .s-label { font-weight: 600; font-size: 0.9rem; }
.s-optional { color: var(--h-muted); font-weight: 500; }
.s-control { position: relative; }
.s-control > i.ph { position: absolute; left: 0.95rem; top: 50%; transform: translateY(-50%); font-size: 1.15rem; color: var(--h-muted); pointer-events: none; }
.s-input {
  width: 100%;
  min-height: 48px;
  padding: 0.75rem 0.95rem;
  border-radius: 12px;
  border: 1px solid var(--h-border);
  background: var(--h-bg);
  color: var(--h-text);
  font: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.s-input::placeholder { color: var(--h-muted); opacity: 0.8; }
.s-input:focus { outline: none; border-color: var(--h-primary); box-shadow: 0 0 0 3px var(--h-primary-soft); }
.s-control > i.ph + .s-input { padding-left: 2.75rem; }
.s-control--eye .s-input { padding-right: 3.2rem; }
select.s-input { appearance: none; padding-right: 2.6rem; background-image: linear-gradient(45deg, transparent 50%, var(--h-muted) 50%), linear-gradient(135deg, var(--h-muted) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; }
textarea.s-input { min-height: 130px; resize: vertical; }
.s-eye {
  position: absolute;
  right: 0.35rem;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--h-muted);
  cursor: pointer;
  font-size: 1.15rem;
}
.s-eye:hover { color: var(--h-text); background: var(--h-surface-2); }
.s-eye svg { width: 20px; height: 20px; pointer-events: none; }
.s-hint { color: var(--h-muted); font-size: 0.83rem; }
.s-error { color: #DC2626; font-size: 0.85rem; font-weight: 600; }
.s-error--toggle { display: none; }
.s-error--toggle.visible { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }
[data-theme="dark"] .s-error { color: #F87171; }
.s-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.s-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem; font-size: 0.92rem; }
.s-check { display: inline-flex; align-items: flex-start; gap: 0.55rem; cursor: pointer; color: var(--h-muted); font-weight: 500; font-size: 0.92rem; }
.s-check input { width: 18px; height: 18px; margin-top: 0.1rem; accent-color: var(--h-primary); flex-shrink: 0; }
.s-link { color: var(--h-primary); font-weight: 700; }
.s-link:hover { text-decoration: underline; }
.s-btn-block { width: 100%; min-height: 50px; }
.s-btn-block[disabled] { opacity: 0.7; cursor: progress; transform: none; }

.s-btn-danger { background: #DC2626; color: #FFFFFF; }
.s-btn-danger:hover { background: #B91C1C; }
.s-dialog { width: min(520px, calc(100vw - 2rem)); padding: 1.8rem; border: 1px solid var(--h-border); border-radius: 20px; background: var(--h-surface); color: var(--h-text); box-shadow: var(--h-shadow-lg); }
.s-dialog::backdrop { background: rgba(13, 10, 30, 0.6); backdrop-filter: blur(3px); }

.s-otp { text-align: center; font-size: 1.6rem; font-weight: 700; letter-spacing: 0.4em; }

/* ---------- Social & divider ---------- */

.s-social { display: flex; flex-direction: column; gap: 0.65rem; }
.s-social__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  min-height: 48px;
  padding: 0.7rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--h-border);
  background: var(--h-surface);
  color: var(--h-text);
  font: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.s-social__btn:hover { border-color: var(--h-primary); transform: translateY(-1px); }
.s-social__btn img, .s-social__btn svg { width: 20px; height: 20px; flex-shrink: 0; }
.s-divider { display: flex; align-items: center; gap: 0.9rem; margin: 1.4rem 0; color: var(--h-muted); font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }
.s-divider::before, .s-divider::after { content: ''; flex: 1; height: 1px; background: var(--h-border); }

/* ---------- Alerts ---------- */

.s-alert { display: flex; gap: 0.7rem; align-items: flex-start; padding: 0.9rem 1rem; border-radius: 14px; font-size: 0.93rem; line-height: 1.5; }
.s-alert > i.ph { font-size: 1.25rem; flex-shrink: 0; margin-top: 0.05rem; }
.s-alert--error { background: rgba(220, 38, 38, 0.08); color: #B91C1C; border: 1px solid rgba(220, 38, 38, 0.2); }
.s-alert--success { background: var(--h-success-soft); color: var(--h-success); border: 1px solid rgba(4, 120, 87, 0.2); }
.s-alert--info { background: var(--h-primary-soft); color: var(--h-primary-soft-text); border: 1px solid rgba(124, 58, 237, 0.18); }
.s-alert--warning { background: var(--h-warning-soft); color: var(--h-warning); border: 1px solid rgba(180, 83, 9, 0.2); }
[data-theme="dark"] .s-alert--error { color: #FCA5A5; background: rgba(248, 113, 113, 0.1); }

/* ---------- Steps (multi-step forms) ---------- */

.s-steps { display: flex; gap: 0.5rem; margin-bottom: 1.6rem; }
.s-step { flex: 1; display: flex; flex-direction: column; gap: 0.45rem; }
.s-step__bar { height: 5px; border-radius: 999px; background: var(--h-surface-2); overflow: hidden; }
.s-step__bar span { display: block; height: 100%; width: 0; background: var(--h-gradient); transition: width 0.35s ease; }
.s-step.is-active .s-step__bar span, .s-step.is-done .s-step__bar span { width: 100%; }
.s-step__label { font-size: 0.8rem; font-weight: 700; color: var(--h-muted); }
.s-step.is-active .s-step__label { color: var(--h-primary); }
body:has(#registerStep2Details:not(.hidden)) .s-step--2 .s-step__bar span { width: 100%; }
body:has(#registerStep2Details:not(.hidden)) .s-step--2 .s-step__label { color: var(--h-primary); }
.s-section-label { font-size: 0.78rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--h-muted); padding-top: 0.4rem; border-top: 1px solid var(--h-border); margin-top: 0.3rem; padding-top: 1.1rem; }
.s-note { display: flex; align-items: center; justify-content: center; gap: 0.4rem; color: var(--h-muted); font-size: 0.85rem; margin-top: 1rem; }
.s-note i { color: var(--h-primary); }
.sparkle { position: fixed; width: 6px; height: 6px; border-radius: 50%; pointer-events: none; z-index: 9999; animation: sparkle-out 0.75s ease-out forwards; }
@keyframes sparkle-out {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(calc(-50% + var(--sx)), calc(-50% + var(--sy))) scale(0); }
}

/* ---------- Status pages ---------- */

.s-status { text-align: center; }
.s-status__icon { width: 76px; height: 76px; margin: 0 auto 1.2rem; border-radius: 22px; display: grid; place-items: center; font-size: 2.3rem; background: var(--h-primary-soft); color: var(--h-primary-soft-text); }
.s-status__icon--success { background: var(--h-success-soft); color: var(--h-success); }
.s-status__icon--error { background: rgba(220, 38, 38, 0.1); color: #DC2626; }
.s-status__icon--warning { background: var(--h-warning-soft); color: var(--h-warning); }
.s-status .s-card__subtitle { max-width: 380px; margin-left: auto; margin-right: auto; }
.s-actions { display: flex; flex-direction: column; gap: 0.7rem; margin-top: 1.6rem; }
.s-spinner { width: 46px; height: 46px; margin: 0 auto; border-radius: 50%; border: 4px solid var(--h-primary-soft); border-top-color: var(--h-primary); animation: s-spin 0.9s linear infinite; }
@keyframes s-spin { to { transform: rotate(360deg); } }

/* ---------- Public pages ---------- */

.s-page-body { display: flex; flex-direction: column; min-height: 100vh; }
.s-header { position: sticky; top: 0; z-index: 40; background: var(--h-nav-bg); backdrop-filter: blur(14px); border-bottom: 1px solid var(--h-border); }
.s-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; height: 72px; }
.s-header__logo img { height: 46px; width: auto; }
.s-header__actions { display: flex; align-items: center; gap: 0.5rem; }
.s-page { flex: 1; padding: 3rem 0 4.5rem; }
.s-page--narrow .h-container { max-width: 860px; }
.s-page__head { max-width: 720px; margin: 0 auto 2.2rem; text-align: center; }
.s-page__title { margin-top: 0.8rem; font-size: clamp(1.9rem, 3.4vw, 2.6rem); font-weight: 800; line-height: 1.15; letter-spacing: -0.02em; }
.s-page__subtitle { margin-top: 0.8rem; color: var(--h-muted); font-size: 1.06rem; }
.s-panel { padding: 1.8rem; border-radius: var(--h-radius); background: var(--h-surface); border: 1px solid var(--h-border); box-shadow: var(--h-shadow); }
.s-panel + .s-panel { margin-top: 1.25rem; }
.s-panel__title { font-size: 1.15rem; font-weight: 800; margin-bottom: 1rem; display: flex; align-items: center; gap: 0.55rem; }
.s-panel__title i { color: var(--h-primary); }
.s-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.s-benefits { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 0.9rem; }
.s-benefits li { display: flex; gap: 0.75rem; }
.s-benefits i { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex-shrink: 0; font-size: 1.15rem; background: var(--h-primary-soft); color: var(--h-primary-soft-text); }
.s-benefits strong { display: block; }
.s-benefits span { color: var(--h-muted); font-size: 0.92rem; }

.s-rating { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.5rem; }
.s-rating__option { position: relative; display: flex; flex-direction: column; align-items: center; gap: 0.3rem; padding: 0.8rem 0.4rem; border-radius: 14px; border: 1px solid var(--h-border); background: var(--h-bg); cursor: pointer; text-align: center; transition: border-color 0.15s ease, background 0.15s ease; }
.s-rating__option input { position: absolute; opacity: 0; pointer-events: none; }
.s-rating__option:hover { border-color: var(--h-primary); }
.s-rating__option:has(input:checked) { border-color: var(--h-primary); background: var(--h-primary-soft); }
.s-rating__option:has(input:focus-visible) { outline: 2px solid var(--h-primary); outline-offset: 2px; }
.s-rating__stars { font-size: 0.78rem; letter-spacing: -1px; }
.s-rating__label { font-size: 0.82rem; font-weight: 700; }
.s-success { text-align: center; padding: 1rem 0; }

.s-prose { line-height: 1.75; }
.s-prose h1 { font-size: clamp(1.7rem, 3vw, 2.2rem); font-weight: 800; line-height: 1.2; letter-spacing: -0.02em; margin-bottom: 1.6rem; padding-bottom: 1.2rem; border-bottom: 1px solid var(--h-border); }
.s-legal { padding: 2.4rem; }
.s-prose h2 { font-size: 1.2rem; font-weight: 800; margin: 2rem 0 0.6rem; }
.s-prose h2:first-child { margin-top: 0; }
.s-prose h3 { font-size: 1.02rem; font-weight: 700; margin: 1.3rem 0 0.4rem; }
.s-prose p, .s-prose li { color: var(--h-muted); }
.s-prose p + p { margin-top: 0.7rem; }
.s-prose ul { padding-left: 1.2rem; margin: 0.5rem 0; }
.s-prose a { color: var(--h-primary); font-weight: 600; }
.s-prose strong { color: var(--h-text); }

/* ---------- Course PDFs ---------- */

.s-courses { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.25rem; }
.s-course { display: flex; flex-direction: column; overflow: hidden; border-radius: var(--h-radius); background: var(--h-surface); border: 1px solid var(--h-border); box-shadow: var(--h-shadow); transition: transform 0.2s ease, box-shadow 0.2s ease; }
.s-course:hover { transform: translateY(-3px); box-shadow: var(--h-shadow-lg); }
.s-course__thumb { height: 180px; display: grid; place-items: center; background: var(--h-gradient); color: rgba(255, 255, 255, 0.7); font-size: 3.5rem; }
.s-course__thumb img { width: 100%; height: 100%; object-fit: cover; }
.s-course__body { display: flex; flex-direction: column; gap: 0.7rem; padding: 1.3rem; flex: 1; }
.s-course__title { font-size: 1.2rem; font-weight: 800; }
.s-course__text { color: var(--h-muted); font-size: 0.94rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.s-course__meta { display: flex; justify-content: space-between; align-items: center; margin-top: auto; color: var(--h-muted); font-size: 0.9rem; }
.s-course__price { font-size: 1.3rem; font-weight: 800; color: var(--h-primary); }
.s-course-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1.2rem; }
.s-course-head__meta { display: flex; flex-wrap: wrap; gap: 1rem; color: var(--h-muted); font-size: 0.92rem; font-weight: 600; margin-top: 0.6rem; }
.s-course-head__meta span { display: inline-flex; align-items: center; gap: 0.35rem; }
.s-course-head__buy { text-align: right; }
.s-pages { overflow: hidden; border-radius: var(--h-radius); border: 1px solid var(--h-border); background: #FFFFFF; box-shadow: var(--h-shadow); margin-top: 1.25rem; }
.s-page-img { position: relative; overflow: hidden; background: #FFFFFF; }
.s-page-img__loading { position: absolute; inset: 0; display: grid; place-items: center; background: #F1F0F6; }
.s-page-img img { position: relative; z-index: 1; display: block; width: 100%; height: auto; min-height: 300px; object-fit: cover; object-position: top; transition: opacity 0.3s ease; vertical-align: bottom; }
.s-page-img img.is-loading { opacity: 0; }
.s-page-img img.is-locked { filter: blur(8px); transform: scale(1.01); }
.s-page-img__lock { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; padding: 1.5rem; background: rgba(13, 10, 30, 0.6); backdrop-filter: blur(2px); }
.s-page-img__lock-card { max-width: 360px; padding: 1.8rem; border-radius: 20px; text-align: center; color: #FFFFFF; background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.2); }
.s-page-img__lock-card h3 { font-size: 1.2rem; font-weight: 800; margin: 0.8rem 0 0.4rem; }
.s-page-img__lock-card p { color: rgba(255, 255, 255, 0.8); font-size: 0.9rem; margin-bottom: 1.2rem; }
.s-page-img__num { position: absolute; top: 1rem; right: 1rem; z-index: 3; padding: 0.25rem 0.75rem; border-radius: 999px; background: rgba(13, 10, 30, 0.8); color: #FFFFFF; font-size: 0.82rem; font-weight: 700; }

.s-footer { border-top: 1px solid var(--h-border); background: var(--h-surface); padding: 1.4rem 0; color: var(--h-muted); font-size: 0.88rem; }
.s-footer__inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.8rem; }
.s-footer nav { display: flex; gap: 1.2rem; }
.s-footer a:hover { color: var(--h-primary); }

/* ---------- Responsive ---------- */

@media (max-width: 960px) {
  .s-auth { grid-template-columns: minmax(0, 1fr); }
  .s-auth__aside { display: none; }
  .s-auth__logo-sm { display: block; }
  .s-auth__bar { margin-bottom: 1.5rem; }
  .s-layout { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 560px) {
  .s-hide-sm { display: none; }
  .s-auth__main { padding: 1rem 1rem 2rem; }
  .s-card { padding: 1.6rem 1.25rem; border-radius: 20px; }
  .s-card__title { font-size: 1.5rem; }
  .s-grid-2 { grid-template-columns: minmax(0, 1fr); }
  .s-rating { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .s-page { padding: 2rem 0 3rem; }
  .s-panel, .s-legal { padding: 1.3rem; }
}
