/* ============================================================
   My life is here — Design system
   Palette chaleureuse, personnelle, sereine
   ============================================================ */

:root {
  --color-bg: #faf6f1;
  --color-bg-elev: #ffffff;
  --color-text: #1f1b16;
  --color-muted: #7a6f63;
  --color-border: #e8e0d4;
  --color-primary: #d97757;        /* terracotta chaleureux */
  --color-primary-soft: #f6e3d8;
  --color-secondary: #3b6e5a;      /* vert forêt */
  --color-secondary-soft: #d8e8df;
  --color-danger: #c0392b;
  --color-accent: #f4c95d;         /* miel */

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(31, 27, 22, 0.05);
  --shadow-md: 0 6px 20px rgba(31, 27, 22, 0.08);
  --shadow-lg: 0 16px 40px rgba(31, 27, 22, 0.12);

  --font-display: "Fraunces", "Playfair Display", Georgia, serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --maxw: 1100px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.01em; margin: 0 0 0.5em; }
h1 { font-size: clamp(2rem, 4vw, 3.2rem); line-height: 1.1; }
h2 { font-size: clamp(1.5rem, 2.5vw, 2rem); }
h3 { font-size: 1.2rem; }

p { margin: 0 0 1em; color: var(--color-text); }
.muted { color: var(--color-muted); }
.center { text-align: center; }

/* ----- Layout ----- */
.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  background: var(--color-bg-elev);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar .brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.3rem;
  color: var(--color-text);
}
.topbar .brand em {
  color: var(--color-primary);
  font-style: italic;
}
.topbar nav {
  display: flex;
  gap: 18px;
  align-items: center;
}
.topbar nav a {
  color: var(--color-muted);
  font-weight: 500;
  font-size: 0.95rem;
}
.topbar nav a:hover, .topbar nav a.active {
  color: var(--color-text);
  text-decoration: none;
}

/* ----- Buttons ----- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.08s, box-shadow 0.15s, background 0.15s;
  text-decoration: none;
  font-family: inherit;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--color-primary); color: #fff; }
.btn-primary:hover { background: #c46446; }
.btn-secondary { background: var(--color-secondary); color: #fff; }
.btn-ghost { background: transparent; color: var(--color-text); border-color: var(--color-border); }
.btn-ghost:hover { background: var(--color-bg-elev); }
.btn-danger { background: transparent; color: var(--color-danger); border-color: var(--color-danger); }
.btn-danger:hover { background: var(--color-danger); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 0.85rem; }

/* ----- Hero / Landing ----- */
.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
  padding: 80px 0 60px;
}
.hero h1 em { color: var(--color-primary); font-style: italic; }
.hero .lead { font-size: 1.15rem; color: var(--color-muted); max-width: 480px; }
.hero .cta { display: flex; gap: 12px; margin-top: 24px; flex-wrap: wrap; }
.hero-art {
  aspect-ratio: 1;
  background:
    radial-gradient(circle at 30% 30%, var(--color-primary-soft) 0%, transparent 50%),
    radial-gradient(circle at 70% 70%, var(--color-secondary-soft) 0%, transparent 50%),
    var(--color-bg-elev);
  border-radius: 50%;
  position: relative;
  box-shadow: var(--shadow-lg);
}
.hero-art::before, .hero-art::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  border: 1px dashed var(--color-border);
}
.hero-art::before { inset: 14%; }
.hero-art::after { inset: 28%; }

@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; padding: 40px 0; }
  .hero-art { display: none; }
}

/* ----- Auth card ----- */
.auth-wrap {
  max-width: 420px;
  margin: 60px auto;
  padding: 32px;
  background: var(--color-bg-elev);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}
.auth-wrap h2 { margin-top: 0; }
.auth-tabs { display: flex; gap: 8px; margin-bottom: 20px; }
.auth-tabs button {
  flex: 1;
  padding: 10px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  font-weight: 600;
  color: var(--color-muted);
  cursor: pointer;
  font-family: inherit;
}
.auth-tabs button.active {
  background: var(--color-primary-soft);
  color: var(--color-primary);
}

/* ----- Forms ----- */
.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--color-muted);
}
input[type="text"], input[type="email"], input[type="password"], input[type="url"],
textarea, select {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg-elev);
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--color-text);
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-soft);
}
textarea { min-height: 90px; resize: vertical; }

.error-msg { color: var(--color-danger); font-size: 0.85rem; min-height: 1.2em; margin: 6px 0; }
.success-msg { color: var(--color-secondary); font-size: 0.85rem; min-height: 1.2em; margin: 6px 0; }

/* ----- Dashboard cards ----- */
.greeting {
  padding: 40px 0 24px;
}
.greeting h1 { margin-bottom: 4px; }
.greeting .muted { font-size: 1.05rem; }

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 22px;
  margin-top: 16px;
}
.life-card {
  background: var(--color-bg-elev);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  transition: transform 0.15s, box-shadow 0.15s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 180px;
  text-decoration: none;
  color: inherit;
}
.life-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  text-decoration: none;
}
.life-card .icon {
  font-size: 2rem;
  display: inline-flex;
  width: 52px;
  height: 52px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--color-primary-soft);
}
.life-card.profil .icon { background: var(--color-secondary-soft); }
.life-card.decouvrir .icon { background: #fcefc9; }
.life-card h3 { margin: 0; }
.life-card .count {
  font-size: 0.85rem;
  color: var(--color-muted);
  margin-top: auto;
}

/* ----- List + items ----- */
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 20px 0 16px;
}
.items-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.item {
  background: var(--color-bg-elev);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: var(--shadow-sm);
}
.item h4 { margin: 0; font-family: var(--font-display); font-size: 1.05rem; }
.item .meta { font-size: 0.85rem; color: var(--color-muted); }
.item .desc { font-size: 0.92rem; }
.item .actions { display: flex; gap: 6px; margin-top: 8px; }

.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--color-muted);
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-lg);
}

/* ----- Modal ----- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(31, 27, 22, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}
.modal {
  background: var(--color-bg-elev);
  border-radius: var(--radius-lg);
  padding: 28px;
  max-width: 520px;
  width: 100%;
  box-shadow: var(--shadow-lg);
}
.modal h3 { margin-top: 0; }
.modal .actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }

.hidden { display: none !important; }

/* ----- Avatar ----- */
.avatar {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: var(--color-primary-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-family: var(--font-display);
  color: var(--color-primary);
  overflow: hidden;
  flex-shrink: 0;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-sm { width: 44px; height: 44px; font-size: 1rem; }

.profile-head {
  display: flex;
  gap: 24px;
  align-items: center;
  padding: 28px 0;
}

/* ----- Footer ----- */
footer {
  margin-top: 60px;
  padding: 30px 0;
  text-align: center;
  font-size: 0.85rem;
  color: var(--color-muted);
  border-top: 1px solid var(--color-border);
}
