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

:root {
  --bg: #f6f4f1;
  --bg-card: #ffffff;
  --text: #1a1a22;
  --text-mute: #6b6b78;
  --text-soft: #4a4a55;
  --accent: #ff4d6a;
  --accent-hover: #e83a59;
  --online: #25d366;
  --shadow-sm: 0 1px 2px rgba(20, 20, 30, 0.04), 0 2px 6px rgba(20, 20, 30, 0.05);
  --shadow-md: 0 4px 12px rgba(20, 20, 30, 0.06), 0 10px 28px rgba(255, 77, 106, 0.18);
  --border: rgba(20, 20, 30, 0.06);
}

html, body { min-height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  padding-bottom: max(32px, env(safe-area-inset-bottom));
  padding-top: env(safe-area-inset-top);
}

/* ─── Top bar ─────────────────────────────── */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  max-width: 1240px;
  margin: 0 auto;
}

.logo {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.4px;
  text-decoration: none;
  line-height: 1.1;
}
.logo-rose { color: var(--accent); }
.logo-dark { color: var(--text); }

.btn-signup {
  background: var(--accent);
  color: white;
  text-decoration: none;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.3px;
  transition: background 0.15s ease, transform 0.15s ease;
  white-space: nowrap;
  flex-shrink: 0;
}
.btn-signup:hover { background: var(--accent-hover); }
.btn-signup:active { transform: scale(0.97); }

/* ─── Hero ────────────────────────────────── */

.hero {
  text-align: center;
  padding: 14px 16px 22px;
  max-width: 720px;
  margin: 0 auto;
}
.hero h1 {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.3px;
  margin-bottom: 8px;
  color: var(--text);
}
.hero p {
  color: var(--text-soft);
  font-size: 15px;
  line-height: 1.5;
}

/* ─── Grid ────────────────────────────────── */

.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  padding: 8px 24px 24px;
  max-width: 1240px;
  margin: 0 auto;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border-radius: 16px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: transform 0.15s ease, box-shadow 0.2s ease;
  cursor: pointer;
}

@media (hover: hover) {
  .card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
  }
  .card:hover .cta { background: var(--accent-hover); }
}

.card:active { transform: scale(0.985); }

.photo {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: #ededed;
}
.photo img {
  width: 100%;
  /* height: 100%; */
  object-fit: cover;
  display: block;
}

/* Bottom-left "En ligne" badge */
.status {
  position: absolute;
  bottom: 10px;
  left: 10px;
  background: rgba(255, 255, 255, 0.85);
  -webkit-backdrop-filter: blur(8px) saturate(1.4);
  backdrop-filter: blur(8px) saturate(1.4);
  color: var(--text);
  padding: 5px 10px;
  border-radius: 14px;
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.2px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 1px 3px rgba(20, 20, 30, 0.08);
}
.status .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--online);
  position: relative;
}
.status .dot::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  background: var(--online);
  opacity: 0.45;
  animation: pulse 1.6s ease-out infinite;
}
@keyframes pulse {
  0%   { transform: scale(1);   opacity: 0.5; }
  70%  { transform: scale(2.2); opacity: 0;   }
  100% { transform: scale(2.2); opacity: 0;   }
}

/* Bottom-right distance badge */
.distance {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(255, 255, 255, 0.85);
  -webkit-backdrop-filter: blur(8px) saturate(1.4);
  backdrop-filter: blur(8px) saturate(1.4);
  color: var(--text);
  padding: 5px 10px;
  border-radius: 14px;
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  letter-spacing: 0.2px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 1px 3px rgba(20, 20, 30, 0.08);
}
.distance svg { color: var(--accent); }

.cta {
  background: var(--accent);
  color: white;
  text-align: center;
  padding: 13px 12px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  transition: background 0.15s ease;
}

.empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-mute);
  padding: 56px 16px;
  font-size: 14px;
  line-height: 1.6;
}
.empty code {
  background: rgba(20, 20, 30, 0.05);
  padding: 2px 7px;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
  color: var(--text);
}

/* ─── Tablet ──────────────────────────────── */
@media (max-width: 1024px) {
  .topbar { padding: 12px 18px; }
  .logo { font-size: 19px; }
  .btn-signup { padding: 9px 16px; font-size: 13px; }
  .grid { grid-template-columns: repeat(3, 1fr); gap: 14px; padding: 6px 18px 20px; }
}

/* ─── Mobile ──────────────────────────────── */
@media (max-width: 700px) {
  .topbar { padding: 11px 14px; gap: 10px; }
  .logo { font-size: 16px; letter-spacing: -0.3px; }
  .btn-signup { padding: 8px 14px; font-size: 12.5px; }
  .hero { padding: 4px 16px 14px; }
  .hero h1 { font-size: 21px; }
  .hero p { font-size: 13.5px; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 11px; padding: 4px 12px 16px; }
  .status, .distance { font-size: 10px; padding: 4px 8px; bottom: 8px; }
  .status { left: 8px; }
  .distance { right: 8px; }
  .cta { padding: 12px 10px; font-size: 12px; letter-spacing: 0.3px; }
}

/* ─── Small phones ────────────────────────── */
@media (max-width: 380px) {
  .logo { font-size: 14.5px; }
  .btn-signup { padding: 7px 12px; font-size: 12px; }
  .grid { gap: 9px; padding: 4px 10px 14px; }
  .status, .distance { font-size: 9.5px; padding: 3px 7px; }
  .cta { padding: 11px 8px; font-size: 11.5px; }
}
