/* ================================
   CANAL+ Réunion - Quiz ToteBag
   Design inspiré CanalBox / LDC
   Optimisé mobile 480×800
   ================================ */

/* ---------- Variables globales ---------- */
:root {
  --canal-blue: #0b74de;
  --canal-black: #000;
  --canal-white: #fff;
  --frame-bg: rgba(255, 255, 255, 0.88);
  --shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  --radius: 12px;
  --transition: 0.3s ease;
}

/* ---------- Reset ---------- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  font-family: "CanalDemiRomain", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--canal-white);
  background: var(--canal-black);
  overflow-x: hidden;
  position: relative;
}

/* ---------- PAGE D’ACCUEIL ---------- */
body.home {
  background: #000 url("../assets/background.jpg") no-repeat center top / cover fixed;
}

.header {
  position: fixed;
  top: max(10px, env(safe-area-inset-top));
  left: max(12px, env(safe-area-inset-left));
  z-index: 5;
  display: flex;
  align-items: center;
}

.logo {
  width: min(180px, 40vw);
  height: auto;
}

.bottom-stack {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  width: 100%;
  max-width: 480px;
  text-align: center;
}

.cover-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.cover {
  width: auto;
  max-width: 90%;
  height: auto;
  display: block;
}

.actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.btn {
  padding: 12px 24px;
  border-radius: 8px;
  border: 2px solid var(--canal-white);
  background: var(--canal-white);
  color: var(--canal-black);
  font-family: "CanalBoldRomain", sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition);
  width: min(260px, 80vw);
}

.btn:hover {
  background: transparent;
  color: var(--canal-white);
}

.btn:active {
  transform: translateY(1px);
}

a.link {
  color: var(--canal-white);
  text-decoration: underline;
  font-weight: 600;
  font-family: "CanalBoldRomain", sans-serif;
  font-size: 0.9rem;
}

/* ---------- FORMULAIRE & QUIZ (fond commun) ---------- */
body.form-page,
body.quiz-page {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  min-height: 100vh;
  background: #000 url("../assets/background.jpg") no-repeat center top / cover fixed;
  position: relative;
}

.form-background,
.quiz-background {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: url("../assets/background.jpg") no-repeat center top / cover;
  filter: brightness(0.9);
}

/* ---------- FRAME GÉNÉRIQUE (formulaire, quiz, message) ---------- */
.form-frame,
.quiz-frame,
.message-box {
  background: var(--frame-bg);
  color: #111;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  max-width: 420px;
  width: 85%;
  margin-top: 30vh; /* ✅ Juste sous le 1/3 de l’écran */
  text-align: left;
  animation: fadeSlideIn 0.6s ease both;
}

/* ---------- FORMULAIRE ---------- */
.form-frame h2 {
  text-align: center;
  font-family: "CanalBoldRomain", sans-serif;
  margin-bottom: 16px;
  color: #000;
}

.form-frame label {
  display: block;
  margin-bottom: 10px;
  font-size: 0.95rem;
}

.form-frame input[type="text"],
.form-frame input[type="email"],
.form-frame select {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #ccc;
  font-size: 1rem;
  background: #fff;
  color: #111;
  margin-top: 4px;
}

.form-frame .checkbox {
  font-size: 0.85rem;
  color: #111;
  margin-top: 8px;
}

.form-frame .actions {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}

.errors {
  background: #ffecec;
  color: #b00;
  border: 1px solid #f5c6c6;
  border-radius: 6px;
  padding: 10px;
  margin-bottom: 12px;
}

/* ---------- QUIZ ---------- */
.quiz-frame h2 {
  text-align: center;
  font-family: "CanalBoldRomain", sans-serif;
  margin-bottom: 16px;
  color: #000;
}

.quiz-frame p {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 12px;
  text-align: center;
}

.quiz-form label {
  display: block;
  margin: 10px 0;
  font-size: 0.95rem;
  color: #111;
}

.quiz-form input[type="radio"] {
  margin-right: 6px;
}

.quiz-form .actions {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}

/* ---------- PAGES MERCI / BRAVO ---------- */
.message-box {
  text-align: center;
  color: #111;
  padding: 24px;
}

/* ---------- Animation ---------- */
@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- Responsive ---------- */
@media (max-height: 640px) {
  .form-frame,
  .quiz-frame,
  .message-box {
    margin-top: 25vh;
  }
}

@media (max-width: 700px) {
  .form-frame,
  .quiz-frame,
  .message-box {
    margin-left: 16px;
    margin-right: 16px;
  }
}
