/* =============================================================
   Bêta Arsenal — Feuille de styles principale
   Mobile-first, responsive, thème sombre par défaut.
   Palette : neutres sombres + accent émeraude (pas d'indigo/bleu).
   ============================================================= */

/* ---------- Variables de thème ---------- */
:root {
  --bg: #0b0f14;
  --bg-elev: #121821;
  --bg-elev-2: #1a2230;
  --surface: #0f141b;
  --border: #243042;
  --border-strong: #324056;
  --text: #e8edf4;
  --text-muted: #9aa7b8;
  --text-dim: #6b7689;
  --accent: #10b981;          /* emerald-500 */
  --accent-hover: #059669;    /* emerald-600 */
  --accent-soft: rgba(16, 185, 129, 0.12);
  --danger: #ef4444;
  --danger-soft: rgba(239, 68, 68, 0.12);
  --warn: #f59e0b;
  --warn-soft: rgba(245, 158, 11, 0.12);
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --maxw: 1140px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

/* ---------- Reset léger ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  font-size: 16px;
  min-height: 100vh;
  min-height: 100dvh;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select, button { font-size: 100%; }

/* ---------- Shell : header + main + footer collé en bas ---------- */
.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}
.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
}
.main-content {
  flex: 1 1 auto;
  padding-top: 32px;
  padding-bottom: 56px;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 15, 20, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 34px; height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #0ea5e9);
  color: #06121a;
  font-weight: 800;
  font-size: 20px;
}
.brand-name { font-size: 18px; letter-spacing: -0.01em; }
.header-actions { display: flex; align-items: center; gap: 8px; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
  transition: background .15s ease, border-color .15s ease, transform .05s ease;
  min-height: 42px;
}
.btn:active { transform: translateY(1px); }
.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text-muted);
}
.btn-ghost:hover { color: var(--text); border-color: var(--border-strong); background: var(--bg-elev); }
.btn-primary {
  background: var(--accent);
  color: #06120c;
  border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; }
.btn-secondary {
  background: var(--bg-elev-2);
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-secondary:hover { background: var(--border); }
.btn-danger {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: transparent;
}
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 10px; min-height: 32px; font-size: 13px; }
.btn-price {
  background: rgba(6, 18, 12, 0.2);
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 700;
}

/* ---------- Hero ---------- */
.hero { text-align: center; padding: 24px 0 32px; }
.hero h1 {
  font-size: clamp(28px, 5vw, 44px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
  font-weight: 800;
}
.hero p { color: var(--text-muted); font-size: 18px; margin: 0 auto; max-width: 640px; }

/* ---------- Filtres (chips) ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.chip {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
}
.chip:hover { color: var(--text); border-color: var(--border-strong); }
.chip-active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
}

/* ---------- Grille catalogue ---------- */
.catalog-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}
@media (min-width: 640px) { .catalog-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 980px) { .catalog-grid { grid-template-columns: repeat(3, 1fr); } }

/* ---------- Carte offre ---------- */
.offer-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color .15s ease, transform .15s ease;
}
.offer-card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.offer-type {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
}
.offer-type.service { background: var(--warn-soft); color: var(--warn); }
.offer-title { font-size: 18px; font-weight: 700; margin: 0; letter-spacing: -0.01em; }
.offer-desc { color: var(--text-muted); font-size: 14px; margin: 0; flex: 1 1 auto; }
.offer-price {
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
}
.offer-price small { font-size: 13px; color: var(--text-dim); font-weight: 500; margin-left: 4px; }
.offer-socials { display: flex; flex-wrap: wrap; gap: 6px; }
.offer-socials a {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.offer-socials a:hover { color: var(--text); border-color: var(--border-strong); text-decoration: none; }
.offer-foot { margin-top: auto; }

/* ---------- Skeleton ---------- */
.card-skeleton {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  height: 220px;
  position: relative;
  overflow: hidden;
}
.card-skeleton::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.04), transparent);
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { 0% { transform: translateX(-100%);} 100% { transform: translateX(100%);} }

