/* ================================================================= */
/*  Notre question du jour ❤️                                        */
/*  Feuille de style unique. Palette chaleureuse et romantique,      */
/*  cartes arrondies, animations douces, responsive mobile/desktop.  */
/* ================================================================= */

/* --- Variables : tout se règle ici, un seul endroit à changer ---- */
:root {
  --bg:            #fdf6f3;   /* fond crème rosé, chaleureux         */
  --bg-soft:       #fbeee9;
  --card:          #ffffff;   /* fond des cartes                     */
  --text:          #3a2e2b;   /* brun profond, doux à lire           */
  --text-soft:     #8a7a75;   /* texte secondaire                    */
  --accent:        #e05e6b;   /* rose corail, la couleur romantique  */
  --accent-dark:   #c74857;
  --accent-soft:   #fbe3e4;   /* fond léger teinté d'accent          */
  --gold:          #e8a13a;   /* pour le compteur 🔥                 */
  --border:        #f0e2dd;
  --shadow:        0 10px 30px rgba(224, 94, 107, 0.10);
  --shadow-soft:   0 4px 16px rgba(58, 46, 43, 0.06);
  --radius:        20px;
  --radius-sm:     14px;
  --space:         1rem;
  --font:          "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", sans-serif;
}

/* --- Réglages de base -------------------------------------------- */
* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  line-height: 1.6;
  color: var(--text);
  /* Léger dégradé chaud en fond */
  background:
    radial-gradient(1200px 600px at 80% -10%, #fce4de 0%, transparent 60%),
    radial-gradient(900px 500px at -10% 110%, #f7e6f0 0%, transparent 55%),
    var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ================================================================= */
/*  BOUTONS                                                          */
/* ================================================================= */
.btn {
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 999px;      /* pleinement arrondi = "pilule"       */
  padding: 0.9rem 1.6rem;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 20px rgba(224, 94, 107, 0.35);
}
.btn-primary:hover { background: var(--accent-dark); transform: translateY(-2px); }

.btn-secondary {
  background: #fff;
  color: var(--accent);
  border: 2px solid var(--accent-soft);
}
.btn-secondary:hover { border-color: var(--accent); transform: translateY(-2px); }

.btn-ghost {
  font-family: inherit;
  background: transparent;
  border: none;
  color: var(--text-soft);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0.4rem 0.6rem;
  border-radius: 999px;
  transition: color 0.2s ease, background 0.2s ease;
}
.btn-ghost:hover { color: var(--accent); background: var(--accent-soft); }

/* Utilitaire pour masquer un élément */
.hidden { display: none !important; }

/* ================================================================= */
/*  ÉCRAN DE CONNEXION                                               */
/* ================================================================= */
.login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.login-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 3rem 2.2rem;
  max-width: 440px;
  width: 100%;
  text-align: center;
  animation: rise 0.6s ease both;
}
.login-title {
  font-size: 1.9rem;
  margin: 0 0 0.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.login-subtitle {
  color: var(--text-soft);
  font-style: italic;
  margin: 0 0 2rem;
}
.login-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}
.heart {
  display: inline-block;
  animation: heartbeat 1.6s ease-in-out infinite;
}

/* ================================================================= */
/*  NAVIGATION                                                       */
/* ================================================================= */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(253, 246, 243, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 0.7rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.nav-links { display: flex; gap: 0.4rem; }
.nav-link {
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  background: transparent;
  color: var(--text-soft);
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
}
.nav-link:hover { color: var(--accent); }
.nav-link.active { color: var(--accent); background: var(--accent-soft); }

.nav-right { display: flex; align-items: center; gap: 0.6rem; }

.streak-badge {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--gold);
  background: #fdf1dd;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  white-space: nowrap;
}

/* ================================================================= */
/*  MISE EN PAGE PRINCIPALE                                          */
/* ================================================================= */
.main {
  max-width: 720px;
  margin: 0 auto;
  padding: 1.6rem 1rem 4rem;
}
.page { animation: fade 0.4s ease both; }

.day-header { text-align: center; margin-bottom: 1.6rem; }
.day-date {
  color: var(--text-soft);
  text-transform: capitalize;
  margin: 0;
  font-size: 0.95rem;
}
.day-greeting {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0.2rem 0 0;
}

.page-title {
  text-align: center;
  font-size: 1.6rem;
  margin: 0 0 1.6rem;
}

/* ================================================================= */
/*  CARTES (bloc central réutilisé sur la page du jour)             */
/* ================================================================= */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 1.8rem;
  animation: rise 0.5s ease both;
}
.card + .card { margin-top: 1.2rem; }

/* Petit bandeau "Qui → Qui" */
.exchange-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  font-size: 0.9rem;
}

.card-lead {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0.2rem 0 1rem;
}
.card-hint {
  color: var(--text-soft);
  margin: 0 0 1.2rem;
}

