/* ============================================
   SAVE Enquête - Mobile-First • One-Per-Page
   Couleurs & style fidèles au PDF SAVE
   ============================================ */

:root {
  /* Palette PDF SAVE : blanc, noir, rouge, gris */
  --bg-white: #ffffff;
  --bg-light: #fafafa;
  --bg-soft: #f5f3f0;

  --accent-red: #e63946;
  --accent-red-dark: #c1121f;
  --accent-pink: #f4a0a0;

  --text-dark: #1a1a1a;
  --text-body: #2d2d2d;
  --text-secondary: #5a5a5a;
  --text-muted: #8a8a8a;
  --text-light: #b0b0b0;

  --border-light: #e8e5e0;
  --border-medium: #d4d0ca;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);

  --radius-sm: 8px;
  --radius-md: 12px;

  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Outfit', 'Inter', sans-serif;

  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s ease;
}

/* ============================================
   Reset & Base
   ============================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-primary);
  background: var(--bg-white);
  color: var(--text-body);
  min-height: 100vh;
  min-height: 100dvh;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ============================================
   Page / Slide System
   ============================================ */
.page {
  display: none;
  min-height: 100vh;
  min-height: 100dvh;
  align-items: center;
  justify-content: center;
  padding: 16px 16px 100px;
}

.page.active {
  display: flex;
  animation: pageIn 0.35s ease-out;
}

@keyframes pageIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.page-inner {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  padding: 24px 0;
}

/* ============================================
   Progress Bar
   ============================================ */
.progress-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
  display: none;
}

.progress-bar {
  height: 3px;
  background: var(--accent-red);
  width: 0%;
  transition: width 0.4s ease;
}

.progress-text {
  text-align: center;
  font-size: 0.7rem;
  color: var(--text-muted);
  padding: 5px 0;
  letter-spacing: 0.08em;
  font-weight: 600;
  text-transform: uppercase;
}

/* ============================================
   Logo images
   ============================================ */
.logo-main {
  display: block;
  width: 180px;
  max-width: 60%;
  height: auto;
  margin: 0 auto 28px;
}

.logo-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: auto;
  z-index: 999;
  pointer-events: none;
  display: block;
}

/* Remove old text-based logo styles */
.save-logo { display: none; }

/* ============================================
   Landing Screen (Mobile First)
   ============================================ */
.landing-page {
  position: relative;
  overflow: hidden;
}

/* Subtle juridic background image */
.landing-page::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('/images/juridic4.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.12;
  z-index: 0;
  pointer-events: none;
  filter: grayscale(30%);
}

/* Soft radial vignette to focus attention on the center */
.landing-page::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(
    ellipse at center,
    transparent 40%,
    rgba(255, 255, 255, 0.85) 100%
  );
  z-index: 0;
  pointer-events: none;
}

.landing-page .page-inner {
  position: relative;
  z-index: 1;
}

.landing-content {
  text-align: center;
}

/* Instagram handle – top of landing */
.instagram-top-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent-red);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.85rem;
  font-family: var(--font-primary);
  padding: 6px 16px;
  border: 1.5px solid var(--accent-red);
  border-radius: 50px;
  margin-bottom: 20px;
  transition: var(--transition-normal);
  letter-spacing: 0.02em;
}

.instagram-top-link:hover {
  background: var(--accent-red);
  color: white;
}

.instagram-top-link:active {
  transform: scale(0.96);
}

.instagram-top-link svg {
  flex-shrink: 0;
}

.landing-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 14px;
  color: var(--text-dark);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.landing-subtitle {
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.7;
  margin-bottom: 24px;
}

.landing-info {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.info-card {
  background: var(--bg-soft);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.info-icon { font-size: 1rem; }

.info-text {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-dark);
}

.btn-start {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--accent-red);
  color: white;
  border: none;
  padding: 14px 32px;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 50px;
  cursor: pointer;
  transition: var(--transition-normal);
  font-family: var(--font-primary);
  box-shadow: 0 4px 16px rgba(230, 57, 70, 0.25);
  width: 100%;
  max-width: 300px;
  justify-content: center;
}

.btn-start:active {
  transform: scale(0.97);
  background: var(--accent-red-dark);
}

.landing-contacts {
  margin-top: 32px;
  color: var(--text-muted);
  font-size: 0.72rem;
  border-top: 1px solid var(--border-light);
  padding-top: 16px;
}

.landing-contacts p {
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.6rem;
}

.landing-contacts span {
  display: block;
  line-height: 1.8;
}

/* ============================================
   Question Page Styles
   ============================================ */
.q-number {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-red);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--accent-red);
}

.q-total {
  color: var(--text-light);
  font-weight: 500;
}

.q-label {
  display: block;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 20px;
  line-height: 1.5;
}

.q-sublabel {
  display: block;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-top: 16px;
  margin-bottom: 8px;
}

.q-hint {
  color: var(--text-muted);
  font-size: 0.82rem;
  margin-bottom: 14px;
  font-style: italic;
}

.q-hint-inline {
  color: var(--text-muted);
  font-size: 0.82rem;
  font-style: italic;
}

/* ============================================
   Form Inputs
   ============================================ */
.textarea-input,
.text-input {
  width: 100%;
  background: var(--bg-soft);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--text-dark);
  font-family: var(--font-primary);
  font-size: 16px; /* prevents iOS zoom */
  line-height: 1.6;
  transition: var(--transition-normal);
  resize: vertical;
}

.textarea-input:focus,
.text-input:focus {
  outline: none;
  border-color: var(--accent-red);
  background: var(--bg-white);
  box-shadow: 0 0 0 3px rgba(230, 57, 70, 0.1);
}

