@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --primary: #0f172a;        /* Slate / Deep Dark */
  --navy: #1e3a8a;           /* Academic Navy */
  --navy-hover: #1e40af;
  --gold: #d97706;           /* Amber Gold */
  --gold-hover: #b45309;
  --bg-body: #f8fafc;
  --bg-card: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 10px 10px -5px rgba(0, 0, 0, 0.03);
  --radius: 10px;
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Plus Jakarta Sans', system-ui, sans-serif; }

/* Cegah elemen apapun (gambar, tabel, dsb) memicu scroll horizontal di HP */
html { overflow-x: hidden; -webkit-text-size-adjust: 100%; }
img, video, iframe { max-width: 100%; height: auto; }

/* BACKGROUND TEMATIK PENDIDIKAN DENGAN OVERLAY HALUS */
body { 
  background: linear-gradient(rgba(248, 250, 252, 0.94), rgba(248, 250, 252, 0.96)), 
              url('https://images.unsplash.com/photo-1523050854058-8df90110c9f1?q=80&w=1920&auto=format&fit=crop') center/cover fixed; 
  color: var(--text-main); 
  line-height: 1.6; 
  -webkit-font-smoothing: antialiased; 
  overflow-x: hidden;
}
body.modal-open { overflow: hidden; }

/* ================= WELCOME MODAL (SPLASH SCREEN) ================= */
.welcome-overlay {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
  z-index: 10000;
  display: flex; justify-content: center; align-items: center; padding: 1.5rem;
}
.welcome-card {
  background: white; border-radius: 16px; padding: 2.5rem; max-width: 480px; width: 100%;
  text-align: center; box-shadow: var(--shadow-lg); border: 1px solid rgba(255,255,255,0.8);
  animation: modalIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-height: 90vh; overflow-y: auto;
}
@keyframes modalIn { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.welcome-badge {
  display: inline-block; background: #fef2f2; color: #dc2626; border: 1px solid #fecaca;
  padding: 0.25rem 0.75rem; border-radius: 20px; font-size: 0.75rem; font-weight: 700;
  text-transform: uppercase; margin-bottom: 1rem;
}

/* ================= NAVBAR MODERN ================= */
.navbar {
  position: sticky; top: 0; z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0.85rem 2.5rem;
  display: flex; justify-content: space-between; align-items: center;
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
  gap: 1rem;
}
.brand { display: flex; align-items: center; gap: 0.85rem; text-decoration: none; }
.brand-logo-img { width: 42px; height: 42px; object-fit: contain; display: block; }
.brand-title { font-weight: 800; font-size: 1.15rem; color: var(--text-main); letter-spacing: -0.3px; line-height: 1.2; }
.brand-subtitle { font-size: 0.7rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }

.nav-menu { display: flex; align-items: center; gap: 1.75rem; }
.nav-link { color: var(--text-muted); text-decoration: none; font-weight: 600; font-size: 0.9rem; transition: var(--transition); }
.nav-link:hover { color: var(--navy); }

.nav-actions { display: flex; align-items: center; gap: 0.75rem; }

/* ================= BUTTONS MODERN ================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.65rem 1.25rem; border-radius: 8px; font-weight: 600; font-size: 0.875rem;
  cursor: pointer; border: 1px solid transparent; text-decoration: none; transition: var(--transition);
}
.btn:active { transform: translateY(1px); }

.btn-navy { background: var(--navy); color: white; }
.btn-navy:hover { background: var(--navy-hover); box-shadow: 0 4px 12px rgba(30, 58, 138, 0.25); }

.btn-gold { background: var(--gold); color: white; }
.btn-gold:hover { background: var(--gold-hover); box-shadow: 0 4px 12px rgba(217, 119, 6, 0.25); }

.btn-outline { background: white; border-color: var(--border); color: var(--text-main); }
.btn-outline:hover { background: #f8fafc; border-color: #cbd5e1; }

.btn-ghost-navy { background: rgba(30, 58, 138, 0.08); color: var(--navy); border: 1px solid rgba(30, 58, 138, 0.15); }
.btn-ghost-navy:hover { background: var(--navy); color: white; }

/* ================= HERO SECTION ================= */
.hero {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.92) 0%, rgba(30, 58, 138, 0.88) 100%),
              url('https://images.unsplash.com/photo-1541339907198-e08756dedf3f?q=80&w=1920&auto=format&fit=crop') center/cover fixed;
  color: white; padding: 5.5rem 1.5rem; text-align: center;
}
.hero-title { font-size: 2.5rem; font-weight: 800; letter-spacing: -0.5px; margin-bottom: 1rem; line-height: 1.2; }
.hero-desc { font-size: 1.1rem; color: #cbd5e1; max-width: 680px; margin: 0 auto 2.25rem; line-height: 1.6; }

/* ================= LAYOUT & CARDS ================= */
.wrapper { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.section { padding: 4.5rem 0; }
.section-header { text-align: center; margin-bottom: 3rem; }
.section-title { font-size: 1.85rem; font-weight: 800; color: var(--text-main); letter-spacing: -0.5px; }
.section-desc { color: var(--text-muted); font-size: 0.95rem; margin-top: 0.35rem; }

/* Kuota Grid */
.kuota-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.5rem; }
.kuota-card {
  background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(5px);
  border-radius: 12px; padding: 1.75rem; border: 1px solid var(--border);
  box-shadow: var(--shadow-sm); transition: var(--transition); border-top: 4px solid var(--navy);
}
.kuota-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.kuota-tag { display: inline-block; background: #eff6ff; color: var(--navy); padding: 0.2rem 0.6rem; border-radius: 6px; font-size: 0.75rem; font-weight: 700; margin-bottom: 0.75rem; }

/* Brosur Container */
.brosur-card {
  background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(5px);
  border-radius: 16px; border: 1px solid var(--border);
  box-shadow: var(--shadow-md); padding: 2.5rem; display: flex; gap: 3rem; align-items: center;
}

.brosur-thumb-wrap { position: relative; max-width: 260px; width: 100%; cursor: pointer; border-radius: 10px; overflow: hidden; box-shadow: var(--shadow-md); }
.brosur-thumb-wrap img { width: 100%; display: block; transition: var(--transition); }
.brosur-thumb-wrap:hover img { transform: scale(1.04); }
.brosur-hover-overlay { position: absolute; inset: 0; background: rgba(15, 23, 42, 0.4); display: flex; align-items: center; justify-content: center; color: white; font-weight: 700; font-size: 0.85rem; opacity: 0; transition: var(--transition); }
.brosur-thumb-wrap:hover .brosur-hover-overlay { opacity: 1; }

/* Form Card */
.form-card { 
  background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(5px);
  border-radius: 16px; border: 1px solid var(--border); box-shadow: var(--shadow-md); padding: 2.5rem; max-width: 760px; margin: 0 auto; 
}
.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 700; margin-bottom: 0.4rem; color: #334155; }
.form-control {
  width: 100%; padding: 0.75rem 1rem; border: 1px solid #cbd5e1; border-radius: 8px;
  font-size: 0.9rem; transition: var(--transition); background: white;
}
.form-control:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.12); }

