/* ============== BASE ============== */
* { -webkit-tap-highlight-color: transparent; }

:root {
  --brand: #6366f1;
  --brand-2: #8b5cf6;
  --brand-3: #ec4899;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --dark: #0f172a;
  --gray: #64748b;
  --light: #f8fafc;
  --border: #e2e8f0;
  --radius: 16px;
  --radius-sm: 12px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.06);
  --shadow: 0 4px 12px rgba(0,0,0,0.06), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 20px 40px rgba(0,0,0,0.08), 0 8px 16px rgba(0,0,0,0.06);
  --shadow-brand: 0 10px 30px rgba(99,102,241,0.25);
}

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Inter", Roboto, sans-serif;
  background: #f7f8fc;
  color: var(--dark);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5 { font-weight: 700; letter-spacing: -0.02em; }

a { text-decoration: none; transition: all .2s ease; }

/* ============== ANIMATIONS ============== */
@keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideDown { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .6; } }
@keyframes shimmer { 0% { background-position: -1000px 0; } 100% { background-position: 1000px 0; } }
@keyframes gradientMove { 0%,100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }

.fade-up { animation: fadeUp .7s cubic-bezier(.16,1,.3,1) both; }
.fade-in { animation: fadeIn .6s ease both; }
.delay-1 { animation-delay: .1s; }
.delay-2 { animation-delay: .2s; }
.delay-3 { animation-delay: .3s; }
.delay-4 { animation-delay: .4s; }

/* ============== NAVBAR (iOS style glass) ============== */
.ios-nav {
  position: sticky; top: 0; z-index: 1000;
  background: rgba(255,255,255,0.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0,0,0,0.05);
  transition: all .3s ease;
}
.ios-nav .navbar-brand {
  font-weight: 800; font-size: 1.25rem;
  background: linear-gradient(135deg, var(--brand), var(--brand-3));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.03em;
}
.ios-nav .navbar-brand img { height: 38px; border-radius: 10px; }
.ios-nav .nav-link {
  color: #334155; font-weight: 500; padding: .5rem .9rem !important;
  border-radius: 10px; transition: all .2s;
}
.ios-nav .nav-link:hover { color: var(--brand); background: rgba(99,102,241,0.08); }