.textarea-input::placeholder,
.text-input::placeholder {
  color: var(--text-light);
  font-style: italic;
}

.text-input {
  height: 46px;
  margin-top: 10px;
}

.hidden {
  display: none !important;
}

/* ============================================
   Select (Dropdown)
   ============================================ */
.select-input {
  width: 100%;
  background: var(--bg-soft);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  color: var(--text-dark);
  font-family: var(--font-primary);
  font-size: 16px;
  line-height: 1.6;
  transition: var(--transition-normal);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238a8a8a' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}

.select-input:focus {
  outline: none;
  border-color: var(--accent-red);
  background-color: var(--bg-white);
  box-shadow: 0 0 0 3px rgba(230, 57, 70, 0.1);
}

.select-input option {
  padding: 8px;
}

/* ============================================
   Checkbox Grid (Mobile = stacked)
   ============================================ */
.checkbox-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 4px;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-soft);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-normal);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.checkbox-item:active {
  background: rgba(230, 57, 70, 0.06);
  border-color: var(--accent-pink);
}

.checkbox-item input[type="checkbox"] { display: none; }

.checkbox-custom {
  width: 22px;
  height: 22px;
  min-width: 22px;
  border: 2px solid var(--border-medium);
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-normal);
}

.checkbox-custom::after {
  content: '';
  width: 12px;
  height: 12px;
  background: var(--accent-red);
  border-radius: 3px;
  opacity: 0;
  transform: scale(0);
  transition: var(--transition-normal);
}

.checkbox-item input[type="checkbox"]:checked + .checkbox-custom {
  border-color: var(--accent-red);
}

.checkbox-item input[type="checkbox"]:checked + .checkbox-custom::after {
  opacity: 1;
  transform: scale(1);
}

.checkbox-item input[type="checkbox"]:checked ~ .checkbox-text {
  color: var(--text-dark);
  font-weight: 600;
}

.checkbox-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ============================================
   Page Navigation (fixed bottom)
   ============================================ */
.page-nav {
  position: fixed;
  bottom: 40px;
  right: 16px;
  left: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 998;
  pointer-events: none;
}

.page-nav > * {
  pointer-events: auto;
}
.btn-next,
.btn-prev,
.btn-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 50px;
  cursor: pointer;
  transition: var(--transition-normal);
  font-family: var(--font-primary);
  border: none;
}

.btn-next {
  background: var(--accent-red);
  color: white;
  margin-left: auto;
  box-shadow: 0 2px 10px rgba(230, 57, 70, 0.2);
}

.btn-next:active {
  background: var(--accent-red-dark);
  transform: scale(0.97);
}

.btn-prev {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border-light);
  padding: 10px 14px;
}

.btn-prev:active {
  background: var(--bg-soft);
}

.btn-submit {
  background: var(--accent-red);
  color: white;
  margin-left: auto;
  box-shadow: 0 2px 10px rgba(230, 57, 70, 0.2);
}

.btn-submit:active {
  background: var(--accent-red-dark);
  transform: scale(0.97);
}

.btn-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.spinner { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================
   Success Screen
   ============================================ */
.success-icon {
  margin-bottom: 20px;
  color: var(--accent-red);
  animation: successPop 0.5s ease-out 0.2s both;
}

@keyframes successPop {
  from { opacity: 0; transform: scale(0.5); }
  to   { opacity: 1; transform: scale(1); }
}

.success-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-dark);
}

.success-text {
  color: var(--text-secondary);
  font-size: 0.92rem;
  max-width: 380px;
  margin: 0 auto 24px;
  line-height: 1.7;
}

.success-contact {
  color: var(--text-muted);
  font-size: 0.82rem;
  margin-top: 8px;
}

/* ============================================
   ▲ TABLET (min-width: 600px)
   ============================================ */
@media (min-width: 600px) {
  .page { padding: 24px; }

  .page-inner {
    max-width: 560px;
    padding: 32px 0;
  }

  .logo-main { width: 220px; }

  .landing-title { font-size: 1.45rem; }
  .landing-subtitle { font-size: 0.95rem; }

  .q-label { font-size: 1.1rem; }

  .checkbox-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .btn-start { width: auto; }

  .success-title { font-size: 1.7rem; }

  .landing-page::before {
    opacity: 0.08;
  }
}

/* ============================================
   ▲ DESKTOP (min-width: 900px)
   ============================================ */
@media (min-width: 900px) {
  .page-inner { max-width: 600px; }

  .logo-main { width: 260px; }
  .logo-footer { max-width: 440px; }

  .landing-title { font-size: 1.6rem; }

  .q-label { font-size: 1.15rem; }

  .checkbox-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .btn-start:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(230, 57, 70, 0.3);
  }

  .btn-next:hover {
    background: var(--accent-red-dark);
    transform: translateY(-1px);
  }

  .btn-prev:hover {
    background: var(--bg-soft);
    color: var(--text-dark);
  }

  .btn-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(230, 57, 70, 0.3);
  }

  .landing-page::before {
    opacity: 0.10;
  }

  .landing-page::after {
    background: radial-gradient(
      ellipse at center,
      transparent 50%,
      rgba(255, 255, 255, 0.80) 100%
    );
  }
}

/* ============================================
   Accessibility
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

.btn-start:focus-visible,
.btn-next:focus-visible,
.btn-prev:focus-visible,
.btn-submit:focus-visible {
  outline: 2px solid var(--accent-red);
  outline-offset: 3px;
}

.checkbox-item:focus-within {
  outline: 2px solid var(--accent-red);
  outline-offset: 2px;
}

@media print {
  .progress-container, .page-nav { display: none !important; }
}
