@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  --bg: #f8fafc;
  --card: #ffffff;
  --text: #1e293b;
  --muted: #64748b;
  --line: #e2e8f0;

  --primary: #2563eb;
  --primary2: #1d4ed8;
  --primarySoft: rgba(37, 99, 235, .10);

  --success: #16a34a;
  --warning: #f59e0b;
  --danger: #ef4444;

  --radius: 16px;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow2: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

  /* Legacy shadow for compatibility */
  --shadow-lg: 0 14px 30px rgba(15, 23, 42, .08);
}

* {
  box-sizing: border-box
}

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  scroll-behavior: smooth;
}

html {
  scroll-behavior: smooth;
}

a {
  color: inherit
}

.container {
  width: min(1160px, 100%);
  margin: 0 auto;
  padding: 0 18px;
}

/* TOP NAV */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
  background: rgba(246, 248, 252, .75);
  border-bottom: 1px solid rgba(226, 232, 240, .7);
}

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
  min-height: 70px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 200px;
  flex-shrink: 0;
}

/* ensure the brand text can shrink and won't push into the nav */
.brand>div {
  min-width: 0;
  /* overflow: hidden; Removed to allow wrap */
  display: flex;
  flex-direction: column;
}

/* Allow text wrap on mobile */
@media (max-width: 768px) {
  .responsive-brand-text {
    display: flex !important;
    flex-direction: column;
    justify-content: center;
  }

  .responsive-brand-text .t1 {
    font-size: 13px;
    /* Smaller font on mobile */
    line-height: 1.2;
    white-space: nowrap;
  }

  .responsive-brand-text .t2,
  .responsive-brand-text .t3 {
    display: none !important;
    /* Hide subtitles to save space */
  }
}


.brand img {
  width: 46px;
  height: 46px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  object-fit: cover;
}

.brand .t1 {
  font-weight: 950;
  letter-spacing: .14em;
  color: var(--primary);
  font-size: 12px;
  text-transform: uppercase;
}

.brand .t2 {
  font-weight: 950;
  font-size: 15px;
  margin-top: 2px;
  letter-spacing: -0.01em;
}

.brand .t3 {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  flex: 1;
  min-width: 0;
  padding-right: 18px;
  /* give breathing room before status / right controls */
}

/* Centered variant for the main menu (used on beranda) */
.nav.nav-center {
  justify-content: center !important;
  padding-right: 0;
  padding-left: 0;
}

/* On very narrow screens, keep the nav left-aligned so the hamburger and brand remain usable */
@media (max-width: 640px) {
  .nav.nav-center {
    justify-content: flex-start !important;
  }
}

.nav>a,
.drop>button {
  border: 1px solid transparent;
  background: transparent;
  padding: 10px 12px;
  border-radius: 14px;
  font-weight: 900;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  user-select: none;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.nav>a:hover,
.drop>button:hover {
  background: rgba(37, 99, 235, .06);
  border-color: rgba(37, 99, 235, .18);
  transform: translateY(-1px);
}

.nav>a.active {
  background: var(--primarySoft);
  border-color: rgba(37, 99, 235, .25);
  color: var(--primary2);
}

.drop {
  position: relative
}

.drop-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 240px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow2);
  padding: 8px;
  display: none;
}

.drop-menu a {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 10px;
  border-radius: 14px;
  text-decoration: none;
  border: 1px solid transparent;
}

.drop-menu a:hover {
  background: rgba(37, 99, 235, .06);
  border-color: rgba(37, 99, 235, .18);
}

.drop-menu b {
  display: block;
  font-weight: 950;
  font-size: 13px
}

.drop-menu small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px
}

.drop:hover .drop-menu {
  display: block
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}

.btn {
  border: none;
  border-radius: 14px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 950;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 12px 22px rgba(15, 23, 42, .08);
  text-decoration: none;
  white-space: nowrap;
}

.btn.primary {
  background: var(--primary);
  color: #fff;
}

