/* ===========================
   RESET & BASE
=========================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg-primary: #FAFAF8;
  --bg-secondary: #F5F0EB;
  --accent: #E8772A;
  --accent-hover: #D06820;
  --text-primary: #1A1A1A;
  --text-secondary: #6B7280;
  --border: #E5E7EB;
  --success: #22C55E;
  --danger: #EF4444;
  --shadow: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.10);
  --radius-card: 12px;
  --radius-btn: 8px;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.5;
  min-height: 100vh;
}

/* ===========================
   LAYOUT
=========================== */
.app-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.header {
  background: #FFFFFF;
  border-bottom: 1px solid var(--border);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.logo-circle {
  width: 36px;
  height: 36px;
  background: #1A1A1A;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.logo-circle span {
  font-family: Georgia, 'Times New Roman', serif;
  font-weight: 700;
  font-size: 18px;
  color: #FFFFFF;
  line-height: 1;
}

.logo-text {
  font-family: Georgia, 'Times New Roman', serif;
  font-weight: 700;
  font-size: 16px;
  color: var(--text-primary);
}

/* ===========================
   PROGRESS BAR
=========================== */
.progress-container {
  padding: 0 24px;
  background: #FFFFFF;
  border-bottom: 1px solid var(--border);
}

.progress-bar-wrapper {
  max-width: 640px;
  margin: 0 auto;
  padding: 12px 0;
  display: flex;
  align-items: center;
  gap: 16px;
}

.progress-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  min-width: 40px;
}

.progress-track {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
  transition: width 0.4s ease;
}

/* ===========================
   MAIN CONTENT
=========================== */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}

/* ===========================
   SCREENS
=========================== */
.screen {
  display: none;
  width: 100%;
  max-width: 640px;
  animation: fadeSlideIn 0.3s ease;
}

.screen.active {
  display: block;
}

@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===========================
   WELCOME SCREEN
=========================== */
.welcome-card {
  background: #FFFFFF;
  border-radius: var(--radius-card);
  padding: 40px 32px;
  box-shadow: var(--shadow-md);
  text-align: center;
}

.welcome-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 16px;
  background: #FEF3E8;
  padding: 4px 12px;
  border-radius: 99px;
}

.welcome-title {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(22px, 4vw, 30px);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
  margin-bottom: 16px;
}

.welcome-subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 8px;
}

.welcome-author {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 32px;
  font-style: italic;
}

.mode-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.mode-btn {
  background: var(--bg-secondary);
  border: 2px solid transparent;
  border-radius: var(--radius-card);
  padding: 24px 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.mode-btn:hover {
  border-color: var(--accent);
  background: #FFFFFF;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.mode-emoji {
  font-size: 28px;
  display: block;
  margin-bottom: 12px;
}

.mode-title {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  display: block;
  margin-bottom: 6px;
}

.mode-desc {
  font-size: 13px;
  color: var(--text-secondary);
  display: block;
}

/* ===========================
   QUESTION SCREEN
=========================== */
.question-card {
  background: #FFFFFF;
  border-radius: var(--radius-card);
  padding: 36px 32px;
  box-shadow: var(--shadow-md);
}

.question-number {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
}

.question-text {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(18px, 3vw, 24px);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.35;
  margin-bottom: 28px;
}

/* Options boutons (choix unique) */
.options-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 28px;
}

.option-btn {
  background: var(--bg-primary);
  border: 2px solid var(--border);
  border-radius: var(--radius-btn);
  padding: 14px 18px;
  font-size: 15px;
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
  font-family: inherit;
}

.option-btn:hover {
  border-color: var(--accent);
  background: #FEF3E8;
}

.option-btn.selected {
  border-color: var(--accent);
  background: #FEF3E8;
  color: var(--accent);
  font-weight: 600;
}

/* Cases à cocher (choix multiple) */
.checkbox-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 28px;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-primary);
  border: 2px solid var(--border);
  border-radius: var(--radius-btn);
  padding: 13px 16px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.checkbox-item:hover {
  border-color: var(--accent);
  background: #FEF3E8;
}

.checkbox-item.checked {
  border-color: var(--accent);
  background: #FEF3E8;
}

.checkbox-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  flex-shrink: 0;
}

.checkbox-item label {
  font-size: 15px;
  color: var(--text-primary);
  cursor: pointer;
  flex: 1;
}

/* Sous-options outils */
.sub-options {
  display: none;
  flex-direction: column;
  gap: 8px;
  padding: 8px 0 4px 30px;
}

.sub-options.visible {
  display: flex;
}

.sub-option-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
}

.sub-option-item input[type="checkbox"] {
  accent-color: var(--accent);
}

