:root {
  --primary: #0b5d3b;
  --primary-dark: #084a2f;
  --primary-light: #e7f3ed;
  --accent: #f0a818;
  --bg: #f4f6f8;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #d8dee5;
  --error: #d92d20;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(8, 74, 47, 0.08);
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 500px at 100% -10%, rgba(11, 93, 59, 0.10), transparent),
    var(--bg);
  line-height: 1.55;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

button, a, label, input { touch-action: manipulation; }

/* Topbar */
.topbar {
  background: var(--primary);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 40;
  padding-top: env(safe-area-inset-top);
  box-shadow: 0 2px 12px rgba(8, 74, 47, .25);
}
.topbar-inner {
  max-width: 760px;
  margin: 0 auto;
  padding: 12px max(20px, env(safe-area-inset-left)) 12px max(20px, env(safe-area-inset-right));
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  background: #fff;
  color: var(--primary);
  font-weight: 800;
  border-radius: 10px;
  letter-spacing: .5px;
}
.brand-logo {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: #fff;
  padding: 3px;
  object-fit: contain;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 15px; }
.brand-text span { font-size: 12px; opacity: .85; }
.admin-link {
  color: #fff;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 16px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(255,255,255,.4);
  border-radius: 999px;
  transition: background .2s;
}
.admin-link:hover { background: rgba(255,255,255,.15); }
.admin-link:active { background: rgba(255,255,255,.25); }

/* Page */
.page {
  max-width: 760px;
  margin: 0 auto;
  padding: 28px max(20px, env(safe-area-inset-left)) calc(60px + env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-right));
}
.hero { padding: 16px 4px 24px; }
.hero-logo {
  display: block;
  width: 96px; height: 96px;
  margin: 0 0 16px;
  object-fit: contain;
}
.hero h1 {
  font-size: clamp(22px, 4vw, 30px);
  margin: 0 0 12px;
  color: var(--primary-dark);
  font-weight: 800;
}
.hero-desc { color: var(--muted); margin: 0; font-size: 15px; }

/* Card / form */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.form { padding: 26px 24px; }
.required-note { margin: 0 0 18px; font-size: 13px; color: var(--muted); }
.req { color: var(--error); font-weight: 700; }

.field { margin-bottom: 20px; }
.field > label {
  display: block;
  font-weight: 600;
  margin-bottom: 7px;
  font-size: 14.5px;
}
.hint { display: block; color: var(--muted); font-size: 12.5px; margin-bottom: 7px; }

input[type="text"],
input[type="tel"],
input[type="email"] {
  width: 100%;
  min-height: 50px;
  padding: 13px 15px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-size: 16px; /* >=16px mencegah auto-zoom iOS */
  font-family: inherit;
  background: #fff;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color .15s, box-shadow .15s;
}
input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(11, 93, 59, .15);
}
input.invalid { border-color: var(--error); }

/* File picker (custom, terasa native) */
.file-picker { position: relative; }
.file-picker input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
  z-index: 1;
}
.file-picker.has-file input[type="file"] { pointer-events: none; }
.file-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 60px;
  padding: 14px;
  border: 1.5px dashed var(--border);
  border-radius: 12px;
  background: #fafbfc;
  color: var(--muted);
  font-size: 14.5px;
  font-weight: 500;
  transition: border-color .15s, background .15s;
}
.file-picker:active .file-empty { border-color: var(--primary); background: var(--primary-light); }
.file-picker.invalid .file-empty { border-color: var(--error); }
.file-icon { display: grid; place-items: center; color: var(--primary); }
.file-selected {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 60px;
  padding: 10px 12px;
  border: 1.5px solid var(--primary);
  border-radius: 12px;
  background: var(--primary-light);
}
.file-selected[hidden] { display: none; }
.file-doc-icon {
  flex: none;
  width: 42px; height: 42px;
  display: grid; place-items: center;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  border-radius: 10px;
  letter-spacing: .5px;
}
.file-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.file-name {
  font-size: 14px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.file-size { font-size: 12px; color: var(--muted); }
.file-remove {
  flex: none;
  position: relative;
  z-index: 2;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border: none;
  background: rgba(11, 93, 59, .12);
  color: var(--primary-dark);
  font-size: 22px;
  line-height: 1;
  border-radius: 50%;
  cursor: pointer;
}
.file-remove:active { background: rgba(11, 93, 59, .25); }

.error { display: none; color: var(--error); font-size: 12.5px; margin-top: 6px; }
.error.show { display: block; }

/* Choices (radio) */
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 560px) { .choices { grid-template-columns: 1fr; } }
.choice {
  display: flex; align-items: center; gap: 10px;
  min-height: 48px;
  padding: 11px 13px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  font-size: 14px;
  user-select: none;
  -webkit-user-select: none;
  transition: border-color .15s, background .15s, transform .1s;
}
.choice:hover { border-color: var(--primary); }
.choice:active { transform: scale(.985); }
.choice input { accent-color: var(--primary); width: 18px; height: 18px; flex: none; }
.choice.selected { border-color: var(--primary); background: var(--primary-light); font-weight: 600; }