.btn.primary:hover {
  background: var(--primary2);
}

.btn.ghost {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--text);
  box-shadow: none;
}

.btn.ghost:hover {
  border-color: rgba(37, 99, 235, .25);
  background: rgba(37, 99, 235, .03);
}

.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.icon-btn:hover {
  border-color: rgba(37, 99, 235, .25);
  background: rgba(37, 99, 235, .03);
}

/* Notification bell styles */
#btnNotif {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: transform .18s ease, box-shadow .18s ease;
}
#btnNotif:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(37,99,235,0.12); }

#btnNotif .notif-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 10px;
  height: 10px;
  background: var(--danger);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(239,68,68,0.12);
}

@keyframes notifPulse {
  0% { transform: scale(1); opacity: 1; }
  70% { transform: scale(1.6); opacity: .4; }
  100% { transform: scale(2.4); opacity: 0; }
}

#btnNotif .notif-pulse {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--danger);
  opacity: 0.9;
  animation: notifPulse 900ms ease-out forwards;
  pointer-events: none;
}

/* Bell bounce to add a tiny attention motion */
@keyframes notifBounce {
  0% { transform: translateY(0) scale(1); }
  25% { transform: translateY(-6px) scale(1.03); }
  50% { transform: translateY(0) scale(0.99); }
  70% { transform: translateY(-3px) scale(1.01); }
  100% { transform: translateY(0) scale(1); }
}

#btnNotif.notif-bounce {
  animation: notifBounce 700ms cubic-bezier(.2,.9,.3,1);
}

/* Admin note reveal animation in pendaftaran */
#adminNoteWrap { transition: all .28s ease; transform-origin: top; }
#adminNoteWrap.show { display:block; transform: translateY(0); opacity: 1; animation: slideFadeIn .36s cubic-bezier(.2,.9,.3,1); }
#adminNoteWrap.hidden { display:none; transform: translateY(-6px); opacity: 0; }

@keyframes slideFadeIn {
  0% { transform: translateY(-8px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  #btnNotif.notif-bounce,
  #btnNotif .notif-pulse,
  #adminNoteWrap.show {
    animation: none !important;
    transition: none !important;
  }
}

/* HERO */
.hero {
  padding: 18px 0 18px;
  position: relative;
  /* Use photo if available, otherwise fall back to logo */
  background-image: url('/assets/images/hero-bg.jpg'), url('/assets/logo-pkbm.png');
  /* Photo uses fixed attachment for subtle parallax on desktop; logo fallback scrolls normally */
  background-attachment: fixed, scroll;
  background-position: center center, center center;
  background-repeat: no-repeat, no-repeat;
  background-size: cover, 30%;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  /* Darker gradient for text readability */
  background: linear-gradient(135deg, rgba(8, 14, 28, 0.85) 0%, rgba(29, 78, 216, 0.75) 100%);
  pointer-events: none;
  z-index: 1;
}

.hero-card {
  border-radius: 22px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow2);
  /* Make card semi-transparent so background image/logo shows through */
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(6px);
  overflow: hidden;
  position: relative;
  z-index: 2;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.35fr 0.65fr;
  gap: 0;
}

.slider {
  position: relative;
  padding: 48px 40px 40px;
  background: #ffffff;
  overflow: hidden;
  border-radius: 0 24px 24px 0;
}

.slide {
  display: none;
  flex-direction: column;
  justify-content: center;
  animation: fade .4s ease-out;
  max-width: 720px;
  position: relative;
  min-height: 380px;
  padding: 24px 0;
  text-align: left;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(245, 247, 250, 0.9) 100%);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
  border-radius: 12px;
}

.slide.active {
  display: flex;
}

@keyframes fade {
  from {
    opacity: 0;
    transform: translateY(8px)
  }

  to {
    opacity: 1;
    transform: translateY(0)
  }
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(37, 99, 235, .06);
  border: none;
  color: var(--primary);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin-top: -20px;
  margin-bottom: 0;
}

