/* =============================================================================
   Control Portal — Feuille de style
   Charte reprise de u11-traiteur :
     • Fond sombre zinc-950   • Surface zinc-900   • Bordures zinc-800
     • Accent « or marocain » #C9A84C (primary-500)
     • Typo Playfair Display (titres) + Inter (corps)
   ========================================================================== */

:root {
  /* Palette */
  --bg:            #09090b; /* zinc-950 */
  --bg-elev:       #0a0700; /* hero gradient mid */
  --surface:       #18181b; /* zinc-900 */
  --surface-2:     #1f1f23;
  --border:        #27272a; /* zinc-800 */
  --text:          #f4f4f5; /* zinc-100 */
  --muted:         #a1a1aa; /* zinc-400 */
  --faint:         #71717a; /* zinc-500 */

  /* Accent or marocain (primary) */
  --accent:        #c9a84c; /* primary-500 */
  --accent-light:  #dfb62e; /* primary-400 */
  --accent-dark:   #a8862a; /* primary-600 */
  --accent-glow:   rgba(201, 168, 76, 0.35);

  /* Statuts */
  --ok:            #34d399; /* emerald-400 */
  --warn:          #fbbf24;

  /* Typo */
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-sans:  'Inter', system-ui, -apple-system, sans-serif;

  /* Layout */
  --radius:     16px;
  --gap:        1.5rem;
  --maxw:       1280px;
}

/* ── Reset léger ── */
*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

h1, h2, h3, h4 { font-family: var(--font-serif); margin: 0; }

a { color: inherit; text-decoration: none; }

/* =============================================================================
   Hero / En-tête
   ========================================================================== */
.hero {
  background: linear-gradient(160deg, #000000 0%, #0a0700 50%, #161100 100%);
  border-bottom: 1px solid var(--border);
  padding: 4rem 1.5rem 3rem;
  position: relative;
  overflow: hidden;
}

/* Halo doré discret en arrière-plan */
.hero::after {
  content: "";
  position: absolute;
  top: -40%;
  right: -10%;
  width: 480px;
  height: 480px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  pointer-events: none;
}

.hero__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.hero__eyebrow {
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.75rem;
  font-weight: 600;
}

.hero__title {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 700;
  line-height: 1.05;
  background: linear-gradient(90deg, #fff 0%, var(--accent-light) 60%, var(--accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__subtitle {
  color: var(--muted);
  font-size: 1.1rem;
  max-width: 42rem;
  margin: 1rem 0 2rem;
}

/* ── Barre de recherche ── */
.hero__search {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  max-width: 26rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.65rem 1.1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.hero__search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.hero__search-icon { width: 20px; height: 20px; color: var(--faint); flex: none; }

.hero__search-input {
  border: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  width: 100%;
  outline: none;
}
.hero__search-input::placeholder { color: var(--faint); }

/* =============================================================================
   Catalogue (lignes par catégorie — style « Netflix »)
   ========================================================================== */
.catalog {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
}

.catalog__loading,
.catalog__empty {
  text-align: center;
  color: var(--muted);
  padding: 3rem 0;
}

/* ── Grille unique responsive ──
   Toutes les cartes sur la même page, sans titres de catégorie.
   En flux normal : le scale(1.15) du :hover ne décale pas les voisins
   (transform hors flux) et z-index fait passer la carte au-dessus.
   Le padding réserve l'espace du scale pour éviter tout débordement gênant. */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--gap);
  padding: 1rem 0.5rem;
}

/* =============================================================================
   Carte applicative — effet « Netflix »
   ========================================================================== */
.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  z-index: 1;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease,
    border-color 0.3s ease;
  will-change: transform;
  outline: none;
}

/* Agrandissement au survol / focus clavier */
.card:hover,
.card:focus-visible,
.card:focus-within {
  transform: scale(1.15);
  z-index: 10;                /* passe au-dessus des cartes voisines */
  border-color: var(--accent);
  box-shadow:
    0 18px 40px -12px rgba(0, 0, 0, 0.8),
    0 0 0 1px var(--accent),
    0 0 28px -4px var(--accent-glow);
}

.card__link {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* ── Média / icône ── */
.card__media {
  position: relative;
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 50% 35%, rgba(201, 168, 76, 0.14), transparent 70%),
    var(--surface-2);
  border-bottom: 1px solid var(--border);
}

.card__icon {
  font-size: 2.8rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.card__icon img {
  width: 56px;
  height: 56px;
  object-fit: contain;
}

/* Pastille de statut */
.card__status {
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.2);
}
.card__status--off { background: var(--faint); box-shadow: 0 0 0 3px rgba(113,113,122,0.2); }
.card__status--warn { background: var(--warn); box-shadow: 0 0 0 3px rgba(251,191,36,0.2); }

/* ── Corps ── */
.card__body {
  padding: 1rem 1.1rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
}

.card__title {
  font-family: var(--font-sans);
  font-size: 1.05rem;
  font-weight: 600;
  color: #fff;
}

.card__desc {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.45;
  flex: 1;
}

.card__host {
  font-size: 0.72rem;
  color: var(--accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  word-break: break-all;
  opacity: 0.85;
}

/* =============================================================================
   Pied de page
   ========================================================================== */
.footer {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
  border-top: 1px solid var(--border);
  color: var(--faint);
  font-size: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}
.footer__brand { color: var(--accent); font-weight: 600; }
.footer__sep { opacity: 0.4; }

/* =============================================================================
   Accessibilité — respect de prefers-reduced-motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  .card { transition: box-shadow 0.2s ease, border-color 0.2s ease; }
  .card:hover,
  .card:focus-visible,
  .card:focus-within { transform: none; }
  html { scroll-behavior: auto; }
}

/* Réglage des marges du hero sur mobile */
@media (max-width: 640px) {
  .hero { padding: 3rem 1.25rem 2.5rem; }
  .catalog { padding: 2rem 1.25rem 3rem; }
  /* scale réduit sur petits écrans pour éviter le débordement */
  .card:hover,
  .card:focus-visible,
  .card:focus-within { transform: scale(1.06); }
}
