/* =============================================
   PORTAL TAGIHAN PENDIDIKAN — SMP & SMK AL-AQSYAR
   style.css
   ============================================= */

/* ---- CSS Variables ---- */
:root {
  --primary:      #0F766E;
  --primary-dark: #0a5952;
  --primary-light:#d0f0ee;
  --secondary:    #D97706;
  --secondary-light:#fef3c7;
  --bg:           #F1F5F9;
  --surface:      #ffffff;
  --text:         #0F172A;
  --text-muted:   #64748B;
  --success:      #16A34A;
  --error:        #DC2626;
  --border:       #E2E8F0;
  --shadow:       0 4px 24px rgba(15,118,110,0.10);
  --shadow-sm:    0 2px 8px rgba(15,118,110,0.08);
  --radius:       16px;
  --radius-sm:    10px;
  --font:         'Plus Jakarta Sans', Arial, sans-serif;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
img { max-width: 100%; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* =============================================
   HEADER
   ============================================= */
.site-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 0;
  position: relative;
  overflow: hidden;
}
.header-inner {
  max-width: 860px;
  margin: 0 auto;
  padding: 28px 24px 22px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.header-logo {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}
.header-logo img {
  width: 62px;
  height: 62px;
  object-fit: contain;
  border-radius: 12px;
  background: rgba(255,255,255,0.15);
  padding: 4px;
}
.header-brand {
  display: flex;
  flex-direction: column;
}
.brand-school {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.3px;
  line-height: 1.2;
}
.brand-sub {
  font-size: 0.78rem;
  font-weight: 500;
  opacity: 0.8;
  letter-spacing: 0.5px;
}
.header-title {
  flex: 1;
}
.header-title h1 {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(1.1rem, 3vw, 1.55rem);
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: -0.3px;
}
.header-title p {
  font-size: 0.8rem;
  opacity: 0.75;
  margin-top: 4px;
  font-weight: 500;
  letter-spacing: 0.3px;
}
.header-ornament {
  height: 6px;
  background: linear-gradient(90deg, var(--secondary) 0%, #f59e0b 50%, transparent 100%);
}

/* =============================================
   MAIN CONTENT
   ============================================= */
.main-content {
  flex: 1;
  max-width: 860px;
  margin: 0 auto;
  width: 100%;
  padding: 32px 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ---- Card ---- */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 28px 24px;
  border: 1px solid var(--border);
}

/* =============================================
   SEARCH CARD
   ============================================= */
.search-card {
  text-align: center;
  padding: 36px 28px 28px;
}
.card-icon {
  font-size: 2rem;
  margin-bottom: 10px;
}
.search-card h2 {
  font-family: 'DM Serif Display', serif;
  font-size: 1.5rem;
  color: var(--primary);
  margin-bottom: 8px;
}
.card-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 22px;
  line-height: 1.6;
}
.search-box {
  display: flex;
  gap: 10px;
  max-width: 480px;
  margin: 0 auto;
}
.search-box input {
  flex: 1;
  padding: 13px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  background: var(--bg);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}
.search-box input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
  background: white;
}
.search-box input::placeholder {
  color: #94A3B8;
  font-weight: 400;
}
.search-box button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 20px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  white-space: nowrap;
}
.search-box button:hover { background: var(--primary-dark); }
.search-box button:active { transform: scale(0.97); }

/* Status Message */
.status-msg {
  margin-top: 14px;
  font-size: 0.88rem;
  min-height: 22px;
  font-weight: 500;
  transition: opacity 0.3s;
}
.status-msg.error { color: var(--error); }
.status-msg.info  { color: var(--text-muted); }
.status-msg.ok    { color: var(--success); }

/* =============================================
   SECTION TITLE
   ============================================= */
.section-title {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--primary);
  border-bottom: 2px solid var(--primary-light);
  padding-bottom: 8px;
  margin: 22px 0 14px;
}
.section-title:first-of-type { margin-top: 0; }

/* =============================================
   RESULT SECTION
   ============================================= */
.result-section { animation: fadeIn 0.4s ease; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.result-card { position: relative; }

/* Close Button */
.close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border: none;
  background: var(--bg);
  color: var(--text-muted);
  border-radius: 50%;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
}
.close-btn:hover { background: #fee2e2; color: var(--error); }

/* Siswa Info */
.siswa-info {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: linear-gradient(135deg, var(--primary-light), #f0fdf4);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
}
.siswa-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  font-size: 1.3rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(15,118,110,0.3);
}
.siswa-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 3px;
}
.siswa-name {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--primary-dark);
  line-height: 1.2;
}
.siswa-kelas {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--secondary);
  margin-top: 3px;
}

