@import url('base.css');
@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,600;9..144,700&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@500;600&display=swap');

/* ============================================================
   AUTH PAGES (login / register)
   ============================================================ */
.auth-wrap {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 1fr;
}
@media (min-width: 900px) {
  .auth-wrap { grid-template-columns: 0.85fr 1.15fr; }
}

.auth-brand {
  background: linear-gradient(160deg, var(--navy-950), var(--navy-800));
  color: #fff;
  padding: 40px 32px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
.auth-brand::after {
  content: "";
  position: absolute;
  right: -80px; bottom: -80px;
  width: 260px; height: 260px;
  border-radius: 50%;
  border: 1px solid rgba(217, 164, 4, 0.35);
}
.auth-brand::before {
  content: "";
  position: absolute;
  right: -30px; bottom: -30px;
  width: 160px; height: 160px;
  border-radius: 50%;
  border: 1px solid rgba(217, 164, 4, 0.25);
}
.auth-logo { display: flex; align-items: center; gap: 12px; position: relative; z-index: 1; }
.auth-logo .seal { flex-shrink: 0; }
.auth-logo-text { line-height: 1.15; }
.auth-logo-text strong { font-family: 'Fraunces', serif; font-size: 1.25rem; display: block; }
.auth-logo-text span { font-size: 0.72rem; letter-spacing: 0.14em; opacity: 0.75; text-transform: uppercase; }

.auth-brand h1 {
  color: #fff;
  font-size: clamp(1.6rem, 4vw, 2.3rem);
  margin-top: 32px;
  max-width: 20ch;
  position: relative; z-index: 1;
}
.auth-brand p {
  opacity: 0.82;
  max-width: 42ch;
  position: relative; z-index: 1;
}
.auth-brand .foot-note {
  font-size: 0.78rem;
  opacity: 0.6;
  position: relative; z-index: 1;
}

.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px 56px;
}
.auth-box { width: 100%; max-width: 480px; }
.auth-box h2 { font-size: 1.6rem; }
.auth-box .sub { color: var(--muted); margin-bottom: 28px; }
.auth-switch { text-align: center; margin-top: 20px; font-size: 0.92rem; color: var(--muted); }
.auth-switch a { font-weight: 700; }

/* ============================================================
   APP SHELL — off-canvas sidebar (mobile-first)
   ============================================================ */
.app-shell { min-height: 100dvh; }

.topbar {
  position: sticky; top: 0; z-index: 40;
  height: 64px;
  background: var(--navy-950);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 14px;
}
.hamburger {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  background: transparent; border: none; border-radius: var(--radius-sm);
  cursor: pointer; color: #fff;
}
.hamburger:hover { background: rgba(255,255,255,0.08); }
.hamburger svg { width: 24px; height: 24px; }
.topbar-logo { display: flex; align-items: center; gap: 10px; }
.topbar-logo strong { font-family: 'Fraunces', serif; font-size: 1.05rem; }
.topbar-spacer { flex: 1; }
.topbar-user { display: flex; align-items: center; gap: 10px; font-size: 0.85rem; }
.avatar-badge {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--gold-500); color: var(--navy-950);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-family: 'Fraunces', serif; flex-shrink: 0;
}

.sidebar-overlay {
  position: fixed; inset: 0; background: rgba(13, 32, 56, 0.55);
  z-index: 45; opacity: 0; pointer-events: none; transition: opacity 0.25s ease;
}
.sidebar-overlay.show { opacity: 1; pointer-events: auto; }

.sidebar {
  position: fixed; top: 0; bottom: 0; left: 0;
  width: min(84vw, var(--sidebar-w));
  background: var(--navy-900);
  color: #fff;
  z-index: 50;
  transform: translateX(-100%);
  transition: transform 0.28s cubic-bezier(.4,0,.2,1);
  display: flex; flex-direction: column;
  overflow-y: auto;
}
.sidebar.open { transform: translateX(0); }

