:root {
  --felp-primary: #1B2A4A;
  --felp-secondary: #2E86AB;
  --felp-accent: #E8B931;
  --felp-accent-hover: #d4a82b;
  --felp-dark: #0f1a2e;
  --felp-light: #f0f4f8;
  --white: #ffffff;
  --black: #111827;
  --green: #10B981;
  --red: #EF4444;
}

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
  background-color: var(--white);
  color: var(--black);
}

/* ========== Navigation ========== */
.nav-link {
  position: relative;
  color: var(--black);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s;
}

.nav-link:hover {
  color: var(--felp-accent);
}

.nav-link::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -4px;
  left: 0;
  background-color: var(--felp-accent);
  transition: width 0.3s ease;
}

.nav-link:hover::after {
  width: 100%;
}

/* ========== Animations ========== */
@keyframes fade-in {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slide-in-left {
  from { opacity: 0; transform: translateX(-30px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes count-up {
  from { opacity: 0; transform: scale(0.5); }
  to { opacity: 1; transform: scale(1); }
}

.animate-fade-in { animation: fade-in 0.8s ease-out; }
.animate-fade-in-up { animation: fade-in-up 0.8s ease-out; }
.animate-slide-in { animation: slide-in-left 0.6s ease-out; }
.animate-float { animation: float 3s ease-in-out infinite; }

/* Intersection Observer animations */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ========== WhatsApp Float ========== */
.whatsapp-float {
  position: fixed;
  bottom: 20px;
  right: 20px;
  font-size: 3rem;
  z-index: 999;
  background-color: #25D366;
  color: white;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(37, 211, 102, 0.4);
  transition: transform 0.3s, box-shadow 0.3s;
  text-decoration: none;
}

.whatsapp-float:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 24px rgba(37, 211, 102, 0.5);
}

@media (max-width: 768px) {
  .whatsapp-float { bottom: 90px; }
}

/* ========== Auth Pages ========== */
.auth-container {
  min-height: 100vh;
  display: flex;
}

.auth-left {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: white;
}

.auth-right {
  flex: 1;
  background: linear-gradient(135deg, var(--felp-primary) 0%, var(--felp-dark) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  position: relative;
  overflow: hidden;
}

.auth-right::before {
  content: '';
  position: absolute;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, var(--felp-accent) 0%, transparent 70%);
  opacity: 0.08;
  animation: pulse 4s ease-in-out infinite;
}

.auth-right::after {
  content: '';
  position: absolute;
  top: -10%;
  right: -10%;
  width: 60%;
  height: 60%;
  background: radial-gradient(circle, var(--felp-secondary) 0%, transparent 70%);
  opacity: 0.1;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 0.08; }
  50% { transform: scale(1.1); opacity: 0.12; }
}

@media (max-width: 768px) {
  .auth-container { flex-direction: column; }
  .auth-right { min-height: 200px; }
}

/* ========== Form Inputs ========== */
input, select, textarea {
  width: 100%;
  padding: 0.75rem;
  margin-bottom: 1rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.3s, box-shadow 0.3s;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--felp-secondary);
  box-shadow: 0 0 0 3px rgba(46, 134, 171, 0.15);
}

/* ========== Dashboard ========== */
.dashboard { padding: 2rem; max-width: 800px; margin: auto; }

.carnet-card {
  background: linear-gradient(135deg, var(--felp-primary) 0%, var(--felp-dark) 100%);
  color: white;
  padding: 2rem;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(27, 42, 74, 0.4);
  position: relative;
  overflow: hidden;
}

.carnet-card::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, var(--felp-accent) 0%, transparent 50%);
  opacity: 0.08;
}

/* ========== Admin Panel ========== */
.admin-container {
  display: flex;
  min-height: 100vh;
  background: var(--felp-light);
}

.admin-sidebar {
  width: 260px;
  background: linear-gradient(180deg, var(--felp-primary) 0%, var(--felp-dark) 100%);
  color: white;
  padding: 1.5rem;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  z-index: 50;
}

.admin-content {
  margin-left: 260px;
  padding: 2rem;
  flex: 1;
}

.admin-nav-item {
  display: flex;
  align-items: center;
  padding: 0 .75rem 1rem;
  color: #94a3b8;
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.3s;
  cursor: pointer;
}

.admin-nav-item:hover, .admin-nav-item.active {
  background: rgba(232, 185, 49, 0.15);
  color: var(--felp-accent);
}

