@font-face { font-family: 'Poppins'; src: url('fonts/Poppins/Poppins-Regular.ttf') format('truetype'); font-weight: 400; }
@font-face { font-family: 'Poppins'; src: url('fonts/Poppins/Poppins-Medium.ttf') format('truetype'); font-weight: 500; }
@font-face { font-family: 'Poppins'; src: url('fonts/Poppins/Poppins-SemiBold.ttf') format('truetype'); font-weight: 600; }

:root {
  --primary: #f27800;
  --secondary: #fb9e00;
  --gradient: linear-gradient(40deg, #f27800 0%, #fb9e00 100%);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Poppins', Arial, sans-serif; background: #fff; color: #111827; display: flex; flex-direction: column; min-height: 100vh; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

.container { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 1rem; }
.container-xl { width: 100%; max-width: 1440px; margin: 0 auto; padding: 0 1rem; }

.btn-gradient { background: var(--gradient); color: #fff; display: inline-flex; align-items: center; justify-content: center; border-radius: 0.5rem; font-weight: 500; transition: 0.2s; }
.btn-gradient:hover { opacity: 0.9; }

/* Navbar */
.navbar { background: #fff; border-bottom: 1px solid #e5e7eb; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1); position: fixed; top: 0; width: 100%; z-index: 50; }
.navbar-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; padding: 1rem; }
.navbar-logo { height: 4rem; width: 4rem; object-fit: contain; }
.navbar-actions { display: flex; align-items: center; gap: 0.75rem; }
.btn-login { font-size: 0.875rem; padding: 0.5rem 1rem; }
.navbar-toggle { display: inline-flex; align-items: center; justify-content: center; width: 2.5rem; height: 2.5rem; background: none; border: none; font-size: 1.25rem; cursor: pointer; }
.navbar-menu { display: none; width: 100%; margin-top: 0.5rem; }
.navbar-menu.open { display: block; }
.navbar-list { display: flex; flex-direction: column; }
.nav-link { display: block; padding: 0.5rem 0.75rem; color: #374151; }
.nav-link:hover { color: var(--primary); }
.nav-link.active { color: var(--primary); font-weight: 600; border-bottom: 2px solid var(--primary); }

@media (min-width: 768px) {
  .navbar-actions { order: 2; }
  .navbar-toggle { display: none; }
  .navbar-menu { display: flex !important; width: auto; margin-top: 0; order: 1; }
  .navbar-list { flex-direction: row; gap: 2rem; }
}

/* Main & Page Banner */
.main-wrapper { flex: 1; padding-top: 5rem; }
@media (min-width: 768px) { .main-wrapper { padding-top: 6rem; } }

.page-banner { background-image: url('images/dpmptsp2.png'); background-size: cover; background-position: center; }
.page-banner-overlay { display: flex; flex-direction: column; justify-content: center; align-items: center; height: 24rem; text-align: center; color: #fff; background: rgba(0,0,0,0.5); padding: 1rem; }
.page-banner-sub { font-weight: 300; font-size: 1.5rem; color: #e5e7eb; margin-bottom: 0.5rem; }
.page-banner-title { max-width: 42rem; font-size: 2.25rem; font-weight: 800; line-height: 1.1; }
@media (min-width: 768px) { .page-banner-title { font-size: 3rem; } }
@media (min-width: 1280px) { .page-banner-title { font-size: 3.75rem; } }

/* Hero */
.hero-grid { display: grid; padding: 2rem 1rem; }
.hero-title { max-width: 42rem; font-size: 2.25rem; font-weight: 800; line-height: 1; }
.hero-divider { height: 0.5rem; width: 50%; background: var(--gradient); border-radius: 9999px; margin-top: 0.5rem; }
.hero-desc { margin: 1.5rem 0; max-width: 42rem; font-weight: 300; color: #6b7280; font-size: 1rem; line-height: 1.6; }
.btn-hero { padding: 0.75rem 1.25rem; font-size: 1rem; }
.hero-image-wrap { display: none; position: relative; }
.hero-image { width: 100%; height: auto; object-fit: contain; }
.hero-fade { position: absolute; bottom: 0; left: 0; right: 0; height: 8rem; background: linear-gradient(to top, #fff, transparent); }

@media (min-width: 1024px) {
  .hero-grid { grid-template-columns: repeat(12, 1fr); padding: 4rem 1rem; align-items: center; }
  .hero-content { grid-column: span 7; }
  .hero-image-wrap { display: flex; grid-column: span 5; }
  .hero-title { font-size: 3.75rem; }
  .hero-desc { font-size: 1.25rem; }
}

/* Sections & Grids */
.sec-pad { padding: 2rem 1rem; }
@media (min-width: 1024px) { .sec-pad { padding: 4rem 1.5rem; } }
.sec-header { max-width: 48rem; margin: 0 auto 3rem auto; text-align: center; }
.sec-title { font-size: 2.25rem; font-weight: 800; line-height: 1.2; margin-bottom: 1rem; }
.sec-sub { font-weight: 300; color: #6b7280; font-size: 1.125rem; }

.grid-2 { display: grid; gap: 2rem; }
.grid-3 { display: grid; gap: 2rem; }
.grid-4 { display: grid; gap: 1rem; }
@media (min-width: 640px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 768px) { .grid-2 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) { .grid-4 { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1280px) { .grid-4 { grid-template-columns: repeat(4, 1fr); } }

/* Cards */
.card-row { display: flex; flex-direction: column; align-items: center; background: #f9fafb; border-radius: 1rem; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1); overflow: hidden; }
.card-row-body { padding: 1.5rem; text-align: center; width: 100%; }
@media (min-width: 640px) { .card-row { flex-direction: row; } .card-row-body { text-align: left; } }
.img-inst { width: 100%; object-fit: cover; }
@media (min-width: 640px) { .img-inst { width: 12rem; } }
.img-aduan { width: 100%; object-fit: cover; }
@media (min-width: 640px) { .img-aduan { width: 6rem; } }
.img-agency { width: 100%; object-fit: cover; padding: 1.25rem; }
@media (min-width: 640px) { .img-agency { width: 8rem; } }

/* News */
.news-card { border: 1px solid #e5e7eb; border-radius: 0.5rem; background: #fff; padding: 1.5rem; box-shadow: 0 1px 2px rgba(0,0,0,0.05); height: 100%; }
.news-thumb { height: 12rem; width: 100%; overflow: hidden; border-radius: 0.5rem; background: #f3f4f6; }
.news-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.news-card:hover .news-thumb img { transform: scale(1.05); }
.badge { display: inline-block; background: var(--gradient); color: #fff; font-size: 0.75rem; font-weight: 500; padding: 0.125rem 0.625rem; border-radius: 0.25rem; margin: 1.25rem 0 0.75rem 0; }

/* Steps, Stats, Principles & Marquee */
.step-row { display: flex; gap: 1rem; margin-bottom: 1.5rem; }
.step-num { width: 4rem; height: 4rem; min-width: 4rem; border-radius: 9999px; background: var(--gradient); color: #fff; font-weight: 600; display: flex; align-items: center; justify-content: center; }

.stat-grid { display: grid; gap: 2rem; text-align: center; padding: 2rem 1rem; }
@media (min-width: 1024px) { .stat-grid { grid-template-columns: repeat(4, 1fr); } }
.stat-num { font-size: 3rem; font-weight: 800; }

.principle-card { border: 1px solid #e5e7eb; border-radius: 0.5rem; padding: 1.5rem; text-align: center; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.principle-icon { width: 3.5rem; height: 3.5rem; margin: 0 auto 1rem auto; border-radius: 9999px; background: #fff7ed; color: var(--primary); display: flex; align-items: center; justify-content: center; font-weight: 700; }

.marquee { overflow: hidden; white-space: nowrap; padding: 1rem 0; }
.marquee-track { display: inline-flex; gap: 2.5rem; animation: marquee 25s linear infinite; }
.marquee-track img { width: 5rem; height: 5rem; object-fit: contain; }
@keyframes marquee { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

/* FAQ & SKM */
.faq-wrap { max-width: 56rem; margin: 0 auto; padding: 4rem 1rem; }
.faq-item { border-bottom: 1px solid #e5e7eb; }
.faq-btn { width: 100%; text-align: left; padding: 1.25rem 0; background: none; border: none; font-family: inherit; font-size: 1rem; font-weight: 600; color: #111827; cursor: pointer; display: flex; justify-content: space-between; }
.faq-ans { display: none; padding-bottom: 1.25rem; color: #4b5563; font-size: 0.95rem; line-height: 1.6; }
.faq-item.open .faq-ans { display: block; }

.skm-box { background: #fff; border: 1px solid #e5e7eb; border-radius: 0.5rem; padding: 1.5rem; box-shadow: 0 1px 2px rgba(0,0,0,0.05); }
.skm-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; text-align: left; }
.skm-table th, .skm-table td { padding: 0.75rem 1.5rem; border-top: 1px solid #e5e7eb; }
.skm-table thead { background: #f3f4f6; }

/* Footer */
.footer { background: #fff; border-top: 1px solid #f3f4f6; margin-top: 2rem; }
.footer-top { display: flex; flex-direction: column; justify-content: space-between; padding: 2rem 1rem; gap: 2rem; }
@media (min-width: 768px) { .footer-top { flex-direction: row; } }
.footer-logo { width: 12rem; height: 12rem; object-fit: contain; }
.footer-cols { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2rem; margin-top: 2rem; }
@media (min-width: 640px) { .footer-cols { grid-template-columns: repeat(3, 1fr); } }
.footer-h { font-size: 0.875rem; font-weight: 600; text-transform: uppercase; margin-bottom: 1.5rem; }
.footer-ul li { margin-bottom: 1rem; color: #6b7280; font-weight: 500; }
.footer-copy { border-top: 1px solid #e5e7eb; padding: 1.5rem 1rem; text-align: center; font-size: 0.875rem; color: #6b7280; }

/* Latar Gelap Beranda */
.dark-section {
  background-color: #111827;
  color: #ffffff;
}
.dark-section .hero-desc,
.dark-section .sec-sub,
.dark-section p {
  color: #d1d5db;
}
.dark-section .hero-fade {
  background: linear-gradient(to top, #111827, transparent);
}
.dark-section .card-row {
  background-color: #1f2937;
  color: #ffffff;
}

/* Halaman Login & Register */
.auth-body {
  min-height: 100vh;
  background-image: linear-gradient(rgba(17, 24, 39, 0.72), rgba(17, 24, 39, 0.72)), url('images/dpmptsp2.png');
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}
.auth-card {
  width: 100%;
  max-width: 28rem;
  background: #ffffff;
  border-radius: 1rem;
  padding: 2.25rem 2rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.25);
}
.auth-card-wide { max-width: 34rem; }
.auth-logo { width: 4.5rem; height: 4.5rem; object-fit: contain; margin: 0 auto 1rem auto; display: block; }
.auth-title { font-size: 1.5rem; font-weight: 700; text-align: center; color: #111827; }
.auth-sub { font-size: 0.875rem; color: #6b7280; text-align: center; margin: 0.35rem 0 1.75rem 0; }
.form-group { margin-bottom: 1.1rem; }
.form-label { display: block; font-size: 0.875rem; font-weight: 500; color: #374151; margin-bottom: 0.4rem; }
.form-input {
  width: 100%;
  padding: 0.65rem 0.9rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  font-family: inherit;
  font-size: 0.9rem;
  color: #111827;
  outline: none;
  transition: 0.2s;
}
.form-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(242, 120, 0, 0.15); }
.auth-row { display: flex; align-items: center; justify-content: space-between; font-size: 0.85rem; margin-bottom: 1.25rem; color: #4b5563; }
.auth-link { color: var(--primary); font-weight: 500; }
.auth-link:hover { text-decoration: underline; }
.btn-auth { width: 100%; padding: 0.75rem; border: none; font-family: inherit; font-size: 0.95rem; cursor: pointer; }
.auth-footer { text-align: center; font-size: 0.875rem; color: #6b7280; margin-top: 1.5rem; }
.auth-back { display: inline-block; margin-top: 0.75rem; font-size: 0.825rem; color: #9ca3af; }
.auth-back:hover { color: #374151; }

/* Dashboard Sistem Antrian MPP */
.dash-header {
  background: linear-gradient(40deg, #111827 0%, #1f2937 100%);
  color: #fff;
  padding: 2.5rem 1rem;
}
.dash-grid {
  display: grid;
  gap: 2rem;
  padding: 2.5rem 1rem;
}
@media (min-width: 1024px) {
  .dash-grid { grid-template-columns: 7fr 5fr; align-items: start; }
}
.dash-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 1rem;
  padding: 1.75rem;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.07);
}
.ticket-box {
  background: #fff7ed;
  border: 2px dashed #f27800;
  border-radius: 1rem;
  padding: 2rem 1.5rem;
  text-align: center;
}
.ticket-code {
  font-size: 3rem;
  font-weight: 800;
  color: #f27800;
  letter-spacing: 2px;
  margin: 0.5rem 0;
}
.ticket-meta {
  background: #fff;
  border-radius: 0.75rem;
  padding: 1rem;
  margin-top: 1.25rem;
  text-align: left;
  font-size: 0.875rem;
  color: #374151;
}
.ticket-meta p {
  display: flex;
  justify-content: space-between;
  padding: 0.35rem 0;
  border-bottom: 1px solid #f3f4f6;
}
.ticket-meta p:last-child { border-bottom: none; }
.status-pill {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: #dcfce7;
  color: #166534;
}

/* Riwayat Antrian */
.history-card {
  margin-top: 2rem;
}
.history-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.table-responsive {
  width: 100%;
  overflow-x: auto;
}
.history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  text-align: left;
}
.history-table th {
  background: #f9fafb;
  color: #374151;
  font-weight: 600;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #e5e7eb;
  white-space: nowrap;
}
.history-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #f3f4f6;
  color: #111827;
}
.badge-done {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: #f3f4f6;
  color: #4b5563;
}
.badge-active {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: #dcfce7;
  color: #166534;
}
.btn-clear {
  background: #fff;
  border: 1px solid #e5e7eb;
  color: #6b7280;
  padding: 0.4rem 0.85rem;
  border-radius: 0.5rem;
  font-size: 0.8rem;
  cursor: pointer;
}
.btn-clear:hover {
  border-color: #ef4444;
  color: #ef4444;
}

/* Monitor Panggilan Loket */
.monitor-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 768px) {
  .monitor-grid { grid-template-columns: repeat(4, 1fr); }
}
.loket-box {
  background: #111827;
  color: #ffffff;
  border-radius: 0.75rem;
  padding: 1.25rem;
  text-align: center;
  border-bottom: 4px solid #f27800;
}
.loket-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #9ca3af;
}
.loket-num {
  font-size: 2rem;
  font-weight: 800;
  color: #fb9e00;
  margin: 0.25rem 0;
}
.loket-inst {
  font-size: 0.8rem;
  color: #e5e7eb;
  font-weight: 500;
}
.btn-print {
  width: 100%;
  margin-top: 1rem;
  padding: 0.65rem;
  border: 1px solid #f27800;
  background: #ffffff;
  color: #f27800;
  border-radius: 0.5rem;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s;
}
.btn-print:hover {
  background: #f27800;
  color: #ffffff;
}

/* Mode Cetak Tiket */
@media print {
  body * { visibility: hidden; }
  #printableTicket, #printableTicket * { visibility: visible; }
  #printableTicket {
    position: fixed;
    left: 50%;
    top: 2rem;
    transform: translateX(-50%);
    width: 340px;
    border: 2px dashed #111827;
    background: #fff;
  }
  .btn-print { display: none !important; }
}
