/* MentionBrevet — Inner app pages (fiches, paiement, etc.) */
:root {
  --primary: #4f46e5;
  --primary-light: #6366f1;
  --primary-dark: #3730a3;
  --accent: #a855f7;
  --bg: #f8f7ff;
  --bg-white: #ffffff;
  --fg: #1e1b4b;
  --fg-muted: #6b7280;
  --fg-light: #9ca3af;
  --border: #e5e7eb;
  --border-light: #f3f4f6;
  --font: 'Plus Jakarta Sans', system-ui, sans-serif;
  --max-w: 1100px;
  --radius: 16px;
  --radius-sm: 10px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

/* NAV */
.app-nav {
  background: rgba(248,247,255,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.app-nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--primary);
  font-size: 17px;
  font-weight: 800;
}
.nav-user {
  font-size: 13px;
  color: var(--fg-muted);
  font-weight: 500;
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 100px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  box-shadow: 0 4px 16px rgba(79,70,229,0.25);
}
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--border);
}
.btn-outline:hover { border-color: var(--primary); }
.btn-sm { padding: 8px 16px; font-size: 13px; }

/* FICHES HUB */
.fiches-hub { padding: 48px 0 80px; }
.fiches-hub-header { margin-bottom: 40px; }
.fiches-hub-header h1 {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 800;
  letter-spacing: -1.5px;
  margin-bottom: 10px;
}
.fiches-hub-header p { font-size: 17px; color: var(--fg-muted); }

.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.hub-card {
  background: var(--bg-white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  text-decoration: none;
  color: var(--fg);
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  overflow: hidden;
}
.hub-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--card-color, var(--primary));
  border-radius: var(--radius) var(--radius) 0 0;
}
.hub-card:hover {
  border-color: var(--card-color, var(--primary));
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(0,0,0,0.08);
}
.hub-card-icon { font-size: 32px; }
.hub-card h3 { font-size: 18px; font-weight: 700; letter-spacing: -0.3px; }
.hub-card p { font-size: 14px; color: var(--fg-muted); flex: 1; }
.hub-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}
.hub-card-count {
  font-size: 13px;
  font-weight: 600;
  color: var(--card-color, var(--primary));
  background: color-mix(in srgb, var(--card-color, var(--primary)) 10%, transparent);
  padding: 4px 10px;
  border-radius: 100px;
}
.hub-card-arrow { font-size: 18px; color: var(--fg-muted); }

/* FICHES MATIERE LIST */
.fiches-matiere { padding: 48px 0 80px; }
.matiere-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 8px;
}
.matiere-header-icon {
  font-size: 36px;
  width: 60px; height: 60px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
}
.matiere-header h1 {
  font-size: clamp(24px, 4vw, 36px);
  font-weight: 800;
  letter-spacing: -1px;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--fg-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 24px;
  transition: color 0.2s;
}
.back-link:hover { color: var(--primary); }

.fiches-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 32px;
}

.fiche-row {
  background: var(--bg-white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px 24px;
  text-decoration: none;
  color: var(--fg);
  display: flex;
  align-items: center;
  gap: 16px;
  transition: border-color 0.2s, transform 0.15s;
}
.fiche-row:hover {
  border-color: var(--primary-light);
  transform: translateX(4px);
}
.fiche-row-num {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--bg);
  border: 1.5px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--fg-muted);
  flex-shrink: 0;
}
.fiche-row h3 { font-size: 16px; font-weight: 600; flex: 1; }
.fiche-row-arrow { color: var(--fg-light); font-size: 18px; }

/* FICHE DETAIL */
.fiche-page { padding: 40px 0 80px; }
.fiche-page-inner { max-width: 780px; }

.fiche-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.fiche-card {
  background: var(--bg-white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0,0,0,0.06);
}

.fiche-card-header {
  padding: 32px 36px 24px;
  border-bottom: 1px solid var(--border-light);
}

.fiche-matiere-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 100px;
  margin-bottom: 14px;
}

.fiche-card-header h1 {
  font-size: clamp(22px, 3.5vw, 32px);
  font-weight: 800;
  letter-spacing: -1px;
}

.fiche-card-body {
  padding: 36px;
}

/* Fiche content styles */
.fiche-content { font-size: 16px; line-height: 1.75; }

.fiche-intro {
  font-size: 17px;
  color: var(--fg-muted);
  font-style: italic;
  padding: 16px 20px;
  background: rgba(79,70,229,0.04);
  border-left: 3px solid var(--primary-light);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-bottom: 32px;
}

