:root {
  --primary: #6C63FF;
  --primary-dark: #5A52D5;
  --secondary: #8B5CF6;
  --accent: #3B82F6;
  --dark: #1E1B4B;
  --darker: #0F0A2E;
  --light: #F5F3FF;
  --gray: #6B7280;
  --white: #FFFFFF;
  --gradient: linear-gradient(135deg, #6C63FF 0%, #8B5CF6 50%, #3B82F6 100%);
  --gradient-dark: linear-gradient(135deg, #1E1B4B 0%, #2D1B69 50%, #1E3A5F 100%);
  --shadow: 0 4px 20px rgba(108, 99, 255, 0.15);
  --shadow-lg: 0 8px 40px rgba(108, 99, 255, 0.2);
  --radius: 12px;
  --radius-lg: 20px;
}

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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--light);
  color: var(--dark);
  overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ====== Navbar ====== */
.navbar {
  background: rgba(30, 27, 75, 0.95);
  backdrop-filter: blur(10px);
  padding: 15px 0;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  border-bottom: 1px solid rgba(108, 99, 255, 0.2);
}

.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}



.nav-links {
  display: flex;
  gap: 30px;
  align-items: center;
}

.nav-links a {
  color: rgba(255, 255, 255, 0.85);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s;
  position: relative;
  padding: 5px 0;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gradient);
  transition: width 0.3s;
}

.nav-links a:hover {
  color: var(--white);
}

.nav-links a:hover::after {
  width: 100%;
}

.nav-links a.active {
  color: var(--white);
}

.nav-links a.active::after {
  width: 100%;
}

.nav-auth {
  display: flex;
  gap: 12px;
  align-items: center;
}

.btn {
  padding: 10px 24px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  border: none;
  cursor: pointer;
  transition: all 0.3s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary {
  background: var(--gradient);
  color: white;
  box-shadow: var(--shadow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-outline {
  background: transparent;
  color: var(--white);
  border: 2px solid rgba(108, 99, 255, 0.5);
}

.btn-outline:hover {
  border-color: var(--primary);
  background: rgba(108, 99, 255, 0.1);
}

.btn-danger {
  background: #EF4444;
  color: white;
}

.btn-success {
  background: #10B981;
  color: white;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 12px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 15px;
  color: white;
}

.user-info .balance {
  background: rgba(108, 99, 255, 0.2);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  border: 1px solid rgba(108, 99, 255, 0.3);
}

.user-info .username {
  font-weight: 600;
  font-size: 14px;
}

.user-menu {
  display: none;
}

.user-menu.show {
  display: flex;
}

/* ====== Hero ====== */
.hero {
  padding: 160px 0 100px;
  background: var(--gradient-dark);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(108, 99, 255, 0.15) 0%, transparent 70%);
  border-radius: 50%;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.1) 0%, transparent 70%);
  border-radius: 50%;
}

.hero .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 1;
}

.hero-content {
  flex: 1;
  max-width: 600px;
}

.hero-content .badge {
  display: inline-block;
  background: rgba(108, 99, 255, 0.2);
  border: 1px solid rgba(108, 99, 255, 0.3);
  color: var(--secondary);
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.hero-content h1 {
  font-size: 52px;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 20px;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-content p {
  color: rgba(255, 255, 255, 0.7);
  font-size: 18px;
  line-height: 1.6;
  margin-bottom: 30px;
}

.hero-actions {
  display: flex;
  gap: 15px;
}

.hero-actions .btn {
  padding: 14px 32px;
  font-size: 16px;
}

.hero-visual {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-visual .floating-card {
  width: 300px;
  height: 350px;
  background: linear-gradient(135deg, rgba(108, 99, 255, 0.2), rgba(139, 92, 246, 0.1));
  border: 1px solid rgba(108, 99, 255, 0.2);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  animation: float 6s ease-in-out infinite;
}

.hero-visual .floating-card .icon-circle {
  width: 80px;
  height: 80px;
  background: var(--gradient);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
}

.hero-visual .floating-card h3 {
  color: white;
  font-size: 20px;
}

.hero-visual .floating-card p {
  color: rgba(255, 255, 255, 0.6);
  font-size: 14px;
}

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

/* ====== Sections ====== */
.section {
  padding: 80px 0;
}

.section-header {
  text-align: center;
  margin-bottom: 50px;
}

.section-header h2 {
  font-size: 36px;
  font-weight: 700;
  margin-bottom: 12px;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.section-header p {
  color: var(--gray);
  font-size: 16px;
  max-width: 500px;
  margin: 0 auto;
}

/* ====== Products Grid ====== */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 30px;
}

.product-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 30px;
  box-shadow: var(--shadow);
  transition: all 0.3s;
  border: 1px solid rgba(108, 99, 255, 0.1);
  position: relative;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(108, 99, 255, 0.3);
}

.product-card .badge-new {
  position: absolute;
  top: 15px;
  right: 15px;
  background: var(--gradient);
  color: white;
  padding: 4px 12px;
  border-radius: 15px;
  font-size: 11px;
  font-weight: 600;
}

.product-card .product-icon {
  width: 60px;
  height: 60px;
  background: var(--light);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin-bottom: 15px;
}

.product-card h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--dark);
}

.product-card p {
  font-size: 14px;
  color: var(--gray);
  line-height: 1.5;
  margin-bottom: 15px;
}

.product-card .price {
  font-size: 24px;
  font-weight: 700;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 15px;
}

.product-card .btn {
  width: 100%;
  justify-content: center;
}

/* ====== News Section ====== */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 25px;
}

.news-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 25px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--primary);
  transition: all 0.3s;
}

.news-card:hover {
  transform: translateX(5px);
  box-shadow: var(--shadow-lg);
}