.hero h1 {
  margin: 0 0 18px 0;
  font-size: 36px;
  line-height: 1.3;
  letter-spacing: -0.02em;
  font-weight: 700;
  color: var(--text);
  max-width: 20ch;
}

.hero p {
  margin: 0 0 28px 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
  font-weight: 400;
  max-width: 60ch;
}

.slide h1 {
  text-align: left;
  width: 100%;
  max-width: none !important;
}

.slide .kicker {
  text-align: left;
}

.slide .hero-actions {
  justify-content: flex-start;
}

.dots {
  display: flex;
  gap: 6px;
  margin-top: 32px;
  align-items: center;
  justify-content: flex-start;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(37, 99, 235, .2);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.dot:hover {
  background: rgba(37, 99, 235, .4);
}

.dot.active {
  width: 24px;
  height: 6px;
  border-radius: 999px;
  background: var(--primary);
}

.slider-nav {
  position: absolute;
  right: 24px;
  top: 24px;
  display: flex;
  gap: 6px;
  z-index: 10;
}

.nav-circle {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .05);
}

.nav-circle:hover {
  border-color: var(--primary);
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, .2);
}

.nav-circle:hover svg {
  stroke: #ffffff;
}

.poster {
  border-left: 1px solid var(--line);
  background: #f8fafc;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  justify-content: center;
}

.poster .frame {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.poster img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.poster small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

/* SECTIONS */
section.block {
  margin-top: 14px;
}

.grid3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.grid3 .card {
  display: flex;
  flex-direction: column;
}

.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.grid2 .card {
  display: flex;
  flex-direction: column;
}

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .04);
  padding: 24px;
  transition: all 0.2s ease;
}

.card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, .06);
  border-color: rgba(37, 99, 235, .15);
}

.card h3 {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.08em;
  font-weight: 700;
  text-transform: uppercase;
}

.card .head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.tag {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  border: none;
  background: rgba(37, 99, 235, .08);
  color: var(--primary);
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.card p {
  margin: 0 0 24px 0;
  color: var(--text);
  font-size: 15px;
  line-height: 1.7;
  font-weight: 400;
}

.card p b,
.card p strong {
  color: var(--text);
  font-weight: 600;
}

.feature {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px 0;
  border-bottom: 1px solid rgba(226, 232, 240, .5);
}

.feature:first-of-type {
  padding-top: 0;
}

.feature:last-of-type {
  border-bottom: none;
  padding-bottom: 0;
}

/* Override inline margin-top untuk feature */
.feature[style*="margin-top"] {
  margin-top: 0 !important;
}

.ico {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(37, 99, 235, .05);
  border: none;
  color: var(--primary);
  flex: 0 0 auto;
  transition: all 0.2s ease;
}

.feature:hover .ico {
  background: rgba(37, 99, 235, .1);
}

.feature b {
  display: block;
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
  margin-bottom: 4px;
}

.feature small {
  display: block;
  color: var(--muted);
  margin-top: 0;
  line-height: 1.6;
  font-size: 14px;
}

.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.step {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
}

.step .num {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 950;
  color: var(--primary2);
}

.step b {
  display: block;
  margin-top: 10px;
  font-weight: 950
}

.step small {
  display: block;
  color: var(--muted);
  margin-top: 6px;
  line-height: 1.6
}

.list {
  margin: 0;
  padding-left: 0;
  color: var(--text);
  line-height: 1.8;
  font-size: 14px;
  list-style: none;
}

.list li {
  margin: 0;
  padding: 10px 0 10px 24px;
  position: relative;
  border-bottom: 1px solid rgba(226, 232, 240, .3);
}

.list li:last-child {
  border-bottom: none;
}

.list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 16px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  opacity: 0.6;
}

