/* === Nirvanet theme — ReseauLab portal === */
:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --secondary: #8b5cf6;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #06b6d4;

  --bg: #ffffff;
  --bg-alt: #f9fafb;
  --bg-card: #ffffff;
  --text: #111827;
  --text-muted: #6b7280;
  --border: #e5e7eb;

  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
  --radius: 8px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f172a;
    --bg-alt: #1e293b;
    --bg-card: #1e293b;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --border: #334155;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg-alt);
  color: var(--text);
  line-height: 1.5;
}

main { max-width: 1200px; margin: 2rem auto; padding: 0 1rem; }

/* === Navbar === */
.navbar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 1.2rem;
}
.logo-icon { font-size: 1.5rem; }
.nav-links { display: flex; gap: 1rem; align-items: center; }
.nav-links a { text-decoration: none; color: var(--text); font-size: 0.95rem; }
.nav-links a:hover { color: var(--primary); }
.user-info { font-size: 0.85rem; color: var(--text-muted); }

/* === Buttons === */
.btn-primary, .btn-secondary, .btn-danger-small {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s;
  font-size: 0.95rem;
}
.btn-primary {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-large { padding: 0.75rem 1.5rem; font-size: 1.05rem; }
.btn-secondary {
  background: var(--bg-card);
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover { background: var(--bg-alt); }
.btn-danger-small { background: var(--danger); color: white; padding: 0.3rem 0.6rem; font-size: 0.8rem; }
.btn-logout { font-size: 0.85rem; color: var(--text-muted); }

/* === Hero === */
.hero {
  text-align: center;
  padding: 3rem 1rem;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  border-radius: var(--radius);
  margin-bottom: 2rem;
}
.hero h1 { margin: 0 0 1rem; font-size: 2.5rem; }
.hero-subtitle { font-size: 1.15rem; opacity: 0.95; max-width: 700px; margin: 0 auto 2rem; }
.hero-cta { margin-top: 2rem; }
.hero-no-card, .hero-current, .hero-warning { margin-top: 0.5rem; font-size: 0.9rem; opacity: 0.9; }

/* === Features === */
.features { margin: 3rem 0; }
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}
.feature {
  background: var(--bg-card);
  padding: 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: center;
}
.feature-icon { font-size: 2.5rem; margin-bottom: 0.5rem; }
.feature h3 { margin: 0.5rem 0; }

/* === Plans === */
.pricing-preview, .pricing-page { margin: 3rem 0; }
.pricing-intro { text-align: center; color: var(--text-muted); margin-bottom: 2rem; }
.plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}
.plan-card {
  position: relative;
  background: var(--bg-card);
  padding: 2rem 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 2px solid var(--border);
  display: flex;
  flex-direction: column;
}
.plan-featured { border-color: var(--primary); transform: scale(1.03); position: relative; z-index: 2; }
/* Force l'ordre : Essai gratuit → Pro (mis en avant) → Basic → Team */
.plans-grid .plan-card:first-child { order: -2; }
.plans-grid .plan-card.plan-featured { order: -1; }
.plan-badge {
  position: absolute;
  top: -12px;
  right: 20px;
  background: var(--primary);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 700;
}
.plan-card h3 { margin-top: 0; }
.plan-price { font-size: 2.25rem; font-weight: 700; margin: 0.5rem 0; }
.plan-interval { font-size: 0.9rem; color: var(--text-muted); font-weight: 400; }
.plan-description { color: var(--text-muted); min-height: 3rem; }
.plan-features { list-style: none; padding: 0; margin: 1rem 0; }
.plan-features li { padding: 0.3rem 0; font-size: 0.95rem; }
.plan-actions { margin-top: auto; padding-top: 1rem; display: flex; flex-direction: column; gap: 0.5rem; }
.plan-trial-info { color: var(--text-muted); font-size: 0.9rem; text-align: center; }

/* === Dashboard === */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}
.dashboard-card {
  background: var(--bg-card);
  padding: 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* === Tables === */
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.data-table th, .data-table td { padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid var(--border); }
.data-table th { background: var(--bg-alt); font-weight: 600; font-size: 0.85rem; text-transform: uppercase; color: var(--text-muted); }

/* === Badges === */
.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 0.3rem;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-active { background: #d1fae5; color: #065f46; }
.badge-expired { background: #fee2e2; color: #991b1b; }
.badge-completed { background: #d1fae5; color: #065f46; }
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-failed { background: #fee2e2; color: #991b1b; }
.badge-cancelled { background: #e5e7eb; color: #374151; }
.badge-suspended { background: #fed7aa; color: #9a3412; }

/* === Alerts === */
.alert {
  padding: 1rem;
  border-radius: var(--radius);
  margin: 1rem 0;
}
.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #10b981; }
.alert-info { background: #dbeafe; color: #1e40af; border: 1px solid #3b82f6; }
.alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #ef4444; }

/* === Forms === */
input, select, textarea {
  width: 100%;
  padding: 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}

/* === Billing === */
.billing-section { margin: 2rem 0; }
.billing-section h2 { margin-bottom: 1rem; }
.payment-list { list-style: none; padding: 0; }
.payment-list li { display: flex; gap: 1rem; padding: 0.5rem 0; border-bottom: 1px solid var(--border); align-items: center; }
.payment-amount { font-weight: 700; }
.payment-date { color: var(--text-muted); font-size: 0.85rem; margin-left: auto; }

/* === FAQ === */
.pricing-faq { margin-top: 3rem; max-width: 800px; margin-left: auto; margin-right: auto; }
.pricing-faq details { background: var(--bg-card); padding: 1rem 1.25rem; border-radius: var(--radius); margin-bottom: 0.75rem; box-shadow: var(--shadow); }
.pricing-faq summary { cursor: pointer; font-weight: 600; }

/* === Footer === */
footer {
  margin-top: 4rem;
  padding: 2rem 1rem;
  text-align: center;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}
footer a { color: var(--text-muted); }

/* === Subscribe required === */
.subscribe-required { text-align: center; padding: 3rem 1rem; }
.subscribe-required h1 { font-size: 2rem; }

/* === Utils === */
.text-warning { color: var(--warning); }