.fiche-section {
  margin-bottom: 32px;
}

.fiche-section h3 {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--primary);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-light);
}

.fiche-definition {
  background: rgba(99, 102, 241, 0.06);
  border: 1.5px solid rgba(99, 102, 241, 0.15);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  font-size: 15px;
  margin-bottom: 16px;
}

.fiche-formula {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.formula-item {
  background: rgba(79, 70, 229, 0.04);
  border-left: 3px solid var(--primary-light);
  padding: 12px 18px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 15px;
  font-family: 'Plus Jakarta Sans', monospace;
}

.fiche-list {
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fiche-list li {
  font-size: 15px;
  line-height: 1.6;
  color: var(--fg);
  padding: 4px 0;
}

.fiche-essentiel {
  background: linear-gradient(135deg, rgba(79,70,229,0.06), rgba(168,85,247,0.06));
  border: 1.5px solid rgba(79,70,229,0.15);
  border-radius: var(--radius-sm);
  padding: 20px 24px;
  margin-top: 8px;
}

.fiche-essentiel h4 {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--primary);
  margin-bottom: 12px;
}

.fiche-essentiel ul {
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.fiche-essentiel li {
  font-size: 15px;
  line-height: 1.55;
}

/* Fiche nav footer */
.fiche-footer-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 32px;
}

.fiche-nav-btn {
  background: var(--bg-white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  text-decoration: none;
  color: var(--fg);
  transition: border-color 0.2s, transform 0.15s;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.fiche-nav-btn:hover {
  border-color: var(--primary-light);
  transform: translateY(-2px);
}

.fiche-nav-btn.next { text-align: right; }

.fiche-nav-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--fg-light);
}

.fiche-nav-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--fg);
}

/* PAIEMENT */
.paiement-page {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
}

.paiement-card {
  background: var(--bg-white);
  border: 1.5px solid var(--border);
  border-radius: 24px;
  padding: 48px 40px;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 8px 40px rgba(0,0,0,0.08);
  text-align: center;
}

.paiement-icon { font-size: 48px; margin-bottom: 20px; }

.paiement-card h1 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 10px;
}

.paiement-card p {
  font-size: 16px;
  color: var(--fg-muted);
  margin-bottom: 32px;
}

.form-group { margin-bottom: 16px; text-align: left; }

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--fg);
}

.form-input {
  width: 100%;
  padding: 14px 18px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 16px;
  color: var(--fg);
  background: var(--bg);
  transition: border-color 0.2s;
  outline: none;
}

.form-input:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}

.form-btn {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  border: none;
  border-radius: 100px;
  font-family: var(--font);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
  box-shadow: 0 4px 16px rgba(79,70,229,0.3);
  margin-top: 8px;
}

.form-btn:hover { opacity: 0.9; transform: translateY(-1px); }

.form-error {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.2);
  color: #dc2626;
  font-size: 14px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
}

.paiement-features {
  list-style: none;
  margin: 28px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
}

.paiement-features li {
  font-size: 14px;
  color: var(--fg-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.paiement-secure {
  font-size: 12px;
  color: var(--fg-light);
  margin-top: 16px;
}

.paiement-acces-link {
  display: block;
  margin-top: 20px;
  font-size: 14px;
  color: var(--fg-muted);
}

.paiement-acces-link a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

/* SUCCESS */
.success-page {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
}

.success-card {
  background: var(--bg-white);
  border: 1.5px solid var(--border);
  border-radius: 24px;
  padding: 48px 40px;
  max-width: 480px;
  width: 100%;
  text-align: center;
  box-shadow: 0 8px 40px rgba(0,0,0,0.08);
}

.success-icon { font-size: 64px; margin-bottom: 20px; }
.success-card h1 { font-size: 28px; font-weight: 800; letter-spacing: -1px; margin-bottom: 12px; }
.success-card p { font-size: 16px; color: var(--fg-muted); margin-bottom: 32px; }

/* 404 */
.error-page {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 24px;
}

.error-icon { font-size: 64px; margin-bottom: 20px; }
.error-page h1 { font-size: 28px; font-weight: 800; margin-bottom: 12px; }
.error-page p { font-size: 16px; color: var(--fg-muted); margin-bottom: 28px; }

/* RESPONSIVE */
@media (max-width: 640px) {
  .fiche-card-body { padding: 24px; }
  .fiche-card-header { padding: 24px; }
  .paiement-card { padding: 36px 24px; }
  .success-card { padding: 36px 24px; }
  .fiche-footer-nav { grid-template-columns: 1fr; }
}