/* Legal note */
.legal-note {
  background: var(--primary-light);
  border-left: 4px solid var(--primary);
  padding: 14px 16px;
  border-radius: 8px;
  font-size: 13.5px;
  color: var(--primary-dark);
  margin: 24px 0 18px;
}

/* Submit */
.btn-submit {
  width: 100%;
  min-height: 54px;
  padding: 15px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background .2s, transform .1s;
}
.btn-submit:hover { background: var(--primary-dark); }
.btn-submit:active { transform: scale(.98); }
.btn-submit:disabled { opacity: .65; cursor: not-allowed; transform: none; }

.spinner {
  width: 18px; height: 18px;
  border: 2.5px solid rgba(255,255,255,.45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.form-message {
  display: none;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 14px;
  margin-bottom: 16px;
}
.form-message.error { display: block; background: #fde8e6; color: var(--error); }
.form-message.info { display: block; background: #eef4ff; color: #1d4ed8; }

.page-footer { text-align: center; color: var(--muted); font-size: 13px; margin-top: 26px; }

/* Modal */
.modal {
  position: fixed; inset: 0;
  background: rgba(8, 30, 22, .55);
  display: grid; place-items: center;
  padding: 20px;
  z-index: 50;
  animation: fadeIn .25s ease;
}
.modal[hidden] { display: none; }
.modal-card {
  background: #fff;
  border-radius: 16px;
  padding: 32px 28px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  animation: popIn .3s cubic-bezier(.2, .9, .3, 1.2);
}
@keyframes fadeIn { from { opacity: 0; } }
@keyframes popIn { from { opacity: 0; transform: scale(.92); } }

/* Bottom sheet di layar kecil (rasa native) */
@media (max-width: 560px) {
  .modal { place-items: end stretch; padding: 0; }
  .modal-card {
    max-width: none;
    border-radius: 22px 22px 0 0;
    padding: 16px 24px calc(28px + env(safe-area-inset-bottom));
    animation: sheetUp .35s cubic-bezier(.2, .9, .3, 1);
  }
  .modal-card::before {
    content: "";
    display: block;
    width: 40px; height: 4.5px;
    margin: 0 auto 18px;
    background: var(--border);
    border-radius: 999px;
  }
}
@keyframes sheetUp { from { transform: translateY(100%); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Penyesuaian mobile */
@media (max-width: 560px) {
  .page { padding-top: 20px; }
  .hero { padding-bottom: 18px; }
  .hero-logo { width: 80px; height: 80px; margin-left: auto; margin-right: auto; }
  .hero { text-align: center; }
  .form { padding: 22px 18px; }
  .brand-text strong { font-size: 14px; }
}
.modal-icon {
  width: 64px; height: 64px;
  margin: 0 auto 16px;
  display: grid; place-items: center;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 50%;
  font-size: 32px;
  font-weight: 800;
}
.modal-card h2 { margin: 0 0 10px; color: var(--primary-dark); }
.modal-card p { color: var(--muted); margin: 0 0 12px; font-size: 14.5px; }
.modal-ref { font-size: 13px; }
.modal-ref strong { color: var(--text); font-family: ui-monospace, monospace; }
.modal-card .btn-submit { margin-top: 8px; }
