/* Palette pastel type FlashMind – fond clair, accents doux */
*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --bg: #fafbfc;
  --bg-card: #ffffff;
  --text: #374151;
  --text-muted: #6b7280;
  --violet: #9e7bff;
  --violet-soft: #a67fff;
  --violet-pale: #e0d9ff;
  --yellow-pale: #fff0d9;
  --green-pale: #d9ffe0;
  --green-pale-2: #e0ffd9;
  --blue-pale: #d9e0ff;
  --rose-pale: #ffd9e0;
  --border: #e5e7eb;
  --white: #ffffff;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

a {
  color: var(--violet);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.container {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1rem;
}

.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
}

.logo a {
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--text);
  font-size: 1.1rem;
  display: flex;          /* ← Ajout */
  align-items: center;    /* ← Ajout */
  text-decoration: none;  /* ← Ajout (optionnel) */
}

.logo span {
  color: var(--violet);
}

.logo img {
  width: 40px;            /* ← Ajout : ajustez selon votre logo */
  height: 40px;           /* ← Ajout */
  object-fit: contain;    /* ← Ajout */
}


.main-nav a {
  margin-left: 1rem;
  font-size: 0.95rem;
  color: var(--text);
}

.main-nav a:hover {
  color: var(--violet);
}

.site-main {
  padding: 1.5rem 0 3rem;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Hero */
.hero {
  margin: 2rem 0 2.5rem;
  text-align: center;
}

.hero-content h1 {
  font-size: 2rem;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.hero-content p {
  color: var(--text-muted);
  max-width: 34rem;
  margin: 0 auto 1.5rem;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* Boutons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  border: 1px solid transparent;
  font-size: 0.95rem;
  cursor: pointer;
  background: transparent;
  color: var(--text);
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease,
    transform 0.05s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--violet-soft);
  color: var(--white);
  border-color: transparent;
}

.btn-primary:hover {
  background: var(--violet);
  color: var(--white);
}

.btn-secondary {
  background: var(--white);
  border-color: var(--border);
  color: var(--text);
}

.btn-secondary:hover {
  background: var(--violet-pale);
  border-color: var(--violet-pale);
}

.btn-ghost {
  border-color: transparent;
  background: transparent;
  color: var(--text-muted);
}

.btn-ghost:hover {
  background: var(--violet-pale);
  color: var(--text);
}

.btn-large {
  padding-inline: 1.5rem;
  padding-block: 0.7rem;
  font-size: 1rem;
}

/* Niveaux de qualité révision (0–5) */
.btn-q0 {
  background: var(--rose-pale);
  border-color: rgba(239, 68, 68, 0.4);
  color: #b91c1c;
}
.btn-q1 {
  background: #ffe0d9;
  border-color: rgba(234, 88, 12, 0.4);
  color: #c2410c;
}
.btn-q2 {
  background: var(--yellow-pale);
  border-color: rgba(217, 119, 6, 0.4);
  color: #b45309;
}
.btn-q3 {
  background: var(--blue-pale);
  border-color: rgba(59, 130, 246, 0.4);
  color: #1d4ed8;
}
.btn-q4 {
  background: var(--green-pale);
  border-color: rgba(34, 197, 94, 0.4);
  color: #15803d;
}
.btn-q5 {
  background: var(--green-pale-2);
  border-color: rgba(22, 163, 74, 0.4);
  color: #166534;
}

/* Sections */
h1 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--text);
}

h2 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
  color: var(--text);
}

h3,
h4 {
  margin-bottom: 0.25rem;
  color: var(--text);
}

.subtitle {
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.feature {
  padding: 1rem;
  border-radius: 1rem;
  background: var(--violet-pale);
  border: 1px solid rgba(158, 123, 255, 0.2);
  font-size: 0.95rem;
  color: var(--text);
}

/* Cartes UI */
.card {
  background: var(--bg-card);
  border-radius: 1rem;
  border: 1px solid var(--border);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.form-card label {
  display: block;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
  color: var(--text);
}

input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
  width: 100%;
  padding: 0.45rem 0.65rem;
  margin-top: 0.25rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--text);
  font-size: 0.95rem;
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--violet);
  box-shadow: 0 0 0 2px var(--violet-pale);
}

.form-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

/* Alertes */
.alert {
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.alert-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
}

.alert-success {
  background: var(--green-pale);
  border: 1px solid #bbf7d0;
  color: #15803d;
}

/* Dashboard */
.dashboard-actions {
  margin: 1rem 0;
}

.deck-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.deck-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
}

.deck-card h2 {
  margin-bottom: 0.25rem;
}

.deck-category {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.deck-description {
  font-size: 0.9rem;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.deck-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.deck-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Catégories / decks */
.category-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.category-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
}

.category-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.inline-form {
  display: inline-block;
}

.deck-list {
  margin-top: 0.5rem;
}

.deck-item {
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  padding: 0.6rem 0.75rem;
  margin-bottom: 0.5rem;
  background: var(--bg);
}

.deck-main {
  margin-bottom: 0.4rem;
}

.deck-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.deck-edit summary,
.category-edit summary {
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
}

.deck-add {
  margin-top: 0.75rem;
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
}

/* Liste de cartes */
.card-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.flashcard-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

.flashcard-text {
  font-size: 0.9rem;
  color: var(--text);
}

.flashcard-text > div {
  margin-bottom: 0.3rem;
}

.flashcard-type {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.flashcard-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
}

.badge-one-way {
  background: var(--blue-pale);
  color: #1d4ed8;
}

.badge-two-way {
  background: var(--violet-pale);
  color: #5b21b6;
}

/* Révision */
.review-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.review-modes {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
  align-items: center;
}

.review-card {
  text-align: left;
  background: var(--bg-card);
  border: 1px solid var(--border);
}

.review-question,
.review-answer {
  margin-bottom: 1rem;
}

.review-question p,
.review-answer p {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
}

.review-show-answer {
  text-align: center;
}

.review-rating {
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
}

.review-rating p {
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.rating-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.review-restart {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
}

/* Nav active (optionnel) */
.main-nav a.btn-primary {
  background: var(--violet);
  color: var(--white);
  border-radius: 0.5rem;
  padding: 0.4rem 0.75rem;
}

/* Responsive */
@media (max-width: 640px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .main-nav a {
    margin-left: 0;
    margin-right: 0.75rem;
  }

  .card {
    padding: 0.9rem 1rem;
  }

  .deck-grid {
    grid-template-columns: 1fr;
  }

  .review-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .rating-buttons {
    flex-direction: column;
  }

  .rating-buttons .btn {
    width: 100%;
  }
}
