/* ═══════════════════════════════════════════
   SHARED DESIGN SYSTEM — LKP Digital
   SMA Islam Al Azhar 16 Semarang
   ═══════════════════════════════════════════ */

:root {
  --blue:    #1565c0;
  --blue-dk: #0d2b6b;
  --blue-lt: #e3f2fd;
  --green:   #2e7d32;
  --green-lt:#e8f5e9;
  --purple:  #4527a0;
  --purple-lt:#ede7f6;
  --orange:  #e65100;
  --orange-lt:#fff3e0;
  --red:     #c62828;
  --red-lt:  #ffebee;
  --teal:    #00695c;
  --teal-lt: #e0f2f1;
  --grey:    #424242;
  --grey-lt: #f5f5f5;
  --text:    #1a1a1a;
  --muted:   #555;
  --border:  #ddd;
  --radius:  10px;
  --shadow:  0 2px 12px rgba(0,0,0,0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  color: var(--text);
  background: #f0f4f8;
  min-height: 100vh;
  padding-bottom: 40px;
}

/* ── TOPBAR ── */
.topbar {
  background: var(--blue-dk);
  color: #fff;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.topbar .logo {
  width: 36px; height: 36px;
  border-radius: 50%;
  object-fit: contain;
  background: #fff;
  padding: 2px;
  flex-shrink: 0;
}
.topbar .topbar-info { flex: 1; }
.topbar .topbar-title { font-size: 14px; font-weight: 700; line-height: 1.2; }
.topbar .topbar-sub   { font-size: 11px; opacity: 0.75; }
.topbar .back-btn {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  color: #fff;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s;
}
.topbar .back-btn:hover { background: rgba(255,255,255,0.25); }

/* ── CONTAINER ── */
.container {
  max-width: 680px;
  margin: 0 auto;
  padding: 20px 16px;
}

/* ── IDENTITAS BANNER ── */
.id-banner {
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 16px;
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 20px;
  font-size: 13px;
}
.id-banner .id-field { flex: 1; }
.id-banner .id-label { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
.id-banner .id-val   { font-weight: 700; color: var(--blue-dk); }

/* ── PAGE TITLE ── */
.page-title {
  text-align: center;
  margin-bottom: 24px;
}
.page-title .badge {
  display: inline-block;
  background: var(--blue);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 3px 12px;
  border-radius: 20px;
  margin-bottom: 8px;
}
.page-title h1 {
  font-size: 22px;
  font-weight: 800;
  color: var(--blue-dk);
  line-height: 1.2;
}
.page-title p {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
}

/* ── SECTION ── */
.section {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 16px;
}
.section-title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  background: var(--blue);
  padding: 8px 16px;
  border-radius: 6px;
  margin: -20px -20px 16px;
}
.section-title.green  { background: var(--green); }
.section-title.purple { background: var(--purple); }
.section-title.orange { background: var(--orange); }
.section-title.red    { background: var(--red); }
.section-title.teal   { background: var(--teal); }
.section-title.grey   { background: var(--grey); }

/* ── CALLOUT ── */
.callout {
  border-left: 4px solid var(--blue);
  background: var(--blue-lt);
  padding: 10px 14px;
  border-radius: 0 8px 8px 0;
  font-size: 13px;
  margin-bottom: 16px;
  line-height: 1.6;
}
.callout.yellow { border-color: #f9a825; background: #fff8e1; }
.callout.green  { border-color: var(--green); background: var(--green-lt); }
.callout.orange { border-color: var(--orange); background: var(--orange-lt); }
.callout b { display: block; margin-bottom: 3px; }

/* ── FORM ELEMENTS ── */
.field-group { margin-bottom: 16px; }
.field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--blue-dk);
  margin-bottom: 6px;
}
.field-label .pts {
  background: var(--green-lt);
  color: var(--green);
  font-size: 10px;
  font-weight: 700;
  border: 1px solid #a5d6a7;
  border-radius: 10px;
  padding: 1px 7px;
  margin-left: 6px;
}
.field-label .req { color: var(--red); margin-left: 2px; }