/* Styling untuk h4 di dalam card (SYARAT PENDAFTARAN) */
.card h4 {
  margin: 0 0 16px 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

/* Styling untuk button di dalam card */
.card .btn {
  margin-top: 24px;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  transition: all 0.2s ease;
}

/* Section syarat pendaftaran */
.card>div[style*="margin-top:16px"] {
  margin-top: 24px !important;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.faq-item {
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
}

.faq-q {
  width: 100%;
  text-align: left;
  padding: 12px 12px;
  background: #fff;
  border: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-weight: 950;
}

.faq-a {
  padding: 0 12px 12px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
  display: none;
}

.faq-item.open .faq-a {
  display: block
}

.chev {
  transition: transform .18s ease
}

.faq-item.open .chev {
  transform: rotate(180deg)
}

/* FOOTER */
footer {
  margin-top: 18px;
  padding: 16px 0 26px;
  color: var(--muted);
  font-size: 13px;
}

.foot {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding-top: 14px;
  flex-wrap: wrap;
}

/* HERO TITLE & STATS RESPONSIVE HELPERS */
/* HERO TITLE & STATS RESPONSIVE HELPERS */
.hero .hero-title {
  font-size: 48px !important;
  font-weight: 800 !important;
  line-height: 1.2 !important;
  margin: 0 auto 20px !important;
  text-shadow: 0 4px 30px rgba(0, 0, 0, 0.6) !important;
  letter-spacing: -1px !important;
  text-transform: none !important;
  color: white !important;
  max-width: 800px !important;
}

.about-card {
  padding: 40px;
}

.stats-container {
  display: flex;
  gap: 40px;
  margin-bottom: 30px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 30px;
}

/* RESPONSIVE */
@media (max-width: 980px) {
  .hero-grid {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .poster {
    border-left: none;
    border-top: 1px solid var(--line)
  }

  .steps {
    grid-template-columns: repeat(2, 1fr)
  }

  .grid3 {
    grid-template-columns: 1fr
  }

  .grid2 {
    grid-template-columns: 1fr
  }

  .brand {
    min-width: unset
  }
}

@media (max-width: 768px) {
  .nav-wrap {
    flex-wrap: wrap;
    min-height: auto;
    gap: 8px;
  }

  .brand {
    min-width: auto;
    flex-shrink: 1;
  }

  /* .brand .t3 {
    display: none; // Hapus ini agar tampil
  } */

  /* Mobile Auth Buttons Style */
  /* Mobile Auth Buttons Style */
  .mobile-nav-links .btn-mobile {
    display: block !important;
    text-align: center !important;
    background: var(--primary) !important;
    color: white !important;
    /* Force white text */
    padding: 12px !important;
    border-radius: 12px !important;
    margin-top: 10px !important;
    font-weight: 700 !important;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2) !important;
    text-decoration: none !important;
  }

  .mobile-nav-links .btn-mobile.outline {
    background: white !important;
    color: var(--primary) !important;
    border: 1px solid var(--primary) !important;
    box-shadow: none !important;
  }

  .nav {
    order: 3;
    width: 100%;
    justify-content: center;
    margin-top: 8px;
  }

  .nav-right {
    order: 2;
    margin-left: 0;
    gap: 4px;
  }

  .auth-buttons {
    gap: 4px;
  }

  .user-buttons {
    gap: 6px;
  }

  .user-greeting {
    display: none;
  }

  .btn.outline {
    padding: 6px 10px;
    font-size: 12px;
  }
}

@media (max-width: 768px) {
  .slider {
    padding: 36px 24px 32px;
    border-radius: 0 16px 16px 0;
  }

  .slide {
    min-height: 320px;
    padding: 20px 0;
    text-align: left;
  }

  .slide h1 {
    text-align: left;
  }

  .slide .kicker {
    text-align: left;
  }

  .slide .hero-actions {
    justify-content: flex-start;
  }

  .hero h1 {
    font-size: 28px;
    max-width: none;
    margin-bottom: 16px;
  }

  .hero p {
    font-size: 15px;
    max-width: none;
    margin-bottom: 24px;
  }

  .hero-actions {
    gap: 8px;
    margin-bottom: 12px;
  }

  .slider-nav {
    right: 16px;
    top: 16px;
  }

  .nav-circle {
    width: 32px;
    height: 32px;
  }

  .dots {
    margin-top: 24px;
  }
}

@media (max-width: 560px) {
  .nav {
    display: none
  }

  .hero h1 {
    font-size: 24px
  }

  .steps {
    grid-template-columns: 1fr
  }
}

/* Auth Buttons */
.auth-buttons {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}

.user-buttons {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

.user-greeting {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}

.user-greeting strong {
  color: var(--primary);
}

/* status badge in the right controls */
.nav-right #navStatus {
  margin-left: 0;
  margin-right: 8px;
  display: inline-block;
  vertical-align: middle;
}

.nav-right #navCekStatus {
  margin-right: 10px;
  display: inline-block;
  vertical-align: middle;
  color: var(--primary);
  font-weight: 700;
}

.btn.outline {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s ease;
}

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

#btnLogout {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  padding: 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

#btnLogout:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #dc2626;
}