.admin-table {
  width: 100%;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.admin-table th {
  background: var(--felp-light);
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid #e2e8f0;
  color: var(--felp-primary);
}

.admin-table td {
  padding: 1rem;
  border-bottom: 1px solid #f1f5f9;
}

.admin-table tr:hover { background: #f8fafc; }

/* ========== Badges ========== */
.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.875rem;
  font-weight: 500;
}

.badge-active { background: #d1fae5; color: #065f46; }
.badge-inactive { background: #fee2e2; color: #991b1b; }
.badge-pending { background: #fef3c7; color: #92400e; }

/* ========== Modal ========== */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal.active { display: flex; }

.modal-content {
  background: white;
  border-radius: 16px;
  padding: 2rem;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  animation: modal-in 0.3s ease-out;
}

@keyframes modal-in {
  from { opacity: 0; transform: scale(0.9) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* ========== Buttons ========== */
.btn {
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  display: inline-block;
  transition: all 0.3s;
  border: none;
  cursor: pointer;
  font-size: 1rem;
}

.btn-primary {
  background-color: var(--felp-accent);
  color: var(--felp-primary);
}

.btn-primary:hover { background-color: var(--felp-accent-hover); }

.btn-black {
  background-color: var(--felp-primary);
  color: var(--white);
}

.btn-black:hover { background-color: var(--felp-dark); }

.btn-danger { background-color: var(--red); color: white; }
.btn-danger:hover { background-color: #dc2626; }

.btn-success { background-color: var(--green); color: white; }
.btn-success:hover { background-color: #059669; }

/* ========== FELP Landing Specific ========== */
.hero-gradient {
  background: linear-gradient(135deg, var(--felp-primary) 0%, var(--felp-dark) 60%, var(--felp-secondary) 100%);
}

.section-title {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--felp-primary);
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 60px;
  height: 4px;
  background: var(--felp-accent);
  border-radius: 2px;
}

.benefit-card {
  background: white;
  border-radius: 16px;
  padding: 2rem;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  border: 1px solid #e2e8f0;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.benefit-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--felp-secondary), var(--felp-accent));
  transform: scaleX(0);
  transition: transform 0.4s ease;
}

.benefit-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 40px rgba(27, 42, 74, 0.15);
  border-color: var(--felp-secondary);
}

.benefit-card:hover::before { transform: scaleX(1); }

.benefit-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.2rem;
  background: linear-gradient(135deg, rgba(46, 134, 171, 0.1), rgba(232, 185, 49, 0.1));
}

.step-number {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--felp-secondary), var(--felp-accent));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.2rem;
  margin: 0 auto 1rem;
  box-shadow: 0 4px 12px rgba(46, 134, 171, 0.3);
}

.commerce-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  border: 1px solid #e2e8f0;
}

.commerce-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(27, 42, 74, 0.12);
}

.stat-card {
  text-align: center;
  padding: 1.5rem;
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--felp-accent), var(--felp-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ========== Utilities ========== */
.hidden { display: none !important; }
.text-center { text-align: center; }

.glass-card {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
}

/* ========== Responsive ========== */
@media (max-width: 768px) {
  .admin-sidebar {
    width: 100%;
    position: relative;
    height: auto;
  }

  .admin-content {
    margin-left: 0;
    padding: 1rem;
  }

  .admin-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }

  .admin-table thead,
  .admin-table tbody,
  .admin-table tr,
  .admin-table th,
  .admin-table td {
    display: table;
    display: table-row;
  }

  .admin-table th,
  .admin-table td {
    min-width: 120px;
    padding: 0.75rem 0.5rem;
  }

  .admin-table th:last-child,
  .admin-table td:last-child {
    min-width: 150px;
    position: sticky;
    right: 0;
    background: white;
    z-index: 1;
    box-shadow: -2px 0 4px rgba(0, 0, 0, 0.05);
  }

  .admin-table thead th {
    position: sticky;
    top: 0;
    background: var(--felp-light);
    z-index: 2;
  }

  .admin-table thead th:last-child { z-index: 3; }

  .admin-table td button,
  .admin-table td a {
    font-size: 0.875rem;
    padding: 0.375rem 0.5rem;
  }

  .admin-table td svg { width: 1rem; height: 1rem; }

  h1 { font-size: 1.75rem !important; }

  .view-content>div:first-child {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 1rem;
  }

  .view-content>div:first-child button { width: 100%; }

  .btn-filter {
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
  }

  .grid.md\:grid-cols-4 {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .section-title { font-size: 1.8rem; }
}

@media (max-width: 768px) {
  body { padding-bottom: 70px; }
}

@media (min-width: 769px) {
  #navbar-expanded {
    display: block !important;
  }

  #menu-center {
    display: flex !important;
  }

  #logo-top { align-items: center; }
  #menu-center { align-items: center; }
}