.sidebar-head {
  padding: 22px 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.sidebar-head .brand-row { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.sidebar-head .brand-row strong { font-family: 'Fraunces', serif; font-size: 1.1rem; }
.sidebar-close {
  margin-left: auto; background: transparent; border: none; color: #fff;
  width: 36px; height: 36px; border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.sidebar-close:hover { background: rgba(255,255,255,0.1); }

/* Signature: membership-card style identity block */
.id-card {
  background: linear-gradient(135deg, var(--navy-800), var(--navy-950));
  border: 1px solid rgba(217, 164, 4, 0.4);
  border-radius: var(--radius-md);
  padding: 16px;
  position: relative;
}
.id-card::before {
  content: "MEMBER";
  position: absolute; top: 10px; right: 12px;
  font-size: 0.6rem; letter-spacing: 0.15em;
  color: var(--gold-400); font-weight: 700;
}
.id-card-top { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.id-card .avatar-badge { width: 46px; height: 46px; font-size: 1.1rem; }
.id-card-name { font-weight: 700; font-size: 0.95rem; line-height: 1.25; }
.id-card-dept { font-size: 0.75rem; opacity: 0.7; }
.id-card-code {
  font-size: 0.78rem; letter-spacing: 0.04em;
  color: var(--gold-400); padding-top: 8px;
  border-top: 1px dashed rgba(255,255,255,0.2);
}
.id-card-ward { font-size: 0.72rem; opacity: 0.65; margin-top: 4px; }

.sidebar-nav { padding: 14px 12px; flex: 1; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 13px;
  padding: 13px 14px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.82);
  font-weight: 500; font-size: 0.94rem;
  min-height: 44px;
  margin-bottom: 4px;
  transition: background 0.15s ease, color 0.15s ease;
}
.sidebar-nav a svg { width: 19px; height: 19px; flex-shrink: 0; opacity: 0.85; }
.sidebar-nav a:hover { background: rgba(255,255,255,0.07); color: #fff; }
.sidebar-nav a.active { background: var(--gold-500); color: var(--navy-950); font-weight: 700; }
.sidebar-nav a.active svg { opacity: 1; }
.sidebar-nav a.logout { color: #f2b8ad; margin-top: 10px; border-top: 1px solid rgba(255,255,255,0.1); padding-top: 16px; }

.sidebar-foot { padding: 16px 20px; font-size: 0.72rem; opacity: 0.5; }

@media (min-width: 1024px) {
  .hamburger.desktop-hide { display: none; }
  .sidebar { transform: translateX(0); position: sticky; height: 100dvh; }
  .sidebar-overlay { display: none; }
  .sidebar-close { display: none; }
  .app-layout { display: grid; grid-template-columns: var(--sidebar-w) 1fr; }
  .topbar { display: none; }
  .main-topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 32px; background: var(--card); border-bottom: 1px solid var(--line);
  }
}

.main-topbar { display: none; }
@media (min-width: 1024px) { .main-topbar { display: flex; } }

.main-content { padding: 20px 16px 60px; max-width: 1180px; margin: 0 auto; width: 100%; }
@media (min-width: 1024px) { .main-content { padding: 28px 32px 60px; } }

.page-head { margin-bottom: 22px; }
.page-head .eyebrow {
  text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.72rem;
  color: var(--gold-600); font-weight: 700;
}

/* ============================================================
   DASHBOARD GRID + WIDGET CARDS
   ============================================================ */
.dash-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}
@media (min-width: 900px) {
  .dash-grid { grid-template-columns: 2fr 1fr; align-items: start; }
}

.quick-links {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px;
  margin-bottom: 20px;
}
@media (min-width: 640px) { .quick-links { grid-template-columns: repeat(4, 1fr); } }
.quick-link {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-md);
  padding: 16px 14px; text-align: center; box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.quick-link:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.quick-link .qicon {
  width: 42px; height: 42px; border-radius: 50%; margin: 0 auto 10px;
  background: var(--navy-100); display: flex; align-items: center; justify-content: center;
}
.quick-link .qicon svg { width: 21px; height: 21px; color: var(--navy-800); }
.quick-link span { font-size: 0.82rem; font-weight: 600; color: var(--navy-900); }

/* Signature: cork-board notice board with pinned notices */
.noticeboard {
  background: #f6ede0;
  background-image:
    linear-gradient(rgba(0,0,0,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,0,0,0.02) 1px, transparent 1px);
  background-size: 22px 22px;
  border: 10px solid #7a5230;
  border-radius: var(--radius-md);
  padding: 22px;
  box-shadow: var(--shadow-md), inset 0 0 40px rgba(90, 60, 30, 0.18);
}
.noticeboard-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.noticeboard-head h2 { color: #4a3220; margin: 0; }
.noticeboard-head .badge { position: relative; top: -2px; }
.notice-list { display: grid; gap: 16px; }
@media (min-width: 640px) { .notice-list { grid-template-columns: 1fr 1fr; } }
.notice-note {
  background: #fffdf4;
  border-radius: 3px;
  padding: 16px 16px 14px;
  box-shadow: 0 6px 14px rgba(0,0,0,0.15);
  position: relative;
  transform: rotate(var(--tilt, -1deg));
}
.notice-note:nth-child(even) { --tilt: 1.2deg; }
.notice-note:nth-child(3n) { --tilt: -0.6deg; }
.notice-note::before {
  content: "";
  position: absolute; top: -8px; left: 50%; transform: translateX(-50%);
  width: 16px; height: 16px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ff8a7a, #c0392b);
  box-shadow: 0 3px 4px rgba(0,0,0,0.35);
}
.notice-note.pinned::before {
  background: radial-gradient(circle at 35% 30%, #fbe27a, var(--gold-500));
}
.notice-note h3 { font-size: 1rem; margin-bottom: 6px; color: #3a2a18; }
.notice-note p { font-size: 0.88rem; color: #5a4a38; margin: 0 0 10px; white-space: pre-line; }
.notice-note time { font-size: 0.72rem; color: #8a7660; font-weight: 600; }
.noticeboard .empty-state { color: #7a6650; }

/* ============================================================
   OFFICIALS
   ============================================================ */
.officials-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
  gap: 18px;
}
.official-card {
  background: var(--card); border-radius: var(--radius-md); overflow: hidden;
  border: 1px solid var(--line); box-shadow: var(--shadow-sm); text-align: center;
}
.official-photo {
  width: 100%; aspect-ratio: 1/1; object-fit: cover; background: var(--navy-100);
}
.official-photo.placeholder { display: flex; align-items: center; justify-content: center; }
.official-photo.placeholder svg { width: 40%; height: 40%; color: var(--navy-700); opacity: 0.5; }
.official-info { padding: 14px; }
.official-info h3 { font-size: 0.98rem; margin-bottom: 3px; }
.official-info .pos { color: var(--gold-600); font-weight: 700; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; }

/* ============================================================
   GALLERY (lightbox)
   ============================================================ */
.gallery-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.gallery-filters button {
  background: var(--card); border: 1.5px solid var(--line); border-radius: 999px;
  padding: 8px 16px; font-size: 0.82rem; font-weight: 600; cursor: pointer; color: var(--navy-800);
}
.gallery-filters button.active { background: var(--navy-900); color: #fff; border-color: var(--navy-900); }
.gallery-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 160px), 1fr));
  gap: 10px;
}
.gallery-item {
  border-radius: var(--radius-sm); overflow: hidden; cursor: pointer;
  aspect-ratio: 1/1; position: relative; border: 1px solid var(--line);
}
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.25s ease; }
.gallery-item:hover img { transform: scale(1.06); }
.gallery-item .cap {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 8px 10px;
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
  color: #fff; font-size: 0.72rem; font-weight: 600;
}
.lightbox {
  position: fixed; inset: 0; background: rgba(10, 18, 28, 0.92); z-index: 100;
  display: none; align-items: center; justify-content: center; padding: 24px;
}
.lightbox.show { display: flex; }
.lightbox img { max-width: 100%; max-height: 82vh; border-radius: var(--radius-sm); }
.lightbox-cap { color: #fff; text-align: center; margin-top: 12px; font-size: 0.9rem; }
.lightbox-close {
  position: absolute; top: 18px; right: 20px; width: 44px; height: 44px;
  background: rgba(255,255,255,0.12); border: none; border-radius: 50%; color: #fff; cursor: pointer;
}
.lightbox-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 48px; height: 48px; border-radius: 50%; background: rgba(255,255,255,0.12);
  border: none; color: #fff; cursor: pointer; font-size: 1.3rem;
}
.lightbox-prev { left: 16px; } .lightbox-next { right: 16px; }

/* ============================================================
   E-VOTING
   ============================================================ */
.election-banner {
  background: linear-gradient(135deg, var(--navy-900), var(--navy-700));
  color: #fff; border-radius: var(--radius-md); padding: 22px; margin-bottom: 22px;
}
.election-banner h2 { color: #fff; }
.election-banner .meta { font-size: 0.85rem; opacity: 0.8; }
.candidates-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
  gap: 16px;
}
.candidate-card {
  background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius-md);
  padding: 18px; text-align: center; transition: border-color 0.15s ease;
}
.candidate-card.voted-for { border-color: var(--gold-500); box-shadow: 0 0 0 3px rgba(217,164,4,0.15); }
.candidate-photo {
  width: 84px; height: 84px; border-radius: 50%; object-fit: cover; margin: 0 auto 12px;
  background: var(--navy-100); border: 3px solid var(--navy-100);
}
.candidate-card h3 { font-size: 1rem; margin-bottom: 4px; }
.candidate-card .manifesto { font-size: 0.82rem; color: var(--muted); margin-bottom: 14px; min-height: 40px; }
.vote-bar-wrap { background: var(--navy-100); border-radius: 999px; height: 10px; overflow: hidden; margin: 10px 0 6px; }
.vote-bar { height: 100%; background: var(--gold-500); border-radius: 999px; }
.vote-pct { font-size: 0.78rem; color: var(--muted); font-weight: 700; }

/* ============================================================
   LOCAL CHAPTERS / PROFILE
   ============================================================ */
.chapters-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 720px) { .chapters-grid { grid-template-columns: 1fr 1fr; } }
.chapter-card { padding: 18px; }
.chapter-card h3 { font-size: 1.05rem; margin-bottom: 6px; }
.chapter-card .loc { color: var(--gold-600); font-weight: 700; font-size: 0.78rem; text-transform: uppercase; margin-bottom: 10px; display: block; }
.chapter-card p { color: var(--muted); font-size: 0.9rem; margin: 6px 0; }

.profile-card { padding: 26px; }
.profile-top { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.profile-avatar {
  width: 74px; height: 74px; border-radius: 50%; background: var(--navy-900); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 1.6rem;
  font-family: 'Fraunces', serif; font-weight: 700; flex-shrink: 0; object-fit: cover;
}
.profile-fields { display: grid; grid-template-columns: 1fr; gap: 16px 24px; }
@media (min-width: 640px) { .profile-fields { grid-template-columns: 1fr 1fr; } }
.pf-item .lab { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 700; margin-bottom: 3px; }
.pf-item .val { font-size: 0.98rem; font-weight: 500; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 8px; }