@media (min-width: 769px) {
  .nav-wrap {
    flex-wrap: nowrap;
    /* override: sebelumnya bisa wrap */
  }

  .nav {
    flex-wrap: nowrap;
    /* override: jangan wrap */
    white-space: nowrap;
    /* teks jangan pindah baris */
    gap: 18px;
    /* lebih konsisten (boleh kamu ubah) */
    justify-content: flex-start;
    /* keep menu to the left of center to avoid overlapping brand */
    margin-left: 12px;
    /* small gap between brand and menu */
    padding-right: 160px;
    /* reserve space for right-side controls to avoid overlap */
  }

  .nav>a,
  .drop>button {
    white-space: nowrap;
  }

  .nav-right {
    margin-left: 0;
    /* biar tidak "dorong" menu ke bawah */
    white-space: nowrap;
  }

  /* supaya teks greeting tidak makan tempat dan bikin menu kepencet */
  .user-greeting {
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* Kalau layar agak sempit: menu tetap 1 baris, tapi bisa scroll horizontal */
@media (max-width: 1100px) and (min-width: 769px) {
  .nav {
    justify-content: flex-start;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .nav::-webkit-scrollbar {
    display: none;
  }
}

/* Map Styling */
iframe {
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .08);
}

@media (max-width: 768px) {
  iframe {
    height: 180px !important;
  }
}

/* Small tablets: tampilkan statistik 2 kolom (2x2) pada lebar 481-767px */
@media (min-width: 481px) and (max-width: 767px) {
  .stats-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 24px;
    border-bottom: none; /* hindari border ganda */
    padding-bottom: 0;
  }

  .stats-container > div {
    text-align: center;
  }
}

/* ===== IMAGE MODAL/LIGHTBOX ===== */
.modal {
  display: none;
  position: fixed;
  z-index: 2147483647;
  /* Maximum possible Z-Index */
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(5px);
}

.modal-content {
  margin: auto;
  display: block;
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
  transition: transform 0.3s ease, opacity 0.3s ease;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
  transition: transform 0.3s ease, opacity 0.3s ease;
  opacity: 0;
}

/* Modal Variant for Content/Grid */
.modal-content-scrollable {
  background: #fff;
  width: 90%;
  max-width: 1000px;
  max-height: 80vh;
  /* Reduced max-height */
  overflow-y: auto;
  border-radius: 16px;
  padding: 40px;
  position: relative;
  margin: 100px auto 5vh;
  /* Increased top margin to clear navbar */

  opacity: 0;
  transform: scale(0.95);
  transition: all 0.3s ease;
}

.modal.show .modal-content-scrollable {
  opacity: 1;
  transform: scale(1);
}

/* Close Button for Scrollable Modal */
.modal-close-scrollable {
  position: absolute;
  top: 15px;
  right: 20px;
  color: #333;
  font-size: 32px;
  font-weight: bold;
  cursor: pointer;
  z-index: 1001;
  line-height: 1;
  transition: color 0.2s;
}

.modal-close-scrollable:hover {
  color: #ef4444;
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 35px;
  color: #fff;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.3s ease;
  z-index: 1001;
}

.modal-close:hover,
.modal-close:focus {
  color: #bbb;
}

.modal-caption {
  margin: 20px auto;
  width: 90%;
  text-align: center;
  color: #fff;
  font-size: 18px;
  font-weight: 500;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Gallery images hover effect */
#galeri img {
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#galeri img:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

/* STAFF GRID SYSTEM */
.staff-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
  margin-top: 30px;
  justify-content: center;
}

/* Force leaders to be centered if there are few of them */
.leader-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

.leader-grid .staff-card {
  width: 100%;
  max-width: 250px;
}

.staff-card {
  background: #fff;
  border-radius: 16px;
  border: 1px solid var(--line);
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  position: relative;
  overflow: hidden;
}

.staff-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  border-color: rgba(37, 99, 235, 0.3);
}