/* Tagihan Table */
.tagihan-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.tagihan-table th {
  text-align: left;
  padding: 9px 12px;
  background: var(--bg);
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}
.tagihan-table th:last-child { text-align: right; }
.tagihan-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.tagihan-table td:last-child {
  text-align: right;
  font-weight: 600;
  color: var(--primary-dark);
}
.tagihan-table tr:last-child td { border-bottom: none; }
.tagihan-table tfoot .total-row td {
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--primary);
  background: var(--primary-light);
  border-top: 2px solid var(--primary);
  border-bottom: none;
}
.tagihan-table tfoot .total-row td:last-child {
  font-size: 1rem;
  color: var(--primary-dark);
}
.tagihan-table tr:hover td { background: #f8fafc; }
.tagihan-table tfoot tr:hover td { background: var(--primary-light); }

/* Zero value row */
.tagihan-table tr.zero-row td { color: #94A3B8; }
.tagihan-table tr.zero-row td:last-child { color: #94A3B8; }

/* Data Date */
.data-date {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: right;
  margin-top: 8px;
}

/* Payment Box */
.payment-box {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  border: 1px solid var(--border);
}
.payment-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 0.9rem;
}
.payment-row:last-of-type { border-bottom: none; }
.payment-row span { color: var(--text-muted); }
.payment-row strong { color: var(--text); font-weight: 700; }
.payment-note {
  margin-top: 12px;
  font-size: 0.8rem;
  color: var(--secondary);
  font-weight: 600;
  background: var(--secondary-light);
  padding: 8px 12px;
  border-radius: 8px;
  border-left: 3px solid var(--secondary);
}

/* Action Buttons */
.action-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 20px;
}
.btn {
  flex: 1;
  min-width: 130px;
  padding: 12px 14px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}
.btn:active { transform: scale(0.97); }
.btn-copy {
  background: var(--primary-light);
  color: var(--primary-dark);
  border: 2px solid var(--primary);
}
.btn-copy:hover { background: var(--primary); color: white; }
.btn-wa {
  background: #dcfce7;
  color: #166534;
  border: 2px solid #16A34A;
}
.btn-wa:hover { background: #16A34A; color: white; }
.btn-print {
  background: #e0f2fe;
  color: #075985;
  border: 2px solid #0ea5e9;
}
.btn-print:hover { background: #0ea5e9; color: white; }

/* Copy Notification */
.copy-notif {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--success);
  text-align: center;
  margin-top: 10px;
  min-height: 20px;
  transition: opacity 0.3s;
}

/* =============================================
   KONTAK CARD
   ============================================= */
.kontak-card {}
.kontak-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.kontak-item {
  flex: 1;
  min-width: 130px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.85rem;
  padding: 14px 14px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border-top: 3px solid var(--primary);
  text-align: center;
  align-items: center;
}
.kontak-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--primary);
}

/* =============================================
   FOOTER
   ============================================= */
.site-footer {
  text-align: center;
  padding: 16px 20px;
  font-size: 0.78rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  background: var(--surface);
}

/* =============================================
   PRINT STYLES
   ============================================= */
@media print {
  .site-header { background: #0F766E !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .header-ornament, .search-card, .action-buttons, .btn, .close-btn, .kontak-card, .site-footer { display: none !important; }
  .main-content { padding: 0; }
  .card { box-shadow: none !important; border: 1px solid #ccc; }
  body { background: white; }
  .result-section { display: block !important; }
  .tagihan-table th, .tagihan-table tfoot .total-row td { background: #e6f4f3 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 600px) {
  .header-inner { padding: 20px 16px 16px; gap: 14px; }
  .header-logo img { width: 48px; height: 48px; }
  .brand-school { font-size: 0.9rem; }
  .card { padding: 20px 16px; }
  .search-box { flex-direction: column; }
  .search-box button { width: 100%; justify-content: center; }
  .action-buttons { flex-direction: column; }
  .btn { min-width: unset; }
  .payment-row { flex-direction: column; align-items: flex-start; gap: 2px; }
}

/* =============================================
   KARTU UJIAN
   ============================================= */
.btn-kartu {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #7C3AED, #6D28D9);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 10px;
}
.btn-kartu:hover  { background: linear-gradient(135deg, #6D28D9, #5B21B6); }
.btn-kartu:active { transform: scale(0.98); }

.kartu-info {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-align: center;
}

.kartu-pending-box {
  text-align: center;
  padding: 18px;
  background: #fef9c3;
  border: 1px solid #fde047;
  border-radius: var(--radius-sm);
}
.kartu-pending-icon { font-size: 1.8rem; display: block; margin-bottom: 8px; }
.kartu-pending-box p { font-size: 0.88rem; font-weight: 600; color: #854d0e; }
.kartu-pending-sub  { font-size: 0.78rem; font-weight: 400; color: #92400e; margin-top: 4px; }