/* FAQ Accordion */
.faq-wrap { max-width: 800px; margin: 0 auto; display: flex; flex-direction: column; gap: 1rem; }
.faq-item { background: rgba(255, 255, 255, 0.95); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; box-shadow: var(--shadow-sm); }
.faq-btn { width: 100%; text-align: left; padding: 1.25rem 1.5rem; background: transparent; border: none; font-weight: 700; font-size: 0.95rem; color: var(--text-main); cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
.faq-btn::after { content: '+'; font-size: 1.25rem; color: var(--text-muted); }
.faq-item.active .faq-btn::after { content: '−'; }
.faq-body { display: none; padding: 0 1.5rem 1.25rem; color: var(--text-muted); font-size: 0.9rem; border-top: 1px solid #f1f5f9; margin-top: -0.25rem; padding-top: 0.85rem; }

/* Modal & Toast */
.modal-overlay { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.7); backdrop-filter: blur(4px); z-index: 9999; display: flex; align-items: center; justify-content: center; padding: 1.5rem; }
.modal-content { background: white; border-radius: 16px; padding: 2rem; width: 100%; max-width: 440px; position: relative; box-shadow: var(--shadow-lg); max-height: 90vh; overflow-y: auto; }
.modal-close { position: absolute; top: 1.25rem; right: 1.25rem; background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--text-muted); }