.staff-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  font-size: 24px;
  font-weight: 700;
  border: 4px solid #fff;
  box-shadow: 0 0 0 1px var(--line);
}

.staff-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 6px 0;
  line-height: 1.4;
}

.staff-role {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  background: #f1f5f9;
  padding: 4px 10px;
  border-radius: 20px;
}

.staff-highlight {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--primary);
}

/* =========================================
   PROFESSIONAL GRID & CARD ENHANCEMENTS
   ========================================= */

/* 1. Alur Steps / Step Cards */
.step-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line) !important;
  /* override inline if needed */
  z-index: 1;
}

.step-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 30px -10px rgba(0, 0, 0, 0.1) !important;
  border-color: rgba(126, 34, 206, 0.3) !important;
  /* Purple accent */
}

/* Circle Icon in Step Card */
.step-card>div:first-child {
  transition: all 0.3s ease;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
  box-shadow: 0 4px 6px rgba(37, 99, 235, 0.3);
}

.step-card:hover>div:first-child {
  transform: scale(1.1);
  box-shadow: 0 8px 12px rgba(37, 99, 235, 0.4);
}

/* 2. Program Cards (Specific styling based on order if possible, or generic) */
#program .card {
  transition: all 0.3s ease;
  border-top: 5px solid transparent;
}

/* Paket B (Green Theme estimation based on order/content) */
#program .card:nth-of-type(1) {
  border-top-color: #16a34a;
}

#program .card:nth-of-type(1):hover {
  box-shadow: 0 20px 40px -10px rgba(22, 163, 74, 0.15);
  transform: translateY(-5px);
}

/* Paket C (Blue Theme) */
#program .card:nth-of-type(2) {
  border-top-color: #2563eb;
}

#program .card:nth-of-type(2):hover {
  box-shadow: 0 20px 40px -10px rgba(37, 99, 235, 0.15);
  transform: translateY(-5px);
}

/* 3. FAQ Items */
.faq-item {
  transition: all 0.3s ease;
  border: 1px solid var(--line);
}

.faq-item:hover {
  border-color: #0891b2;
  /* Cyan accent */
  box-shadow: 0 4px 12px rgba(8, 145, 178, 0.08);
}

.faq-item.open {
  border-color: #0891b2;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.05);
}

/* 4. Contact Cards */
#kontak .card {
  border-radius: 16px;
  border: 1px solid var(--line);
  transition: all 0.3s ease;
}

#kontak .card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px -5px rgba(67, 56, 202, 0.1);
  /* Indigo shadow */
  border-color: rgba(67, 56, 202, 0.3);
}

/* 5. Gallery Grid Adjustments */
/* 5. Gallery Grid Adjustments */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  padding: 0 10px;
}

