/* =========================================================
   PUBLIC.CSS — E-Survei RS Bhayangkara Bengkulu
   Halaman survei publik
   ========================================================= */

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

:root {
  --navy:       #0F2040;
  --navy-mid:   #1B3461;
  --navy-light: #2A4880;
  --gold:       #C8A84B;
  --gold-light: #F0D080;
  --bg:         #F0F3F8;
  --white:      #fff;
  --border:     #D8DFE9;
  --text:       #1A2540;
  --muted:      #6B7A99;
  --green:      #16a34a;
  --green-bg:   #dcfce7;
  --blue:       #2563eb;
  --red:        #dc2626;
  --red-bg:     #fee2e2;
  --radius:     12px;
}

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ── HEADER ── */
.site-header {
  background: var(--navy);
  border-bottom: 3px solid var(--gold);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  max-width: 820px;
  margin: 0 auto;
  padding: .9rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.header-logo {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  background: rgba(255,255,255,0.1);
  border: 2px solid rgba(200,168,75,0.4);
}
.header-logo .logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.header-text h1 { color: #fff; font-size: 14px; font-weight: 800; line-height: 1.3; }
.header-text p  { color: var(--gold-light); font-size: 11px; opacity: .85; }
.header-admin { margin-left: auto; }
.header-admin a {
  color: rgba(255,255,255,.5);
  font-size: 12px;
  text-decoration: none;
  padding: 5px 11px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 7px;
}
.header-admin a:hover { color: #fff; }

/* ── HERO ── */
.hero {
  background: linear-gradient(135deg, var(--navy-mid), var(--navy));
  padding: 2rem 1.5rem;
  text-align: center;
  color: #fff;
}
.hero-badge {
  display: inline-block;
  background: rgba(200,168,75,.2);
  border: 1px solid var(--gold);
  color: var(--gold-light);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 12px;
  border-radius: 20px;
  margin-bottom: 10px;
  letter-spacing: .05em;
}
.hero h2 { font-size: 20px; font-weight: 800; margin-bottom: 6px; }
.hero p  { font-size: 13px; opacity: .75; max-width: 480px; margin: 0 auto; line-height: 1.6; }

/* ── LAYOUT ── */
.fw { max-width: 820px; margin: 0 auto; padding: 1.25rem 1rem; }

/* ── PROGRESS ── */
.prog-wrap {
  background: var(--white);
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: .6rem 1rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 12px;
}
.prog-label { font-size: 12px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.prog-bar   { flex: 1; height: 8px; background: var(--border); border-radius: 8px; overflow: hidden; }
.prog-fill  { height: 100%; background: var(--gold); border-radius: 8px; transition: width .4s ease; }
.prog-pct   { font-size: 12px; font-weight: 800; color: var(--navy); white-space: nowrap; }

/* ── CARD ── */
.card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 1.5rem;
  margin-bottom: .75rem;
}
.card-title {
  font-size: 14px; font-weight: 800; color: var(--navy);
  margin-bottom: 1rem;
  display: flex; align-items: center; gap: 8px;
}
.aspek-badge { padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; }

/* ── FORM ── */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 580px) { .form-row { grid-template-columns: 1fr; } }

.fg          { margin-bottom: .9rem; }
.fg:last-child { margin-bottom: 0; }
label.lbl    { display: block; font-size: 13px; font-weight: 600; color: var(--navy); margin-bottom: 5px; }
.req         { color: var(--red); }

select, textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1.5px solid var(--border);
  border-radius: 9px;
  font-family: inherit;
  font-size: 13px;
  color: var(--text);
  background: #fafbfd;
  outline: none;
  transition: border-color .2s;
}
select:focus, textarea:focus { border-color: var(--navy-mid); background: #fff; }
textarea { resize: vertical; min-height: 90px; }

/* ── QUESTIONS ── */
.qitem { margin-bottom: 1.1rem; padding-bottom: 1.1rem; border-bottom: 1px solid var(--border); }
.qitem:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }
.qteks { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 8px; line-height: 1.5; }
.qteks small { color: var(--muted); font-weight: 400; font-size: 11px; display: block; margin-top: 2px; }

.likert { display: grid; grid-template-columns: repeat(4,1fr); gap: 6px; }
.lo input[type="radio"] { position: absolute; opacity: 0; width: 0; height: 0; }
.lo { position: relative; }
.lo label {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 9px 4px; border: 1.5px solid var(--border); border-radius: 9px;
  cursor: pointer; text-align: center; background: #fafbfd;
  font-size: 11px; font-weight: 600; color: var(--muted);
  min-height: 60px; gap: 3px; transition: all .15s;
}
.lo label .n { font-size: 20px; font-weight: 800; line-height: 1; }
.lo input:checked + label { border-color: var(--navy-mid); background: var(--navy-mid); color: #fff; }
.lo label:hover { border-color: var(--navy-light); }
.ll { display: flex; justify-content: space-between; margin-top: 3px; }
.ll span { font-size: 10px; color: var(--muted); }

/* ── BUTTONS ── */
.nav-btns { display: flex; gap: 10px; justify-content: space-between; margin-top: 1rem; }
.btn-back {
  padding: 11px 22px; border: 1.5px solid var(--border); border-radius: 9px;
  background: #fff; font-family: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer; color: var(--muted);
}
.btn-next {
  padding: 11px 26px; background: var(--navy); border: none; border-radius: 9px;
  color: #fff; font-family: inherit; font-size: 13px; font-weight: 700;
  cursor: pointer; transition: background .15s;
}
.btn-next:hover { background: var(--navy-mid); }
.btn-submit {
  padding: 13px 0; background: var(--green); border: none; border-radius: 9px;
  color: #fff; font-family: inherit; font-size: 14px; font-weight: 700;
  cursor: pointer; width: 100%; transition: background .15s;
}
.btn-submit:hover    { background: #15803d; }
.btn-submit:disabled { background: #9ca3af; cursor: not-allowed; }

/* ── STEPS ── */
.step-page        { display: none; }
.step-page.active { display: block; }

/* ── ALERTS ── */
.alert-err {
  background: var(--red-bg); border: 1px solid #fecaca;
  color: var(--red); border-radius: 8px; padding: 9px 12px;
  font-size: 13px; margin-bottom: .75rem; display: none;
}

/* ── LOADING ── */
.loading-overlay { display: none; text-align: center; padding: 2rem; color: var(--muted); }
.loading-overlay.active { display: block; }
.spinner {
  width: 36px; height: 36px;
  border: 4px solid var(--border); border-top-color: var(--navy);
  border-radius: 50%; animation: spin .7s linear infinite;
  margin: 0 auto 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── SUCCESS ── */
.success-page { text-align: center; padding: 2.5rem 1.5rem; }
.success-icon { font-size: 60px; margin-bottom: .75rem; }
.success-page h2 { font-size: 22px; font-weight: 800; color: var(--navy); margin-bottom: 6px; }
.success-page p  { font-size: 13px; color: var(--muted); max-width: 400px; margin: 0 auto; line-height: 1.6; }
.kode-box {
  background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 20px; font-size: 15px; font-weight: 800; letter-spacing: .1em;
  color: var(--navy); display: inline-block; margin: 1rem 0;
}
.btn-ulang {
  margin-top: 1rem; padding: 11px 24px; background: var(--navy); border: none;
  border-radius: 9px; color: #fff; font-family: inherit; font-size: 13px;
  font-weight: 700; cursor: pointer;
}
.unit-info-bar {
  background: var(--navy); color: #fff; border-radius: 9px;
  padding: 8px 14px; font-size: 12px; margin-bottom: .75rem;
  display: flex; align-items: center; gap: 8px;
}
.unit-info-bar strong { color: var(--gold-light); }