input[type="text"],
input[type="number"],
textarea,
select {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: #fafafa;
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
}
input[type="text"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(21,101,192,0.12);
  background: #fff;
}
textarea { resize: vertical; min-height: 80px; }

/* Radio / Checkbox group */
.radio-group, .check-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.radio-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  background: #fafafa;
  transition: all 0.15s;
  user-select: none;
}
.radio-btn input { display: none; }
.radio-btn.selected,
.radio-btn:has(input:checked) {
  border-color: var(--blue);
  background: var(--blue-lt);
  color: var(--blue);
  font-weight: 700;
}
.radio-btn.green.selected,
.radio-btn.green:has(input:checked) {
  border-color: var(--green);
  background: var(--green-lt);
  color: var(--green);
}

/* ── NADA GRID ── */
.nada-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 8px;
}
@media (min-width: 480px) {
  .nada-grid { grid-template-columns: repeat(8, 1fr); }
}
.nada-cell {
  border: 1.5px solid var(--blue);
  border-radius: 8px;
  text-align: center;
  padding: 8px 4px;
  background: var(--blue-lt);
}
.nada-cell .nc-pos  { font-size: 10px; color: var(--muted); margin-bottom: 2px; }
.nada-cell input    { text-align: center; padding: 6px 2px; font-weight: 700; font-size: 14px; border-radius: 6px; }
.nada-cell.given    { background: #c8e6c9; border-color: var(--green); }
.nada-cell.given input { background: transparent; border: none; pointer-events: none; font-weight: 800; color: var(--green); }

/* WH selector inside nada-cell */
.wh-select {
  display: flex;
  gap: 3px;
  justify-content: center;
  margin-top: 4px;
}
.wh-btn {
  padding: 2px 6px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
  border: 1.5px solid var(--border);
  cursor: pointer;
  background: #fff;
  transition: all 0.15s;
}
.wh-btn.w { border-color: #66bb6a; color: #1b5e20; }
.wh-btn.h { border-color: #ef9a9a; color: #b71c1c; }
.wh-btn.w.active { background: #c8e6c9; border-color: #2e7d32; }
.wh-btn.h.active { background: #ffcdd2; border-color: #c62828; }

/* ── SUBMIT BUTTON ── */
.submit-btn {
  width: 100%;
  padding: 16px;
  background: var(--blue);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  margin-top: 8px;
}
.submit-btn:hover  { background: var(--blue-dk); }
.submit-btn:active { transform: scale(0.98); }
.submit-btn:disabled { background: #90a4ae; cursor: not-allowed; }

/* ── SUCCESS OVERLAY ── */
#success-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 999;
  align-items: center;
  justify-content: center;
}
#success-overlay.show { display: flex; }
.success-card {
  background: #fff;
  border-radius: 16px;
  padding: 32px 28px;
  text-align: center;
  max-width: 320px;
  width: 90%;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}
.success-icon { font-size: 48px; margin-bottom: 12px; }
.success-card h2 { font-size: 20px; color: var(--green); margin-bottom: 8px; }
.success-card p  { font-size: 13px; color: var(--muted); line-height: 1.6; margin-bottom: 20px; }
.success-back {
  display: inline-block;
  padding: 10px 24px;
  background: var(--blue);
  color: #fff;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
}

/* ── ERROR STATE ── */
.error-msg {
  display: none;
  color: var(--red);
  font-size: 12px;
  margin-top: 4px;
}
.field-group.error input,
.field-group.error textarea,
.field-group.error select {
  border-color: var(--red);
}
.field-group.error .error-msg { display: block; }

/* ── MISC ── */
.note {
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
  margin-top: 6px;
}
hr.divider {
  border: none;
  border-top: 1.5px dashed var(--border);
  margin: 20px 0;
}
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 480px) { .two-col { grid-template-columns: 1fr; } }