.gallery-grid>div {
  overflow: hidden;
  border-radius: 16px;
  position: relative;
}

/* Overlay gradient on hover for gallery */
.gallery-grid>div::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.4), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.gallery-grid>div:hover::after {
  opacity: 1;
}

/* RESPONSIVE UPDATES */

/* Hamburger Button */
.btn-hamburger {
  display: none;
  /* Hidden on desktop */
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--line);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text);
  margin-right: 12px;
  flex-shrink: 0;
}

.desktop-only {
  display: inline-block;
}

@media (max-width: 767px) {
  .desktop-only {
    display: none !important;
  }

  /* Navbar Wrapper: Single row again, space between brand and right actions */
  .nav-wrap {
    flex-wrap: nowrap;
    gap: 8px;
    padding: 12px 0;
    height: auto;
    align-items: center;
  }

  /* Reset Brand Wrapper width */
  .brand-wrapper {
    width: auto;
    flex: 1;
    /* Take remaining space */
  }

  /* Right Side: Flex column to stack items */
  .nav-right {
    display: flex !important;
    margin-left: auto;
    width: auto;
    align-items: flex-end;
    /* Align right */
  }

  /* User Control Group: Horizontal layout on mobile */
  .user-control-group {
    display: flex !important;
    flex-direction: row !important;
    gap: 6px !important;
    align-items: center !important;
  }

  /* Action Group (Buttons): Ensure they stay in a row */
  .action-group {
    display: flex;
    align-items: center;
    gap: 6px;
  }

  /* Make buttons slightly more prominent again since we have space */
  .nav-right .btn {
    padding: 8px 14px;
    font-size: 12px;
    border-radius: 10px;
  }

  .nav-right .icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
  }

  /* Status badge */
  #navStatus {
    font-size: 11px !important;
    padding: 6px 10px !important;
  }

  /* Brand Text Visibility */
  .brand {
    gap: 10px;
    min-width: 0;
  }

  .brand img {
    width: 38px;
    height: 38px;
  }

  .responsive-brand-text {
    display: flex !important;
    flex-direction: column;
    justify-content: center;
  }

  .responsive-brand-text .t1 {
    font-size: 15px;
    /* Larger font */
    font-weight: 800;
    line-height: 1.2;
    color: var(--primary);
  }

  .responsive-brand-text .t2 {
    display: block;
    /* Show subtitle */
    font-size: 11px;
    color: var(--muted);
    line-height: 1.2;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .responsive-brand-text .t3 {
    display: none !important;
    /* Hide extra detail */
  }
}

/* Mobile Drawer */
.mobile-drawer {
  position: fixed;
  top: 0;
  left: -280px;
  width: 280px;
  height: 100vh;
  background: #fff;
  z-index: 1001;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
  transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
}

.mobile-drawer.active {
  left: 0;
}

.drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
  backdrop-filter: blur(2px);
}

.drawer-overlay.active {
  opacity: 1;
  visibility: visible;
}

.mobile-nav-links {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mobile-nav-links a {
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  font-size: 15px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid transparent;
  transition: background 0.2s;
}

.mobile-nav-links a:hover {
  background: rgba(37, 99, 235, .05);
  color: var(--primary);
}

/* Grids */
.about-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 40px;
  align-items: stretch;
}

.staff-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
}

/* Media Queries */
@media (max-width: 980px) {
  .btn-hamburger {
    display: flex;
  }

  /* Hide Desktop Nav */
  .nav {
    display: none !important;
  }

  /* Adjust Brand */
  /* Adjust Brand */
  .brand .t2,
  .brand .t3 {
    display: block;
    /* Make sure they are visible */
    font-size: 10px;
    /* Smaller font for mobile */
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
    /* Prevent breaking layout */
  }

  .brand .t1 {
    font-size: 14px;
    white-space: nowrap;
  }

  .brand img {
    width: 36px;
    height: 36px;
  }

  /* Grid Adjustments */
  .about-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .about-grid>div:nth-child(2) {
    height: 240px;
  }

  .staff-grid {
    grid-template-columns: repeat(2, 1fr);
    /* 2 cols on tablet/mobile */
  }

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    /* 2 cols on tablet */
  }

  .container {
    padding: 0 20px;
  }
}