/* Textarea */
.question-textarea {
  width: 100%;
  border: 2px solid var(--border);
  border-radius: var(--radius-btn);
  padding: 14px 16px;
  font-size: 15px;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--bg-primary);
  resize: vertical;
  min-height: 100px;
  transition: border-color 0.15s;
  margin-bottom: 28px;
  outline: none;
}

.question-textarea:focus {
  border-color: var(--accent);
  background: #FFFFFF;
}

/* Input numérique */
.question-input {
  width: 100%;
  border: 2px solid var(--border);
  border-radius: var(--radius-btn);
  padding: 14px 16px;
  font-size: 20px;
  font-family: Georgia, serif;
  font-weight: 700;
  color: var(--text-primary);
  background: var(--bg-primary);
  transition: border-color 0.15s;
  margin-bottom: 28px;
  outline: none;
}

.question-input:focus {
  border-color: var(--accent);
  background: #FFFFFF;
}

.input-suffix {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: -20px;
  margin-bottom: 28px;
}

/* Navigation */
.nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.btn-back {
  background: none;
  border: 2px solid var(--border);
  border-radius: var(--radius-btn);
  padding: 12px 20px;
  font-size: 15px;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}

.btn-back:hover {
  border-color: var(--text-secondary);
  color: var(--text-primary);
}

.btn-next {
  background: var(--accent);
  border: none;
  border-radius: var(--radius-btn);
  padding: 14px 28px;
  font-size: 16px;
  font-weight: 700;
  color: #FFFFFF;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, transform 0.1s;
  flex: 1;
}

.btn-next:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.btn-next:active {
  transform: translateY(0);
}

.btn-next:disabled {
  background: var(--border);
  color: var(--text-secondary);
  cursor: not-allowed;
  transform: none;
}

/* ===========================
   MESSAGE CONTEXTUEL
=========================== */
.contextual-message {
  background: var(--bg-secondary);
  border-radius: var(--radius-card);
  padding: 28px 32px;
  text-align: center;
  box-shadow: var(--shadow-md);
}

.contextual-message p {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.4;
}

/* ===========================
   CAPTURE (LEAD FORM)
=========================== */
.capture-card {
  background: #FFFFFF;
  border-radius: var(--radius-card);
  padding: 36px 32px;
  box-shadow: var(--shadow-md);
}

.capture-title {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.capture-subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 28px;
}

.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.form-input,
.form-select {
  width: 100%;
  border: 2px solid var(--border);
  border-radius: var(--radius-btn);
  padding: 12px 14px;
  font-size: 15px;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--bg-primary);
  transition: border-color 0.15s;
  outline: none;
  -webkit-appearance: none;
}

.form-input:focus,
.form-select:focus {
  border-color: var(--accent);
  background: #FFFFFF;
}

.form-select {
  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='%236B7280' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.btn-submit {
  width: 100%;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-btn);
  padding: 16px;
  font-size: 17px;
  font-weight: 700;
  color: #FFFFFF;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, transform 0.1s;
  margin-top: 8px;
}

.btn-submit:hover {
  background: var(--accent-hover);
}

.btn-submit:disabled {
  background: var(--border);
  color: var(--text-secondary);
  cursor: not-allowed;
}

.legal-mention {
  font-size: 12px;
  color: var(--text-secondary);
  text-align: center;
  margin-top: 12px;
  line-height: 1.5;
}

/* ===========================
   CONFIRMATION
=========================== */
.confirmation-card {
  background: #FFFFFF;
  border-radius: var(--radius-card);
  padding: 48px 32px;
  box-shadow: var(--shadow-md);
  text-align: center;
}

.confirmation-icon {
  width: 64px;
  height: 64px;
  background: #F0FDF4;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
}

.confirmation-icon svg {
  color: var(--success);
}

.confirmation-title {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.confirmation-subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 24px;
}

.confirmation-author {
  font-size: 14px;
  color: var(--text-secondary);
  font-style: italic;
}

/* ===========================
   LOADING
=========================== */
.loading-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(250,250,248,0.85);
  backdrop-filter: blur(4px);
  z-index: 200;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.loading-overlay.visible {
  display: flex;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  font-size: 15px;
  color: var(--text-secondary);
}

/* ===========================
   ERROR
=========================== */
.error-banner {
  display: none;
  background: #FEF2F2;
  border: 1px solid #FECACA;
  border-radius: var(--radius-btn);
  padding: 12px 16px;
  font-size: 14px;
  color: #991B1B;
  margin-bottom: 16px;
}

.error-banner.visible {
  display: block;
}

/* ===========================
   RESPONSIVE
=========================== */
@media (max-width: 480px) {
  .welcome-card,
  .question-card,
  .capture-card,
  .confirmation-card,
  .contextual-message {
    padding: 28px 20px;
  }

  .mode-grid {
    grid-template-columns: 1fr;
  }

  .header {
    padding: 12px 16px;
  }
}