/* ---------- État vide ---------- */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.hidden { display: none !important; }

/* ---------- Footer (collé en bas via flex) ---------- */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 20px 0;
  /* Respect de la safe area iOS */
  padding-bottom: calc(20px + env(safe-area-inset-bottom, 0));
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.footer-inner p { margin: 0; color: var(--text-dim); font-size: 14px; }
.footer-nav { display: flex; gap: 16px; }
.footer-nav a { color: var(--text-muted); font-size: 14px; }
.footer-nav a:hover { color: var(--text); }

/* ---------- Modale ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(2, 6, 12, 0.7);
  backdrop-filter: blur(4px);
}
.modal-card {
  position: relative;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow);
  max-height: 90vh;
  overflow-y: auto;
}
.modal-card-wide { max-width: 640px; }
.modal-close {
  position: absolute;
  top: 14px; right: 14px;
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 20px;
  line-height: 1;
}
.modal-close:hover { color: var(--text); }
.modal-card h2 { margin: 0 0 18px; font-size: 22px; }
.offer-preview {
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 18px;
}
.offer-preview .op-title { font-weight: 700; margin-bottom: 4px; }
.offer-preview .op-price { color: var(--accent); font-weight: 700; }

/* ---------- Formulaires ---------- */
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin: 14px 0 6px;
}
.form-input {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 15px;
  transition: border-color .15s ease;
}
.form-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
textarea.form-input { resize: vertical; min-height: 70px; }
.form-hint { font-size: 12px; color: var(--text-dim); margin: 6px 0 0; }
.form-error {
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 13px;
  margin: 12px 0;
}
.form-row { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 560px) { .form-row { grid-template-columns: 1fr 1fr; } }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0;
  font-size: 14px;
  color: var(--text-muted);
  cursor: pointer;
}
.checkbox-row input { width: 18px; height: 18px; accent-color: var(--accent); }

/* ---------- Auth (login) ---------- */
.auth-main { display: grid; place-items: center; padding-top: 60px; }
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  width: 100%;
  max-width: 420px;
}
.auth-card h1 { margin: 0 0 6px; font-size: 24px; }
.auth-subtitle { color: var(--text-muted); margin: 0 0 22px; font-size: 14px; }
.admin-email-badge {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  padding: 5px 10px;
  border-radius: 999px;
}

/* ---------- Dashboard ---------- */
.dashboard-title { font-size: 28px; margin: 0 0 24px; font-weight: 800; }
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: 28px;
}
@media (min-width: 760px) { .stats-grid { grid-template-columns: repeat(4, 1fr); } }
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}
.stat-label { font-size: 12px; color: var(--text-dim); text-transform: uppercase; letter-spacing: .04em; }
.stat-value { font-size: 26px; font-weight: 800; margin-top: 6px; letter-spacing: -0.02em; }
.stat-ok { color: var(--accent); }
.stat-warn { color: var(--warn); }

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.section-head h2 { margin: 0; font-size: 20px; }