.news-card .news-source {
  font-size: 12px;
  color: var(--primary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.news-card h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--dark);
}

.news-card p {
  font-size: 14px;
  color: var(--gray);
  line-height: 1.6;
}

.news-card .news-date {
  font-size: 12px;
  color: #aaa;
  margin-top: 12px;
}

/* ====== Modal ====== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(5px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
}

.modal-overlay.show {
  display: flex;
}

.modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 100%;
  max-width: 450px;
  position: relative;
  animation: modalIn 0.3s ease;
  max-height: 90vh;
  overflow-y: auto;
}

@keyframes modalIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal .close-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--gray);
  transition: color 0.3s;
}

.modal .close-btn:hover {
  color: var(--dark);
}

.modal h2 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.modal p.subtitle {
  color: var(--gray);
  font-size: 14px;
  margin-bottom: 25px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 6px;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #E5E7EB;
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.3s;
  background: var(--white);
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.1);
}

.form-group .error {
  color: #EF4444;
  font-size: 12px;
  margin-top: 4px;
  display: none;
}

.form-footer {
  text-align: center;
  margin-top: 15px;
  font-size: 14px;
  color: var(--gray);
}

.form-footer a {
  color: var(--primary);
  font-weight: 600;
  cursor: pointer;
}

.form-footer a:hover {
  text-decoration: underline;
}

/* ====== Payment Methods ====== */
.payment-methods {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.payment-method {
  padding: 16px;
  border: 2px solid #E5E7EB;
  border-radius: 10px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 14px;
  font-weight: 600;
}

.payment-method:hover {
  border-color: var(--primary);
  background: var(--light);
}

.payment-method.selected {
  border-color: var(--primary);
  background: rgba(108, 99, 255, 0.1);
}

.payment-method .pm-icon {
  font-size: 24px;
  display: block;
  margin-bottom: 6px;
}

/* ====== Cart / Orders ====== */
.orders-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.order-item {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid rgba(108, 99, 255, 0.1);
}

.order-item .order-info h4 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
}

.order-item .order-info p {
  font-size: 13px;
  color: var(--gray);
}

.order-item .order-status {
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.status-en_attente { background: #FFF3CD; color: #856404; }
.status-confirmé { background: #D4EDDA; color: #155724; }
.status-annulé { background: #F8D7DA; color: #721C24; }

/* ====== Portfolio / Wallet ====== */
.wallet-card {
  background: var(--gradient-dark);
  border-radius: var(--radius-lg);
  padding: 40px;
  color: white;
  margin-bottom: 30px;
  position: relative;
  overflow: hidden;
}

.wallet-card::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(108, 99, 255, 0.2), transparent);
  border-radius: 50%;
}

.wallet-card .wallet-balance {
  position: relative;
  z-index: 1;
}

.wallet-card .wallet-label {
  font-size: 14px;
  opacity: 0.8;
  margin-bottom: 8px;
}

.wallet-card .wallet-amount {
  font-size: 48px;
  font-weight: 800;
  margin-bottom: 20px;
}

.wallet-card .wallet-amount span {
  font-size: 24px;
  opacity: 0.6;
}

.add-funds-section {
  background: var(--white);
  border-radius: var(--radius);
  padding: 30px;
  box-shadow: var(--shadow);
}

.add-funds-section h3 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 20px;
}

/* ====== Footer ====== */
.footer {
  background: var(--dark);
  color: rgba(255, 255, 255, 0.7);
  padding: 60px 0 30px;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 40px;
  margin-bottom: 40px;
}

.footer-col h4 {
  color: var(--white);
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 15px;
}

.footer-col p, .footer-col a {
  font-size: 14px;
  line-height: 2;
  display: block;
  transition: color 0.3s;
}

.footer-col a:hover {
  color: var(--primary);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 20px;
  text-align: center;
  font-size: 13px;
}

/* ====== Responsive ====== */
@media (max-width: 768px) {
  .navbar .container { flex-wrap: wrap; }
  .nav-links { display: none; order: 3; width: 100%; flex-direction: column; padding: 20px 0; gap: 15px; }
  .nav-links.show { display: flex; }
  .hero { padding: 120px 0 60px; }
  .hero-content h1 { font-size: 32px; }
  .hero .container { flex-direction: column; text-align: center; }
  .hero-actions { justify-content: center; }
  .hero-visual { display: none; }
  .section-header h2 { font-size: 28px; }
  .products-grid { grid-template-columns: 1fr; }
  .news-grid { grid-template-columns: 1fr; }
  .payment-methods { grid-template-columns: 1fr; }
  .wallet-card .wallet-amount { font-size: 32px; }
  .hamburger { display: block !important; }
}

.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: white;
  margin: 5px 0;
  transition: all 0.3s;
}

/* Toast notification */
.toast {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: var(--white);
  border-radius: var(--radius);
  padding: 16px 24px;
  box-shadow: var(--shadow-lg);
  border-left: 4px solid var(--primary);
  z-index: 3000;
  transform: translateX(120%);
  transition: transform 0.4s ease;
  max-width: 400px;
}

.toast.show {
  transform: translateX(0);
}

.toast .toast-title {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 4px;
}

.toast .toast-message {
  font-size: 13px;
  color: var(--gray);
}

/* Tabs */
.tabs {
  display: flex;
  gap: 0;
  margin-bottom: 30px;
  background: var(--white);
  border-radius: var(--radius);
  padding: 4px;
  box-shadow: var(--shadow);
}

.tab {
  padding: 12px 24px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--gray);
  border-radius: 8px;
  transition: all 0.3s;
  flex: 1;
}

.tab.active {
  background: var(--gradient);
  color: white;
}

.tab-content { display: none; }
.tab-content.active { display: block; }

.pm-icon { width:24px; height:24px; vertical-align:middle; }
