/* =============================================
   EMC - English Language Centre
   Blue/White Theme | Dark Mode Support
   ============================================= */

:root {
  /* Light Mode (default) */
  --bg-primary: #ffffff;
  --bg-secondary: #f0f6ff;
  --bg-card: #ffffff;
  --bg-sidebar: #1a3a6b;

  --text-primary: #0d1f3c;
  --text-secondary: #4a6080;
  --text-muted: #8a9bb0;
  --text-on-dark: #ffffff;

  --accent-primary: #1a5fd6;
  --accent-hover: #1249b0;
  --accent-light: #dbeafe;
  --accent-border: #93c5fd;

  --border-color: #dde8f7;
  --shadow: 0 2px 12px rgba(26, 95, 214, 0.08);
  --shadow-card: 0 4px 20px rgba(26, 95, 214, 0.12);

  --nav-bg: #1a3a6b;
  --nav-text: #c8d9f5;
  --nav-active: #ffffff;
  --nav-hover: rgba(255,255,255,0.15);

  --badge-basic: #1a5fd6;
  --badge-advance: #7c3aed;
  --badge-advance-plus: #0891b2;

  --transition: 0.25s ease;
}

[data-theme="dark"] {
  --bg-primary: #0d1f3c;
  --bg-secondary: #112244;
  --bg-card: #152b55;
  --bg-sidebar: #0a1628;

  --text-primary: #e8f0fe;
  --text-secondary: #93afd4;
  --text-muted: #5577a0;
  --text-on-dark: #ffffff;

  --accent-primary: #3b7de8;
  --accent-hover: #5a92f0;
  --accent-light: #1a3a6b;
  --accent-border: #2a5aaa;

  --border-color: #1e3a6e;
  --shadow: 0 2px 12px rgba(0,0,0,0.3);
  --shadow-card: 0 4px 20px rgba(0,0,0,0.4);

  --nav-bg: #0a1628;
  --nav-text: #93afd4;
  --nav-active: #ffffff;
  --nav-hover: rgba(255,255,255,0.1);
}

/* ---- Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  transition: background var(--transition), color var(--transition);
  line-height: 1.6;
}

a { color: var(--accent-primary); text-decoration: none; }
a:hover { color: var(--accent-hover); }

img { max-width: 100%; }

/* ---- Navbar ---- */
.navbar {
  background: var(--nav-bg);
  padding: 0 2rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-on-dark);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
}

.navbar-brand .logo-badge {
  background: var(--accent-primary);
  color: white;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.navbar-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
}

.navbar-nav a {
  color: var(--nav-text);
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
}

.navbar-nav a:hover,
.navbar-nav a.active {
  background: var(--nav-hover);
  color: var(--nav-active);
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Dark Mode Toggle */
.theme-toggle {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 50px;
  width: 52px;
  height: 28px;
  cursor: pointer;
  position: relative;
  transition: background var(--transition);
}

.theme-toggle::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: white;
  transition: transform var(--transition);
}

[data-theme="dark"] .theme-toggle::before {
  transform: translateX(24px);
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  pointer-events: none;
}
.theme-toggle .icon-sun { left: 7px; }
.theme-toggle .icon-moon { right: 7px; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 8px 20px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--transition);
  text-align: center;
}

.btn-primary {
  background: var(--accent-primary);
  color: white;
  border-color: var(--accent-primary);
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: white; }

.btn-outline {
  background: transparent;
  color: var(--accent-primary);
  border-color: var(--accent-primary);
}
.btn-outline:hover { background: var(--accent-primary); color: white; }

.btn-danger {
  background: #dc2626;
  color: white;
  border-color: #dc2626;
}
.btn-danger:hover { background: #b91c1c; border-color: #b91c1c; color: white; }

.btn-white {
  background: white;
  color: var(--accent-primary);
  border-color: white;
}
.btn-white:hover { background: var(--accent-light); }

.btn-sm { padding: 5px 14px; font-size: 0.82rem; }
.btn-lg { padding: 12px 28px; font-size: 1rem; }

/* ---- Cards ---- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: box-shadow var(--transition), border-color var(--transition);
}

.card:hover { box-shadow: var(--shadow-card); border-color: var(--accent-border); }

/* ---- Stat Cards ---- */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  text-align: center;
  box-shadow: var(--shadow);
  transition: all var(--transition);
}