/* ---------- Onglets ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 22px; overflow-x: auto; }
.tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 12px 16px;
  font-weight: 600;
  font-size: 14px;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab-active { color: var(--accent); border-bottom-color: var(--accent); }

/* ---------- Liste offres (admin) ---------- */
.offers-list { display: grid; gap: 12px; }
.admin-offer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  flex-wrap: wrap;
}
.admin-offer-row .ar-main { flex: 1 1 220px; }
.admin-offer-row .ar-title { font-weight: 700; }
.admin-offer-row .ar-meta { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.admin-offer-row .ar-actions { display: flex; gap: 8px; }
.badge {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.badge-active { background: var(--accent-soft); color: var(--accent); }
.badge-inactive { background: rgba(154, 167, 184, 0.12); color: var(--text-muted); }

/* ---------- Tableau transactions ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 640px; }
.data-table th, .data-table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); }
.data-table th { background: var(--bg-elev); color: var(--text-muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--bg-elev); }
.status-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.status-pending { background: var(--warn-soft); color: var(--warn); }
.status-approved { background: var(--accent-soft); color: var(--accent); }
.status-declined { background: var(--danger-soft); color: var(--danger); }
.status-refunded { background: rgba(154,167,184,.12); color: var(--text-muted); }

/* ---------- Fieldset ---------- */
.fieldset {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin: 18px 0;
}
.fieldset legend { font-weight: 700; padding: 0 8px; color: var(--text); }
.uploadcare-info {
  margin-top: 12px;
  padding: 10px 12px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
}
.uploadcare-info .uc-name { font-weight: 600; }
.uploadcare-info .uc-size { color: var(--text-dim); }

/* ---------- Page succès ---------- */
.success-main { display: grid; place-items: center; }
.status-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px;
  width: 100%;
  max-width: 560px;
  text-align: center;
}
.status-icon {
  width: 72px; height: 72px;
  border-radius: 50%;
  display: grid; place-items: center;
  margin: 0 auto 18px;
  font-size: 36px;
}
.status-icon.pending { background: var(--warn-soft); color: var(--warn); }
.status-icon.approved { background: var(--accent-soft); color: var(--accent); }
.status-icon.declined { background: var(--danger-soft); color: var(--danger); }
.status-card h1 { margin: 0 0 8px; font-size: 24px; }
.status-card p { color: var(--text-muted); margin: 0 0 18px; }
.status-card .spinner {
  width: 28px; height: 28px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  margin: 16px auto;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.download-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--accent);
  color: #06120c;
  padding: 14px 24px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  text-decoration: none;
  margin: 8px 0;
}
.download-btn:hover { background: var(--accent-hover); text-decoration: none; }
.service-instructions {
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px;
  text-align: left;
  margin: 16px 0;
}
.service-instructions h3 { margin: 0 0 10px; font-size: 16px; }
.service-instructions p { margin: 0 0 10px; color: var(--text); }
.service-link {
  display: inline-block;
  margin: 6px 8px 0 0;
  padding: 8px 14px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}
.service-link:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.expiry-note { font-size: 12px; color: var(--text-dim); margin-top: 8px; }
.retry-timer { font-size: 13px; color: var(--text-dim); margin-top: 12px; }

/* ---------- Légal ---------- */
.legal-main { max-width: 820px; }
.legal-main h1 { font-size: 32px; margin: 0 0 20px; }
.legal-main h2 { font-size: 20px; margin: 22px 0 10px; }
.legal-section p { color: var(--text-muted); margin: 0 0 12px; }
.warning-box {
  background: var(--warn-soft);
  border: 1px solid var(--warn);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 24px;
}
.warning-box strong { color: var(--warn); }
.warning-box p { margin: 8px 0 0; color: var(--text); font-size: 14px; }
.tab-content { display: none; }
.tab-content-active { display: block; }

/* ---------- Liens retour ---------- */
.back-link { display: inline-flex; gap: 6px; align-items: center; color: var(--text-muted); font-size: 14px; margin-bottom: 16px; }
.back-link:hover { color: var(--text); text-decoration: none; }

/* ---------- Scrollbar personnalisée (listes longues) ---------- */
.scroll-area { max-height: 480px; overflow-y: auto; }
.scroll-area::-webkit-scrollbar { width: 10px; height: 10px; }
.scroll-area::-webkit-scrollbar-track { background: var(--bg-elev); }
.scroll-area::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 8px; }
.scroll-area::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

/* ---------- Responsive header ---------- */
@media (max-width: 480px) {
  .brand-name { display: none; }
  .header-inner { height: 58px; }
  .hero { padding: 16px 0 24px; }
}