/* ============== BUTTONS ============== */
.btn {
  border-radius: 12px;
  font-weight: 600;
  padding: .6rem 1.4rem;
  transition: all .25s cubic-bezier(.16,1,.3,1);
  border: none;
  font-size: .95rem;
}
.btn-brand {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  box-shadow: 0 4px 14px rgba(99,102,241,0.3);
}
.btn-brand:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(99,102,241,0.4);
  color: #fff;
}
.btn-brand:active { transform: translateY(0); }
.btn-outline-secondary {
  border: 1.5px solid var(--border);
  background: #fff;
  color: var(--dark);
}
.btn-outline-secondary:hover { background: var(--light); border-color: #cbd5e1; color: var(--dark); }

.btn-lg { padding: .85rem 1.8rem; font-size: 1rem; border-radius: 14px; }

/* ============== HERO (Landing) ============== */
.hero {
  position: relative;
  padding: 100px 0 80px;
  background: linear-gradient(135deg, #f0f4ff 0%, #fef0ff 100%);
  overflow: hidden;
}
.hero::before, .hero::after {
  content: ''; position: absolute; border-radius: 50%; filter: blur(80px); opacity: .5;
  animation: float 6s ease-in-out infinite;
}
.hero::before { width: 400px; height: 400px; background: #a5b4fc; top: -100px; right: -100px; }
.hero::after { width: 350px; height: 350px; background: #f0abfc; bottom: -100px; left: -100px; animation-delay: 2s; }

.hero-content { position: relative; z-index: 2; }
.hero h1 {
  font-size: clamp(2rem, 6vw, 4rem);
  font-weight: 900;
  line-height: 1.1;
  background: linear-gradient(135deg, #1e293b 0%, #4f46e5 50%, #ec4899 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradientMove 6s ease infinite;
  margin-bottom: 1.5rem;
}
.hero p.lead {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  color: #475569;
  max-width: 600px;
  margin: 0 auto 2rem;
}

/* ============== CARDS ============== */
.card {
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
  background: #fff;
  transition: all .3s cubic-bezier(.16,1,.3,1);
  box-shadow: var(--shadow-sm);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }

.stat-card {
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
  padding: 1.5rem;
  background: #fff;
  position: relative;
  overflow: hidden;
  transition: all .3s cubic-bezier(.16,1,.3,1);
}
.stat-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  transform: scaleX(0); transform-origin: left;
  transition: transform .4s ease;
}
.stat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.stat-card:hover::before { transform: scaleX(1); }
.stat-card .stat-label { color: var(--gray); font-size: .8rem; font-weight: 500; text-transform: uppercase; letter-spacing: .05em; }
.stat-card .stat-value { font-size: 1.8rem; font-weight: 800; color: var(--dark); margin-top: .25rem; }
.stat-card .stat-icon {
  position: absolute; right: 1.25rem; top: 1.25rem;
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem;
}
.stat-icon.indigo { background: rgba(99,102,241,0.12); color: var(--brand); }
.stat-icon.green  { background: rgba(16,185,129,0.12); color: var(--success); }
.stat-icon.orange { background: rgba(245,158,11,0.12); color: var(--warning); }
.stat-icon.pink   { background: rgba(236,72,153,0.12); color: var(--brand-3); }

/* ============== PRICING ============== */
.pricing-card {
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2rem 1.5rem;
  background: #fff;
  transition: all .35s cubic-bezier(.16,1,.3,1);
  position: relative;
  height: 100%;
}
.pricing-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-lg); border-color: var(--brand); }
.pricing-card.featured {
  background: linear-gradient(135deg, #1e293b 0%, #4f46e5 100%);
  color: #fff; border: none;
  box-shadow: var(--shadow-brand);
}
.pricing-card.featured .price { color: #fff; }
.pricing-card.featured .text-muted { color: rgba(255,255,255,0.7) !important; }
.pricing-card.featured .feature-item { color: rgba(255,255,255,0.9); }
.pricing-card .price {
  font-size: 2.5rem; font-weight: 800; color: var(--dark);
  letter-spacing: -0.03em;
}
.pricing-card .price small { font-size: .9rem; font-weight: 500; color: var(--gray); }
.feature-item {
  display: flex; align-items: center; gap: .5rem;
  padding: .4rem 0; font-size: .95rem;
}
.feature-item i { color: var(--success); font-size: 1rem; }

.badge-popular {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(135deg, var(--brand-3), var(--brand-2));
  color: #fff; padding: .3rem .9rem; border-radius: 20px;
  font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; box-shadow: 0 4px 12px rgba(236,72,153,0.4);
}

/* ============== FORMS ============== */
.form-control, .form-select {
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: .65rem 1rem;
  font-size: .95rem;
  transition: all .2s ease;
  background: #fff;
}
.form-control:focus, .form-select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(99,102,241,0.1);
}
.form-label { font-weight: 600; font-size: .85rem; color: #334155; margin-bottom: .4rem; }

.auth-card {
  background: #fff;
  border-radius: 24px;
  padding: 2.5rem 2rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  animation: fadeUp .6s cubic-bezier(.16,1,.3,1) both;
}

/* ============== ALERTS ============== */
.alert {
  border: none; border-radius: 14px;
  padding: 1rem 1.25rem;
  font-weight: 500;
  animation: slideDown .4s ease both;
}
.alert-success { background: rgba(16,185,129,0.1); color: #065f46; }
.alert-danger { background: rgba(239,68,68,0.1); color: #991b1b; }
.alert-info { background: rgba(99,102,241,0.1); color: #3730a3; }

/* ============== SIDEBAR (Admin/Society panels) ============== */
.app-layout { display: flex; min-height: 100vh; }
.app-sidebar {
  width: 260px;
  background: linear-gradient(180deg, #0f172a 0%, #1e1b4b 100%);
  color: #cbd5e1;
  padding: 1.5rem 0;
  position: fixed; top: 0; bottom: 0; left: 0;
  overflow-y: auto;
  transition: transform .3s ease;
  z-index: 1000;
}
.app-sidebar .brand {
  padding: 0 1.5rem 1.5rem;
  font-weight: 800; color: #fff; font-size: 1.2rem;
  display: flex; align-items: center; gap: .7rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}
.app-sidebar .brand img { height: 34px; border-radius: 10px; }
.app-sidebar .brand i { font-size: 1.5rem; color: var(--brand-2); }
.app-sidebar a {
  color: #cbd5e1;
  display: flex; align-items: center; gap: .8rem;
  padding: .75rem 1.5rem;
  font-size: .92rem; font-weight: 500;
  border-left: 3px solid transparent;
  transition: all .2s ease;
}
.app-sidebar a i { font-size: 1.15rem; width: 20px; text-align: center; }
.app-sidebar a:hover {
  background: rgba(255,255,255,0.05);
  color: #fff;
  border-left-color: var(--brand-2);
  padding-left: calc(1.5rem + 4px);
}
.app-sidebar a.active {
  background: rgba(99,102,241,0.15);
  color: #fff;
  border-left-color: var(--brand);
}
.app-sidebar .section-label {
  padding: 1rem 1.5rem .3rem;
  font-size: .7rem; text-transform: uppercase;
  letter-spacing: .1em; color: #64748b; font-weight: 600;
}

.app-main {
  margin-left: 260px;
  flex: 1;
  padding: 1.5rem 2rem;
  min-height: 100vh;
  background: #f7f8fc;
  animation: fadeIn .5s ease;
}
.app-topbar {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 2rem;
}
.app-topbar h3 { margin: 0; font-weight: 800; letter-spacing: -0.02em; }
.app-topbar .user-chip {
  display: flex; align-items: center; gap: .6rem;
  background: #fff; padding: .4rem .9rem .4rem .4rem;
  border-radius: 30px; border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.app-topbar .user-chip .avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-3));
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .85rem;
}

/* Mobile sidebar toggle */
.sidebar-toggle {
  display: none;
  position: fixed; top: 1rem; left: 1rem; z-index: 1100;
  background: #fff; border: 1px solid var(--border);
  width: 42px; height: 42px; border-radius: 12px;
  align-items: center; justify-content: center;
  box-shadow: var(--shadow);
}
@media (max-width: 900px) {
  .app-sidebar { transform: translateX(-100%); }
  .app-sidebar.open { transform: translateX(0); }
  .app-main { margin-left: 0; padding: 1rem; padding-top: 4rem; }
  .sidebar-toggle { display: flex; }
}

/* ============== QUICK ACTION TILES ============== */
.action-tile {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: .5rem;
  padding: 1.5rem 1rem;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--border);
  color: var(--dark);
  text-align: center;
  transition: all .3s cubic-bezier(.16,1,.3,1);
  font-weight: 600;
}
.action-tile i { font-size: 1.75rem; color: var(--brand); }
.action-tile:hover {
  transform: translateY(-4px);
  border-color: var(--brand);
  box-shadow: var(--shadow-brand);
  color: var(--brand);
}
.action-tile:hover i { transform: scale(1.1); }

/* ============== TABLES ============== */
.table-card { background: #fff; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.table { margin: 0; }
.table thead th {
  background: #f8fafc; border-bottom: 1px solid var(--border);
  font-size: .78rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--gray); padding: 1rem;
}
.table tbody td { padding: 1rem; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background .15s; }
.table tbody tr:hover { background: #fafbff; }

/* ============== BADGES ============== */
.badge {
  padding: .35rem .7rem; border-radius: 20px;
  font-weight: 600; font-size: .72rem;
  letter-spacing: .02em;
}

/* ============== FOOTER ============== */
.premium-footer {
  background: linear-gradient(180deg, #0f172a 0%, #1e1b4b 100%);
  color: #94a3b8;
  padding: 3rem 0 1.5rem;
  margin-top: 5rem;
}
.premium-footer h5 { color: #fff; font-weight: 700; margin-bottom: 1rem; }
.premium-footer a { color: #94a3b8; display: block; padding: .25rem 0; }
.premium-footer a:hover { color: #fff; padding-left: 4px; }
.premium-footer .brand-name {
  font-weight: 800; font-size: 1.3rem; color: #fff;
  background: linear-gradient(135deg, #a5b4fc, #f0abfc);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: .5rem;
}
.premium-footer .social a {
  display: inline-flex; width: 38px; height: 38px;
  align-items: center; justify-content: center;
  background: rgba(255,255,255,0.05); border-radius: 10px;
  margin-right: .5rem; transition: all .2s;
}
.premium-footer .social a:hover { background: var(--brand); color: #fff; transform: translateY(-3px); }

/* ============== UTILITIES ============== */
.text-brand { color: var(--brand) !important; }
.bg-gradient-brand { background: linear-gradient(135deg, var(--brand), var(--brand-2)); }
.glass {
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.3);
}
.divider { height: 1px; background: var(--border); margin: 1.5rem 0; }

/* Smooth page load */
main, .container { animation: fadeIn .5s ease; }