/* ========================================
   MAIN - Styles principaux de la page
======================================== */

* { 
  box-sizing: border-box; 
  margin: 0; 
  padding: 0; 
}

html, body { 
  height: 100%; 
}

body {
  font-family: "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(1200px 700px at 10% 0%, hsla(150,60%,40%,0.10), transparent 60%),
    radial-gradient(1000px 600px at 95% 10%, hsla(160,60%,35%,0.10), transparent 60%),
    var(--overlay);
  pointer-events: none;
  z-index: 0;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 18px 40px;
  position: relative;
  z-index: 1;
}

.icon { 
  display: inline-block; 
  vertical-align: middle; 
  line-height: 0; 
}

.icon path, 
.icon circle, 
.icon line, 
.icon polyline { 
  stroke: currentColor; 
  stroke-width: 2; 
  fill: none; 
  stroke-linecap: round; 
  stroke-linejoin: round; 
}

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

@media (min-width: 620px) {
  .grid { 
    grid-template-columns: repeat(2, 1fr); 
  }
}

@media (min-width: 980px) {
  .grid { 
    grid-template-columns: repeat(3, 1fr); 
  }
}

.card {
  position: relative;
  background: linear-gradient(180deg, var(--card), var(--bg-muted));
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px 16px 16px;
  box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease, border-color .25s ease;
  overflow: hidden;
  isolation: isolate;
}

.card:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 18px 50px rgba(0,0,0,0.18);
  border-color: color-mix(in srgb, var(--primary) 40%, var(--border));
}

.card::after {
  content: "";
  position: absolute;
  inset: -20%;
  background: radial-gradient(400px 200px at 120% -10%, color-mix(in srgb, var(--primary) 22%, transparent), transparent 60%);
  opacity: .25;
  pointer-events: none;
  z-index: -1;
  transition: opacity .3s ease;
}

.card:hover::after { 
  opacity: .4; 
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.card .left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(120% 120% at 20% 20%, color-mix(in srgb, var(--primary) 30%, transparent), transparent 70%);
  color: var(--primary);
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--primary) 30%, transparent);
  animation: float 6s ease-in-out infinite;
}

.card-title {
  font-weight: 700;
  font-size: 16px;
  color: var(--text);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .3px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--bg-muted);
  color: var(--text-muted);
}

.status.ok { 
  background: color-mix(in srgb, var(--status-ok) 18%, transparent); 
  color: hsl(0 0% 100%); 
  border-color: color-mix(in srgb, var(--status-ok) 35%, transparent); 
}

.status.warn { 
  background: color-mix(in srgb, var(--status-warn) 22%, transparent); 
  color: hsl(220 20% 10%); 
  border-color: color-mix(in srgb, var(--status-warn) 40%, transparent); 
}

.status.soon { 
  background: color-mix(in srgb, var(--status-soon) 16%, transparent); 
  color: var(--text); 
  border-color: color-mix(in srgb, var(--status-soon) 35%, transparent); 
}

.card-desc { 
  color: var(--text-muted); 
  font-size: 14px; 
  line-height: 1.45; 
  min-height: 3em; 
}

.card-actions {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 14px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--primary) 35%, var(--border));
  color: var(--text);
  background: linear-gradient(180deg, color-mix(in srgb, var(--primary) 14%, var(--card)), var(--card));
  box-shadow: 0 2px 0 color-mix(in srgb, var(--primary) 18%, var(--border));
  text-decoration: none;
  transition: transform .12s ease, box-shadow .12s ease, background .3s ease, border-color .3s ease;
}

.btn:hover { 
  transform: translateY(-1px); 
  box-shadow: 0 6px 16px rgba(0,0,0,.12); 
}

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

.muted { 
  opacity: .7; 
  cursor: default; 
}

.muted .btn { 
  pointer-events: none; 
  opacity: .6; 
}

@keyframes fade-in-up {
  from { 
    opacity: 0; 
    transform: translateY(14px); 
  }
  to { 
    opacity: 1; 
    transform: translateY(0); 
  }
}

@keyframes float {
  0%, 100% { 
    transform: translateY(0); 
  }
  50% { 
    transform: translateY(-4px); 
  }
}

@keyframes pulse-glow {
  0%, 100% { 
    box-shadow: 0 0 0 0 rgba(0,0,0,0), 0 0 0 0 var(--ring); 
  }
  50% { 
    box-shadow: 0 0 0 6px var(--ring), 0 0 25px 2px color-mix(in srgb, var(--primary) 45%, transparent); 
  }
}

.animate-fade-in-up { 
  animation: fade-in-up .55s ease both; 
}

.animate-float { 
  animation: float 6s ease-in-out infinite; 
}

.animate-pulse-glow { 
  animation: pulse-glow 2.8s ease-in-out infinite; 
}

.grid .card:nth-child(1) { animation-delay: .05s; }
.grid .card:nth-child(2) { animation-delay: .12s; }
.grid .card:nth-child(3) { animation-delay: .19s; }
.grid .card:nth-child(4) { animation-delay: .26s; }
.grid .card:nth-child(5) { animation-delay: .33s; }

@media (prefers-reduced-motion: reduce) {
  .animate-float, 
  .animate-pulse-glow { 
    animation: none !important; 
  }
  .card, 
  .btn, 
  .theme-toggle { 
    transition: none !important; 
  }
}