.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-card); }

.stat-card .stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent-primary);
  line-height: 1;
}

.stat-card .stat-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ---- Section layout ---- */
.section {
  padding: 4rem 2rem;
}

.section-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.section-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.section-subtitle {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: 2rem;
}

.section-divider {
  height: 3px;
  width: 50px;
  background: var(--accent-primary);
  border-radius: 2px;
  margin-bottom: 1.5rem;
}

/* ---- Hero ---- */
.hero {
  background:
    linear-gradient(90deg, rgba(7, 18, 38, 0.88), rgba(11, 35, 72, 0.72)),
    url("../images/hero.png") center / cover no-repeat;
  color: white;
  padding: 5rem 2rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.18);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3rem;
  align-items: center;
}

.hero-photo-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
}

.hero-photo {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 4px solid rgba(255,255,255,0.3);
  overflow: hidden;
  background: rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.hero-photo img { width: 100%; height: 100%; object-fit: cover; }

.hero-photo-caption {
  font-size: 0.95rem;
  color: rgba(255,255,255,0.9);
  text-align: center;
  font-weight: 600;
}

.hero-photo-placeholder {
  font-size: 2.5rem;
  color: rgba(255,255,255,0.6);
}

.hero-content h1 {
  font-size: 2.4rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
  line-height: 1.2;
}

.hero-content .tagline {
  font-size: 1.1rem;
  opacity: 0.85;
  margin-bottom: 1.5rem;
  max-width: 600px;
  line-height: 1.7;
}

.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }

/* ---- Stats Row ---- */
.stats-row {
  padding: 2.5rem 2rem;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.stats-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
}

/* ---- Offer Cards (About page) ---- */
.offer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

.offer-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  box-shadow: var(--shadow);
  transition: all var(--transition);
}

.offer-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-card); border-color: var(--accent-primary); }

.offer-card .offer-icon {
  font-size: 2.2rem;
  margin-bottom: 0.75rem;
}

.offer-card h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.4rem;
}

.offer-card p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* ---- About Hero Banner ---- */
.about-banner {
  background: linear-gradient(135deg, #1a3a6b, #1a5fd6);
  padding: 3rem 2rem;
  color: white;
  text-align: center;
}

.about-banner h2 { font-size: 2rem; font-weight: 800; }
.about-banner p { opacity: 0.85; margin-top: 0.5rem; }

/* ---- Join Us Form ---- */
.join-form {
  max-width: 420px;
}

.form-group { margin-bottom: 1.25rem; }

.form-label {
  display: block;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

/* Premium Form Controls */
.form-control {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border-color);
  border-radius: 10px;
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: inherit;
  transition: all var(--transition);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.form-control:hover {
  border-color: var(--accent-primary);
  box-shadow: 0 4px 12px rgba(26, 95, 214, 0.12);
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 4px rgba(26, 95, 214, 0.15), 0 4px 12px rgba(26, 95, 214, 0.1);
}

.form-control:disabled {
  background: var(--bg-secondary);
  color: var(--text-muted);
  cursor: not-allowed;
  opacity: 0.6;
}

.form-control::placeholder {
  color: var(--text-muted);
  font-style: italic;
}

textarea.form-control {
  resize: vertical;
  font-size: 0.9rem;
  line-height: 1.5;
}

select.form-control {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%231a5fd6' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

select.form-control::-ms-expand {
  display: none;
}

/* Dark mode adjustments for select */
[data-theme="dark"] select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%233b7de8' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
}

/* Form sections and containers */
.form-section {
  background: var(--bg-card);
  padding: 2rem;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.form-section h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--accent-light);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.form-grid-full {
  grid-column: 1 / -1;
}

/* ---- Auth Pages ---- */
.auth-page {
  min-height: calc(100vh - 64px);
  background: linear-gradient(135deg, #1a3a6b 0%, #1a5fd6 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  gap: 3rem;
  flex-wrap: wrap;
}

.auth-card {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 2.5rem;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}

.auth-card h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.auth-card .auth-subtitle {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 1.75rem;
}

.auth-divider {
  text-align: center;
  color: rgba(255,255,255,0.5);
  font-size: 1.1rem;
  font-weight: 700;
  align-self: center;
}

/* ---- Portal Layout ---- */
.portal-layout {
  display: flex;
  min-height: calc(100vh - 64px);
}

.sidebar {
  width: 220px;
  background: var(--bg-sidebar);
  padding: 1.5rem 0;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  box-shadow: 2px 0 8px rgba(0,0,0,0.15);
}

.sidebar-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  margin: 0 auto 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: white;
  border: 2px solid rgba(255,255,255,0.2);
}

.sidebar-nav {
  flex: 1;
  list-style: none;
  padding: 0 0.75rem;
}

.sidebar-nav li a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--nav-text);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition);
  margin-bottom: 2px;
}