/* STATUS BADGES UNTUK TABEL ADMIN */
.badge-status { padding: 4px 8px; border-radius: 4px; font-size: 0.75rem; font-weight: bold; display: inline-block; white-space: nowrap; }
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-valid { background: #dbeafe; color: #1e40af; }
.badge-diterima { background: #dcfce7; color: #166534; }
.badge-ditolak { background: #fee2e2; color: #991b1b; }

/* Pembungkus tabel agar bisa discroll horizontal di HP tanpa merusak layout */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 10px;
}
.table-responsive table { min-width: 640px; width: 100%; border-collapse: collapse; }

/* Floating WA Button */
.btn-wa-float {
  position: fixed; bottom: 30px; right: 30px; z-index: 1000;
  background: #25d366; color: white; padding: 0.75rem 1.25rem; border-radius: 50px;
  font-weight: 700; font-size: 0.875rem; text-decoration: none;
  box-shadow: 0 10px 25px rgba(37, 211, 102, 0.3); display: flex; align-items: center; gap: 0.5rem;
  transition: var(--transition);
}
.btn-wa-float:hover { transform: translateY(-3px); box-shadow: 0 15px 30px rgba(37, 211, 102, 0.4); }

/* Footer */
.footer { background: #0f172a; color: white; padding: 4rem 1.5rem 2rem; margin-top: 5rem; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 2.5rem; margin-bottom: 3rem; }
.footer-title { font-size: 1rem; font-weight: 700; color: white; margin-bottom: 1.25rem; text-transform: uppercase; letter-spacing: 0.5px; }

/* Dashboard Layout Responsive Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 1.5rem;
  align-items: start;
}

/* ================= DESAIN RESPONSIF MOBILE (LAYAR HP) ================= */
@media (max-width: 992px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 850px) {
  .brosur-card { flex-direction: column; text-align: center; }
}

@media (max-width: 768px) {
  /* Matikan background-attachment: fixed di mobile.
     Ini penting karena bikin lag / bug rendering di Safari iOS & sebagian Android */
  body, .hero {
    background-attachment: scroll;
  }

  .navbar {
    padding: 0.75rem 1rem;
    flex-direction: column;
    align-items: stretch;
  }
  .nav-menu {
    justify-content: space-around;
    gap: 0.5rem;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 0.25rem;
  }
  .nav-link {
    /* target tap lebih besar biar enak dipencet jari */
    padding: 0.4rem 0.25rem;
    white-space: nowrap;
  }
  .nav-actions {
    width: 100%;
    justify-content: space-between;
  }
  .nav-actions .btn {
    flex: 1;
  }
  .hero {
    padding: 3rem 1rem;
  }
  .hero-title {
    font-size: 1.75rem;
  }
  .hero-desc {
    font-size: 0.95rem;
  }
  .wrapper {
    padding: 0 1rem;
  }
  .section {
    padding: 2.5rem 0;
  }
  .section-title {
    font-size: 1.5rem;
  }
  .form-card, .welcome-card {
    padding: 1.25rem;
  }

  /* Cegah auto-zoom iOS saat tap input: font-size input minimal 16px */
  .form-control {
    font-size: 16px;
  }

  .brosur-card {
    padding: 1.5rem;
    gap: 1.5rem;
  }
  .brosur-thumb-wrap {
    max-width: 220px;
    margin: 0 auto;
  }

  .modal-content {
    padding: 1.5rem;
  }

  .footer {
    padding: 2.5rem 1rem 1.5rem;
    margin-top: 3rem;
    text-align: center;
  }
  .footer-grid {
    gap: 2rem;
  }

  .btn-wa-float {
    bottom: 15px;
    right: 15px;
    padding: 0.6rem 1rem;
    font-size: 0.8rem;
  }
}

/* ================= LAYAR HP KECIL / LAMA (<= 480px) ================= */
@media (max-width: 480px) {
  .brand-title { font-size: 1rem; }
  .brand-subtitle { font-size: 0.62rem; }
  .brand-logo-img { width: 34px; height: 34px; }

  .hero-title { font-size: 1.4rem; }
  .hero-desc { font-size: 0.88rem; }

  .section-title { font-size: 1.25rem; }
  .section-desc { font-size: 0.85rem; }

  .kuota-grid { grid-template-columns: 1fr; gap: 1rem; }
  .kuota-card { padding: 1.25rem; }

  .btn {
    padding: 0.6rem 1rem;
    font-size: 0.82rem;
  }

  .nav-actions {
    flex-direction: column;
    gap: 0.5rem;
  }
  .nav-actions .btn {
    width: 100%;
  }

  .welcome-card { padding: 1.5rem 1.1rem; }
  .welcome-badge { font-size: 0.68rem; }

  .faq-btn { padding: 1rem 1.1rem; font-size: 0.88rem; }
  .faq-body { padding: 0 1.1rem 1rem; font-size: 0.85rem; }

  .btn-wa-float span { display: none; } /* sisakan ikon saja biar tombol kecil & tak menutupi konten */
}

/* Dukungan area aman untuk HP dengan notch (iPhone dsb) */
@supports (padding: max(0px)) {
  .btn-wa-float {
    bottom: max(15px, env(safe-area-inset-bottom));
    right: max(15px, env(safe-area-inset-right));
  }
}