.field-label {
  display: block;
  font-weight: 600;
  margin: 1.2rem 0 0.5rem;
  font-size: 0.95rem;
}

/* Zone de texte */
textarea {
  width: 100%;
  min-height: 130px;
  resize: vertical;
  font-family: inherit;
  font-size: 1.05rem;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg-soft);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  transition: border-color 0.2s ease, background 0.2s ease;
}
textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
}
textarea::placeholder { color: #c3b3ad; }

.card-actions { margin-top: 1.2rem; text-align: right; }

/* Texte figé (question/réponse déjà enregistrée) */
.quote {
  font-size: 1.25rem;
  line-height: 1.5;
  margin: 0.4rem 0 0;
  font-weight: 500;
}
.answer-block {
  margin-top: 1.4rem;
  padding-top: 1.4rem;
  border-top: 1px dashed var(--border);
}
.block-label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-soft);
  font-weight: 700;
  margin: 0 0 0.3rem;
}

/* Bandeau d'information (question envoyée, en attente…) */
.notice {
  text-align: center;
  padding: 1.2rem;
  background: var(--accent-soft);
  border-radius: var(--radius-sm);
  color: var(--accent-dark);
  font-weight: 600;
  margin-top: 1.2rem;
}

/* Message discret si les notifications sont bloquées */
.push-hint {
  background: #fff5e6;
  color: #a9701a;
  border: 1px solid #f3dfbb;
  border-radius: var(--radius-sm);
  padding: 0.7rem 1rem;
  font-size: 0.9rem;
  text-align: center;
  margin-bottom: 1.2rem;
}

/* État "tout est terminé pour aujourd'hui" */
.done-badge {
  display: inline-block;
  background: #e6f6ea;
  color: #2f9e57;
  font-weight: 700;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  font-size: 0.9rem;
  margin-bottom: 0.6rem;
}

/* ================================================================= */
/*  HISTORIQUE                                                       */
/* ================================================================= */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.history-card {
  background: var(--card);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-soft);
  padding: 1.2rem 1.3rem;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.15s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  animation: rise 0.4s ease both;
}
.history-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-soft);
  box-shadow: var(--shadow);
}
.history-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}
.history-date {
  font-weight: 700;
  text-transform: capitalize;
  font-size: 0.95rem;
}
.history-question {
  margin: 0;
  color: var(--text);
  font-size: 1.05rem;
}
.history-status {
  font-size: 0.8rem;
  color: var(--text-soft);
  font-weight: 600;
}

.empty-state {
  text-align: center;
  color: var(--text-soft);
  padding: 3rem 1rem;
}
.empty-state .big { font-size: 2.5rem; margin-bottom: 0.5rem; }

/* ================================================================= */
/*  MODALE (échange complet depuis l'historique)                    */
/* ================================================================= */
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.2rem;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(58, 46, 43, 0.45);
  backdrop-filter: blur(3px);
  animation: fade 0.25s ease both;
}
.modal-card {
  position: relative;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem;
  max-width: 480px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  animation: rise 0.3s ease both;
}
.modal-close {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  border: none;
  background: var(--bg-soft);
  color: var(--text-soft);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.2s ease, color 0.2s ease;
}
.modal-close:hover { background: var(--accent-soft); color: var(--accent); }

/* ================================================================= */
/*  ANIMATIONS                                                       */
/* ================================================================= */
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  15%      { transform: scale(1.25); }
  30%      { transform: scale(1); }
  45%      { transform: scale(1.15); }
}

/* Cœurs qui montent quand une réponse est envoyée */
.hearts-burst {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 60;
  overflow: hidden;
}
.hearts-burst span {
  position: absolute;
  bottom: -40px;
  font-size: 1.8rem;
  animation: floatUp 2.2s ease-in forwards;
}
@keyframes floatUp {
  0%   { transform: translateY(0) scale(0.6); opacity: 0; }
  15%  { opacity: 1; }
  100% { transform: translateY(-105vh) scale(1.1); opacity: 0; }
}

/* Petit rebond de confirmation */
.pop { animation: pop 0.5s ease both; }
@keyframes pop {
  0%   { transform: scale(0.85); opacity: 0; }
  60%  { transform: scale(1.05); }
  100% { transform: scale(1); opacity: 1; }
}

/* ================================================================= */
/*  RESPONSIVE — téléphone                                           */
/* ================================================================= */
@media (max-width: 640px) {
  .login-card { padding: 2.2rem 1.4rem; }
  .login-title { font-size: 1.55rem; }
  .card { padding: 1.4rem; }
  .nav-inner { padding: 0.6rem 0.8rem; }
  .nav-link { padding: 0.45rem 0.7rem; font-size: 0.9rem; }
  .quote { font-size: 1.1rem; }
  .main { padding: 1.2rem 0.8rem 3rem; }
}

/* Respecte le réglage "réduire les animations" du système */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