.sidebar-nav li a:hover,
.sidebar-nav li a.active {
  background: var(--nav-hover);
  color: var(--nav-active);
}

.sidebar-nav li a .nav-icon { font-size: 1rem; width: 20px; text-align: center; }

.sidebar-logout {
  padding: 0 0.75rem;
  margin-top: 0.5rem;
}

.sidebar-logout a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.6);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--transition);
}

.sidebar-logout a:hover { background: rgba(220,38,38,0.2); color: #fca5a5; border-color: rgba(220,38,38,0.3); }

.portal-content {
  flex: 1;
  padding: 2rem;
  background: var(--bg-primary);
  overflow-y: auto;
}

.portal-header {
  margin-bottom: 2rem;
}

.portal-header h1 {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-primary);
}

.portal-header p { color: var(--text-secondary); font-size: 0.9rem; }

/* ---- Plan Cards ---- */
.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
}

.plan-card {
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: 14px;
  padding: 1.75rem 1.5rem;
  text-align: center;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.plan-card.featured {
  border-color: var(--accent-primary);
}

.plan-card.featured::before {
  content: 'POPULAR';
  position: absolute;
  top: 12px;
  right: -22px;
  background: var(--accent-primary);
  color: white;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 3px 28px;
  transform: rotate(45deg);
  letter-spacing: 0.05em;
}

.plan-card h3 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.plan-card .plan-price {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--accent-primary);
  margin-bottom: 1rem;
}

.plan-card .plan-price span { font-size: 0.9rem; font-weight: 500; color: var(--text-muted); }

.plan-features {
  list-style: none;
  margin-bottom: 1.5rem;
  text-align: left;
}

.plan-features li {
  font-size: 0.85rem;
  color: var(--text-secondary);
  padding: 4px 0;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.plan-features li::before { content: '✓'; color: var(--accent-primary); font-weight: 700; }

/* ---- Contact Page ---- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

.contact-info-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
}

.contact-info-item .ci-icon {
  width: 40px;
  height: 40px;
  background: var(--accent-light);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-primary);
  font-size: 1.1rem;
  flex-shrink: 0;
}

/* ---- Leadership ---- */
.leadership-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.leadership-table th {
  background: var(--nav-bg);
  color: white;
  padding: 12px 16px;
  text-align: left;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.leadership-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.9rem;
  color: var(--text-primary);
}

.leadership-table tr:last-child td { border-bottom: none; }

.leadership-table tr:hover td { background: var(--bg-secondary); }

.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 0.8rem;
  font-weight: 800;
}

.rank-1 { background: #fbbf24; color: #78350f; }
.rank-2 { background: #94a3b8; color: #1e293b; }
.rank-3 { background: #cd7c4a; color: white; }
.rank-other { background: var(--accent-light); color: var(--accent-primary); }

/* ---- Admin table ---- */
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
}

.data-table th {
  background: var(--bg-secondary);
  padding: 10px 14px;
  text-align: left;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border-color);
}

.data-table td {
  padding: 10px 14px;
  font-size: 0.875rem;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-color);
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg-secondary); }

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 78px;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 800;
}

.badge-complete { background: #d1fae5; color: #065f46; }
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }

.payment-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.payment-actions form { margin: 0; }

/* ---- Admin UI Enhancements ---- */
.admin-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  background: linear-gradient(135deg, var(--accent-light), #ffffff);
}