@media (max-width: 500px) {
  .staff-grid {
    /* Main page stays flex/single for limit, but modal needs grid */
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .hero h1 {
    font-size: 32px !important;
  }

  .hero p {
    font-size: 15px !important;
  }

  /* Center alignment for small screens */
  .hero,
  .about-grid,
  .staff-grid {
    text-align: center;
  }

  /* Center Hero Content flex container */
  .hero>.container>div {
    align-items: center !important;
    text-align: center !important;
  }

  /* Center About Section Text */
  .about-grid>div:first-child {
    align-items: center !important;
  }

  /* Reduce Padding for About Card on Mobile */
  .about-card {
    padding: 24px !important;
  }

  /* Wrap Stats Container on Mobile */
  .stats-container {
    flex-wrap: wrap;
    justify-content: center;
    gap: 24px;
  }

  /* Reduce Hero Title Size */
  .hero-title {
    font-size: 32px !important;
  }
}

/* Tablet Specific: Alur Pendaftaran 2x2 Grid */
@media (min-width: 768px) and (max-width: 991px) {
  .steps-container {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* Additional Mobile Refinements */
@media (max-width: 768px) {
  .hero {
    min-height: 450px !important;
    padding-bottom: 40px !important;
  }

  .hero-title {
    font-size: 30px !important;
    line-height: 1.2 !important;
  }

  #heroDesc {
    font-size: 15px !important;
    margin-bottom: 30px !important;
  }

  .stats-container {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 15px !important;
  }

  .stats-container div div:first-child {
    font-size: 20px !important;
  }

  .stats-container div div:last-child {
    font-size: 10px !important;
  }

  /* Modal Mobile Fixes */
  #guruModalV3 > div, 
  #galleryModalV3 > div {
    max-width: 95% !important;
    border-radius: 16px !important;
  }

  #staffGridFullV3, 
  #galleryGridFullV3 {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)) !important;
    padding: 15px !important;
    gap: 12px !important;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 26px !important;
  }

  .about-card {
    padding: 20px !important;
  }

  #aboutTitle {
    font-size: 22px !important;
  }

  .stats-container {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 20px 10px !important;
  }

  .grid2 {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }

  /* Staff Grid 2 Columns Mobile */
  .staff-grid, #staffGridFullV3 {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
    padding: 10px !important;
  }

  .guru-card {
    width: 100% !important;
    margin: 0 !important;
  }

  .guru-card .img-wrapper {
    height: 180px !important; /* Smaller height for 2 columns */
  }

  /* Contact Cards padding */
  .card {
    padding: 20px !important;
  }

  /* Force Centering on Mobile */
  .about-card p,
  .about-card h2,
  .about-card h3,
  .block p,
  .block h2,
  .block h3,
  .section-desc,
  .card p,
  .card h3 {
    text-align: center !important;
  }

  /* Fix Visi Misi Asymmetry */
  .visi-misi-block {
    border-left: none !important;
    border-top: 4px solid #2563eb !important;
    padding-left: 0 !important;
    padding-top: 20px !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  /* Fix Grid & Poster Alignment */
  .about-grid {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    overflow: hidden !important;
  }

  .about-grid > div {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
  }

  .poster-container {
    max-width: 100% !important;
    height: auto !important;
    margin: 0 auto !important;
    display: block !important;
  }

  .poster-container img {
    width: 100% !important;
    height: auto !important;
    display: block !important;
    margin: 0 auto !important;
  }

  /* Add spacing from wave dividers */
  .block {
    padding-top: 80px !important;
  }
}