.admin-eyebrow {
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-primary);
  font-weight: 800;
  margin-bottom: 0.35rem;
}

.admin-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.admin-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  background: rgba(26, 95, 214, 0.1);
  color: var(--accent-primary);
  font-size: 0.82rem;
  font-weight: 700;
}

.admin-pill.small { padding: 0.3rem 0.65rem; font-size: 0.75rem; }

.section-heading-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.form-panel { display: flex; flex-direction: column; gap: 1rem; }
.form-actions { display: flex; justify-content: flex-start; margin-top: 0.25rem; }

.admin-stat-stack {
  display: grid;
  gap: 0.85rem;
}

.admin-stat-card {
  padding: 1rem 1.1rem;
  border-radius: 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
}

.admin-stat-card strong {
  display: block;
  font-size: 1.2rem;
  color: var(--accent-primary);
}

.admin-stat-card span {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 1.25rem 0;
}

/* ---- Flash messages ---- */
.flash-messages { padding: 0.75rem 2rem 0; }

.flash {
  padding: 10px 16px;
  border-radius: 8px;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  font-weight: 500;
}

.flash-success { background: #d1fae5; color: #065f46; border-left: 4px solid #10b981; }
.flash-error   { background: #fee2e2; color: #991b1b; border-left: 4px solid #ef4444; }
.flash-danger  { background: #fee2e2; color: #991b1b; border-left: 4px solid #ef4444; }
.flash-warning { background: #fef3c7; color: #92400e; border-left: 4px solid #f59e0b; }
.flash-info    { background: var(--accent-light); color: var(--accent-primary); border-left: 4px solid var(--accent-primary); }

/* ---- Footer ---- */
.footer {
  background: var(--nav-bg);
  color: var(--nav-text);
  padding: 2rem;
  text-align: center;
  font-size: 0.85rem;
}

.footer a { color: var(--accent-border); }

/* ---- Utility ---- */
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.w-full { width: 100%; }
.text-muted { color: var(--text-muted); font-size: 0.875rem; }
.text-accent { color: var(--accent-primary); }
.font-bold { font-weight: 700; }

/* =============================================
   MOBILE RESPONSIVENESS
   ============================================= */

/* ---- Hamburger Button (hidden on desktop) ---- */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: background var(--transition);
}

.hamburger:hover { background: rgba(255,255,255,0.1); }

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: white;
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Animated X when open */
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---- Mobile Nav Drawer ---- */
.mobile-nav {
  display: none;
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  background: var(--nav-bg);
  z-index: 999;
  padding: 1rem;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  border-top: 1px solid rgba(255,255,255,0.08);
  transform: translateY(-10px);
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.mobile-nav.open {
  display: block;
  transform: translateY(0);
  opacity: 1;
}

.mobile-nav a {
  display: block;
  padding: 12px 14px;
  color: var(--nav-text);
  font-size: 1rem;
  font-weight: 500;
  border-radius: 8px;
  transition: background var(--transition), color var(--transition);
  margin-bottom: 2px;
}

.mobile-nav a:hover,
.mobile-nav a.active {
  background: var(--nav-hover);
  color: white;
}

.mobile-nav .mobile-nav-divider {
  height: 1px;
  background: rgba(255,255,255,0.1);
  margin: 0.75rem 0;
}

.mobile-nav .mobile-nav-actions {
  display: flex;
  gap: 0.75rem;
  padding-top: 0.25rem;
}

/* Overlay behind open mobile nav */
.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  top: 64px;
  background: rgba(0,0,0,0.4);
  z-index: 998;
}
.nav-overlay.open { display: block; }

/* ---- Mobile Sidebar Drawer (portal pages) ---- */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1001;
}
.sidebar-overlay.open { display: block; }

.sidebar-toggle {
  display: none;
  align-items: center;
  gap: 0.5rem;
  background: var(--accent-primary);
  color: white;
  border: none;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 1.25rem;
}

/* ========================================
   BREAKPOINT: Tablet  ≤ 1024px
   ======================================== */
@media (max-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .plan-grid { grid-template-columns: repeat(2, 1fr); }
  .offer-grid { grid-template-columns: repeat(2, 1fr); }

  .sidebar {
    width: 200px;
  }
}

/* ========================================
   BREAKPOINT: Mobile  ≤ 768px
   ======================================== */
@media (max-width: 768px) {

  /* --- Navbar --- */
  .navbar { padding: 0 1rem; }

  .navbar-brand span.logo-badge { display: inline; }
  /* Truncate brand text on very small screens */
  .navbar-brand { font-size: 0.95rem; }

  .navbar-nav  { display: none; }   /* replaced by mobile-nav drawer */
  .navbar-actions .btn { display: none; } /* moved into drawer */

  .hamburger { display: flex; }

  /* --- Hero --- */
  .hero { padding: 2.5rem 1.25rem; }
  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 2rem;
  }
  .hero-photo-wrapper { margin: 0 auto; }
  .hero-photo { margin: 0 auto; }
  .hero-photo-caption { font-size: 0.9rem; }
  .hero-content h1 { font-size: 1.6rem; }
  .hero-content .tagline { font-size: 0.9rem; line-height: 1.5; }
  .hero-actions { justify-content: center; flex-direction: column; align-items: center; gap: 0.75rem; }
  .hero-actions .btn { width: 100%; max-width: 280px; justify-content: center; }

  /* --- Stats row --- */
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
  .stats-row { padding: 1.75rem 1rem; }

  /* --- Section padding --- */
  .section { padding: 2.5rem 1.25rem; }

  /* --- Grids collapse to 1 col --- */
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .admin-hero { flex-direction: column; align-items: flex-start; }
  .section-heading-row { flex-direction: column; align-items: flex-start; }

  /* --- Plan cards stack --- */
  .plan-grid { grid-template-columns: 1fr; }
  .plan-card.featured::before { display: none; } /* hide ribbon on mobile */

  /* --- Offer cards 2-col on mobile --- */
  .offer-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }

  /* --- Contact --- */
  .contact-grid { grid-template-columns: 1fr; gap: 2rem; }

  /* --- Auth page: stack cards vertically --- */
  .auth-page {
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem 1rem;
  }
  .auth-card { max-width: 100%; padding: 1.75rem 1.25rem; }
  .auth-divider { display: none; }

  /* --- Portal layout: hide sidebar, show toggle button --- */
  .portal-layout { flex-direction: column; }

  .sidebar {
    position: fixed;
    top: 64px;
    left: -240px;
    width: 240px;
    height: calc(100vh - 64px);
    z-index: 1002;
    transition: left 0.3s ease;
    overflow-y: auto;
  }

  .sidebar.open { left: 0; }

  .sidebar-toggle { display: flex; }

  .portal-content { padding: 1.25rem 1rem; }
  .portal-header h1 { font-size: 1.3rem; }

  /* --- Tables: scroll horizontally --- */
  .data-table, .leadership-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }

  /* --- Leadership filter buttons wrap --- */
  .leadership-filters { flex-wrap: wrap; }

  /* --- Flash messages --- */
  .flash-messages { padding: 0.5rem 1rem 0; }

  /* --- Footer --- */
  .footer { padding: 1.5rem 1rem; font-size: 0.8rem; }
}

/* ========================================
   BREAKPOINT: Small mobile  ≤ 480px
   ======================================== */
@media (max-width: 480px) {
  .navbar-brand { font-size: 0.85rem; gap: 0.5rem; }
  .hero { padding: 2rem 1rem; }
  .hero-inner { gap: 1.5rem; }
  .hero-photo { width: 100px; height: 100px; border-width: 3px; }
  .hero-content h1 { font-size: 1.4rem; }
  .hero-content .tagline { font-size: 0.85rem; }
  .hero-actions .btn { font-size: 0.9rem; padding: 10px 16px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-card .stat-value { font-size: 1.6rem; }
  .offer-grid { grid-template-columns: 1fr; }
  .section-title { font-size: 1.4rem; }
  .about-banner h2 { font-size: 1.5rem; }

  /* Auth cards full width */
  .auth-card { padding: 1.5rem 1rem; }

  /* Admin stat grid stacks */
  .grid-3 { grid-template-columns: 1fr; }
  .admin-hero { flex-direction: column; align-items: flex-start; }
  .section-heading-row { flex-direction: column; align-items: flex-start; }
}
