/* ============================================================================
   Freeda Observasi — tampilan.

   Token warna, font, bayangan, dan gaya gelembung diambil UTUH dari
   freeda_mockup_observasi_001.html supaya satu lini Freeda terasa satu keluarga.
   Yang TIDAK diambil: kerangka desktop + sidebar riwayat magang. Mockup itu
   aplikasi Pre-Internship yang dibuka di laptop; ini dibuka sambil berjalan
   di area MIS dengan satu tangan. Jadi: satu kolom, tombol besar, tanpa
   sidebar, tanpa phone-frame (frame palsu cuma memakan layar HP asli).

   Tema terang tetap default seperti mockup — lebih terbaca di bawah cahaya
   terang. Tema gelap tetap ada lewat tombol.
   ============================================================================ */

:root {
  --bg: #f7f5f0;
  --surface: #ffffff;
  --surface-2: #eee9e0;
  --line: #e5dfd3;
  --line-strong: #d9d1c2;
  --ink: #29251f;
  --muted: #6b6358;
  --faint: #9c9284;
  --copper: #b15c18;
  --copper-bri: #c8712b;
  --copper-soft: rgba(177, 92, 24, 0.1);
  --copper-soft-2: rgba(177, 92, 24, 0.17);
  --user-bub: #efe7d9;
  --logo-a: #ce7c2e;
  --logo-b: #8a3d05;
  --danger: #c05a3c;
  --danger-soft: rgba(192, 90, 60, 0.12);
  /* Hijau zaitun tumpul — cukup untuk menandai "aman/selesai" tanpa berteriak
     di sebelah copper. Palet mockup hanya punya --danger; ini tambahan. */
  --ok: #5c7a4a;
  --ok-soft: rgba(92, 122, 74, 0.12);

  --fdisplay: "Space Grotesk", system-ui, sans-serif;
  --fbody: "IBM Plex Sans", system-ui, sans-serif;
  --fmono: "IBM Plex Mono", ui-monospace, monospace;

  --shadow-input: 0 1px 2px rgba(40, 32, 20, 0.05), 0 8px 28px -14px rgba(40, 32, 20, 0.22);
  --shadow-pop: 0 20px 48px -22px rgba(40, 32, 20, 0.34);
}

html[data-theme="dark"] {
  --bg: #1c1a16;
  --surface: #26231e;
  --surface-2: #2f2a24;
  --line: #37312a;
  --line-strong: #443d34;
  --ink: #ece6dc;
  --muted: #a69c8e;
  --faint: #786f63;
  --copper: #d6863e;
  --copper-bri: #e59f5b;
  --copper-soft: rgba(214, 134, 62, 0.14);
  --copper-soft-2: rgba(214, 134, 62, 0.22);
  --user-bub: #322c25;
  --danger: #d8785a;
  --danger-soft: rgba(216, 120, 90, 0.16);
  --ok: #86a96f;
  --ok-soft: rgba(134, 169, 111, 0.16);
  --shadow-input: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 30px -14px rgba(0, 0, 0, 0.6);
  --shadow-pop: 0 22px 50px -20px rgba(0, 0, 0, 0.7);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--fbody);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s ease, color 0.3s ease;
  /* Fase 1 satu pengguna sekaligus; sengaja tidak boleh zoom-geser sembarangan
     supaya tombol besar tetap di tempatnya saat dipakai sambil jalan. */
  overscroll-behavior-y: contain;
}

button {
  font-family: inherit;
  cursor: pointer;
}

::selection {
  background: var(--copper-soft-2);
}

:focus-visible {
  outline: 2px solid var(--copper);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ===== kerangka ===== */
.app {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px clamp(14px, 4vw, 22px);
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 20;
}

.logo {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  flex: none;
  display: grid;
  place-items: center;
  color: #fff;
  font-family: var(--fdisplay);
  font-weight: 700;
  font-size: 18px;
  background: linear-gradient(150deg, var(--logo-a), var(--logo-b));
  box-shadow: 0 2px 8px -2px rgba(138, 61, 5, 0.5);
}

.brand-t {
  font-family: var(--fdisplay);
  font-weight: 700;
  font-size: 15px;
  line-height: 1.1;
}

.brand-s {
  font-size: 10.5px;
  color: var(--muted);
  font-family: var(--fmono);
  letter-spacing: 0.02em;
}

.spacer {
  flex: 1;
}

.icbtn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  transition: 0.15s;
}
.icbtn:hover {
  background: var(--surface-2);
  color: var(--ink);
}
.icbtn svg {
  width: 19px;
  height: 19px;
}

.main {
  flex: 1;
  min-height: 0;
  width: 100%;
  max-width: 620px;
  margin: 0 auto;
  padding: 18px clamp(14px, 4vw, 22px) 40px;
}

.screen {
  display: none;
  animation: rise 0.32s ease both;
}
.screen.on {
  display: block;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ===== langkah / progress ===== */
.steps {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--fmono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 16px;
}
.steps i {
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: var(--line-strong);
  transition: background 0.3s;
}
.steps i.done {
  background: var(--copper);
}
.steps i.now {
  background: var(--copper);
  animation: pulse-bar 1.6s ease-in-out infinite;
}
@keyframes pulse-bar {
  50% {
    opacity: 0.45;
  }
}

/* ===== hero ===== */
.hero {
  text-align: center;
  padding: 22px 0 6px;
}
.hero-av {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  color: #fff;
  font-family: var(--fdisplay);
  font-weight: 700;
  font-size: 36px;
  background: linear-gradient(150deg, var(--logo-a), var(--logo-b));
  box-shadow: 0 8px 26px -8px rgba(138, 61, 5, 0.55);
  margin: 0 auto 20px;
  position: relative;
}
.hero-av::after {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 26px;
  border: 1px solid var(--copper-soft-2);
  opacity: 0.6;
}
.hero-h {
  font-family: var(--fdisplay);
  font-weight: 700;
  font-size: clamp(24px, 6vw, 30px);
  letter-spacing: -0.5px;
  margin: 0;
}
.hero-p {
  color: var(--muted);
  font-size: 14.5px;
  max-width: 42ch;
  margin: 12px auto 0;
  line-height: 1.6;
}

/* ===== kartu ===== */
.card {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 15px;
  padding: 15px 16px;
  margin-bottom: 12px;
}
.card-h {
  font-family: var(--fdisplay);
  font-weight: 600;
  font-size: 14.5px;
  margin: 0 0 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-h svg {
  width: 16px;
  height: 16px;
  color: var(--copper);
  flex: none;
}

.lbl {
  font-family: var(--fmono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 5px;
}

/* ===== tombol ===== */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font-size: 15px;
  font-weight: 500;
  /* Tinggi 54px, bukan 44px: dipakai sambil berdiri, sambil berjalan,
     kadang dengan tangan kotor. Target kecil = salah tekan. */
  min-height: 54px;
  padding: 0 18px;
  border-radius: 14px;
  transition: 0.16s;
}
.btn:hover:not(:disabled) {
  border-color: var(--copper);
  background: var(--copper-soft);
}
.btn:disabled {
  opacity: 0.45;
  cursor: default;
}
.btn svg {
  width: 19px;
  height: 19px;
  flex: none;
}
.btn.primary {
  background: var(--copper);
  border-color: var(--copper);
  color: #fff;
  font-weight: 600;
}
html[data-theme="dark"] .btn.primary {
  color: #1a1208;
}
.btn.primary:hover:not(:disabled) {
  background: var(--copper-bri);
  border-color: var(--copper-bri);
}
.btn.ok {
  background: var(--ok);
  border-color: var(--ok);
  color: #fff;
  font-weight: 600;
}
.btn.ok:hover:not(:disabled) {
  filter: brightness(1.08);
}
.btn.ghost {
  background: transparent;
}
.btn.sm {
  min-height: 42px;
  font-size: 13.5px;
  border-radius: 11px;
}
.btn-row {
  display: flex;
  gap: 9px;
  margin-top: 12px;
}
.btn-row .btn {
  margin: 0;
}

/* ===== perekam ===== */
.rec {
  text-align: center;
  padding: 8px 0 4px;
}
.rec-btn {
  width: 132px;
  height: 132px;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  background: var(--surface);
  color: var(--copper);
  display: grid;
  place-items: center;
  margin: 0 auto;
  transition: 0.2s;
  box-shadow: var(--shadow-input);
}
.rec-btn svg {
  width: 46px;
  height: 46px;
}
.rec-btn:hover:not(:disabled) {
  border-color: var(--copper);
}
.rec-btn:disabled {
  opacity: 0.4;
  cursor: default;
}
.rec-btn.live {
  background: var(--copper);
  border-color: var(--copper);
  color: #fff;
  animation: pulse-ring 1.5s infinite;
}
html[data-theme="dark"] .rec-btn.live {
  color: #1a1208;
}
@keyframes pulse-ring {
  0% {
    box-shadow: 0 0 0 0 var(--copper-soft-2);
  }
  70% {
    box-shadow: 0 0 0 26px transparent;
  }
  100% {
    box-shadow: 0 0 0 0 transparent;
  }
}

.rec-time {
  font-family: var(--fmono);
  font-size: 19px;
  font-weight: 600;
  color: var(--ink);
  margin-top: 14px;
  font-variant-numeric: tabular-nums;
}
.rec-hint {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
  min-height: 20px;
}

.eq {
  display: flex;
  gap: 5px;
  align-items: flex-end;
  justify-content: center;
  height: 26px;
  margin-top: 12px;
  opacity: 0;
  transition: opacity 0.2s;
}
.eq.on {
  opacity: 1;
}
.eq i {
  width: 5px;
  background: var(--copper);
  border-radius: 3px;
  height: 6px;
  animation: eq 1s infinite ease-in-out;
}
.eq i:nth-child(2) {
  animation-delay: 0.15s;
}
.eq i:nth-child(3) {
  animation-delay: 0.3s;
}
.eq i:nth-child(4) {
  animation-delay: 0.45s;
}
.eq i:nth-child(5) {
  animation-delay: 0.2s;
}
@keyframes eq {
  0%,
  100% {
    height: 6px;
  }
  50% {
    height: 24px;
  }
}

/* ===== foto ===== */
.photo-slot {
  border: 1.5px dashed var(--line-strong);
  border-radius: 14px;
  background: var(--surface-2);
  min-height: 168px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 16px;
  color: var(--muted);
  font-size: 13.5px;
  transition: 0.16s;
  width: 100%;
}
.photo-slot:hover {
  border-color: var(--copper);
  color: var(--ink);
}
.photo-slot svg {
  width: 30px;
  height: 30px;
  color: var(--copper);
  margin-bottom: 8px;
}
.photo-slot.filled {
  padding: 0;
  border-style: solid;
  overflow: hidden;
  min-height: 0;
  background: var(--surface);
}
.photo-slot img {
  width: 100%;
  display: block;
  max-height: 320px;
  object-fit: cover;
}

/* ===== gelembung Freeda ===== */
.bubble {
  display: flex;
  gap: 11px;
  margin-bottom: 16px;
}
.bubble .av {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  flex: none;
  display: grid;
  place-items: center;
  color: #fff;
  font-family: var(--fdisplay);
  font-weight: 700;
  font-size: 15px;
  background: linear-gradient(150deg, var(--logo-a), var(--logo-b));
  margin-top: 2px;
}
.bubble .txt {
  font-size: 14.5px;
  line-height: 1.65;
  padding-top: 3px;
}
.bubble .txt p {
  margin: 0 0 8px;
}
.bubble .txt p:last-child {
  margin: 0;
}
.bubble .txt b {
  font-weight: 600;
}

.typing {
  display: inline-flex;
  gap: 4px;
  padding: 8px 2px;
}
.typing i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--faint);
  animation: bl 1.2s infinite;
}
.typing i:nth-child(2) {
  animation-delay: 0.2s;
}
.typing i:nth-child(3) {
  animation-delay: 0.4s;
}
@keyframes bl {
  0%,
  60%,
  100% {
    opacity: 0.3;
    transform: translateY(0);
  }
  30% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

/* ===== chip / badge ===== */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 8px;
  padding: 4px 9px;
  font-size: 11.5px;
  font-family: var(--fmono);
  letter-spacing: 0.01em;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--muted);
  white-space: nowrap;
}
.chip.copper {
  border-color: var(--copper-soft-2);
  background: var(--copper-soft);
  color: var(--copper);
}
.chip.danger {
  border-color: var(--danger);
  background: var(--danger-soft);
  color: var(--danger);
}
.chip.ok {
  border-color: var(--ok);
  background: var(--ok-soft);
  color: var(--ok);
}

/* Label "usulan" pada kategori & severity. Prinsip desain #4: keduanya usulan,
   bukan vonis — jadi kata itu harus terbaca, bukan tersembunyi di tooltip. */
.usulan-tag {
  font-family: var(--fmono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.75;
}

/* ===== daftar temuan yang sudah direkam ===== */
.mini {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  margin-bottom: 7px;
  font-size: 13px;
}
.mini .n {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  flex: none;
  display: grid;
  place-items: center;
  background: var(--copper-soft);
  color: var(--copper);
  font-family: var(--fmono);
  font-size: 11px;
  font-weight: 600;
}
.mini .t {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
}
.mini img {
  width: 32px;
  height: 32px;
  border-radius: 7px;
  object-fit: cover;
  flex: none;
  border: 1px solid var(--line);
}

/* ===== layar validasi ===== */
.temuan {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 15px;
  padding: 0;
  margin-bottom: 12px;
  overflow: hidden;
}
.temuan-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 15px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
.temuan-head .n {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  flex: none;
  display: grid;
  place-items: center;
  background: var(--copper);
  color: #fff;
  font-family: var(--fmono);
  font-size: 12px;
  font-weight: 600;
}
html[data-theme="dark"] .temuan-head .n {
  color: #1a1208;
}
.temuan-head .j {
  flex: 1;
  font-weight: 600;
  font-size: 14.5px;
  line-height: 1.35;
}
.temuan-body {
  padding: 13px 15px;
}
.temuan img.foto {
  width: 100%;
  display: block;
  max-height: 300px;
  object-fit: cover;
  border-bottom: 1px solid var(--line);
}

/* Tiga lapis yang WAJIB ada di layar ini (prinsip desain #2):
   kata pelapor → yang terlihat di foto → deskripsi Freeda.
   Warna garis kiri membedakan sumbernya sekilas. */
.layer {
  border-left: 2.5px solid var(--line-strong);
  padding: 2px 0 2px 11px;
  margin-bottom: 12px;
}
.layer:last-child {
  margin-bottom: 0;
}
.layer .lbl {
  margin-bottom: 3px;
}
.layer p {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
}
.layer.said {
  border-left-color: var(--copper);
}
.layer.said p {
  font-style: italic;
  color: var(--ink);
}
.layer.seen {
  border-left-color: var(--faint);
}
.layer.seen p {
  color: var(--muted);
}
.layer.desc {
  border-left-color: var(--ink);
}

.warn {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  border: 1px solid var(--danger);
  background: var(--danger-soft);
  border-radius: 11px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink);
  margin-bottom: 12px;
}
.warn svg {
  width: 16px;
  height: 16px;
  color: var(--danger);
  flex: none;
  margin-top: 2px;
}
.warn.soft {
  border-color: var(--line-strong);
  background: var(--surface-2);
}
.warn.soft svg {
  color: var(--copper);
}

/* Transkrip mentah. Tidak disembunyikan di balik accordion tertutup:
   Blueprint §2 mensyaratkan pekerja bisa memeriksa apa yang BENAR-BENAR
   tertangkap, bukan cuma rangkuman rapi. Kalau harus diklik dulu, tidak
   akan pernah diklik. */
.trans {
  font-family: var(--fmono);
  font-size: 12.5px;
  line-height: 1.7;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 12px 13px;
  margin-bottom: 8px;
  white-space: pre-wrap;
  word-break: break-word;
}
.trans .seg-lbl {
  display: block;
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 4px;
}
.trans .low {
  color: var(--danger);
}

textarea.ta {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--fbody);
  font-size: 15px;
  line-height: 1.5;
  padding: 11px 13px;
  resize: vertical;
  min-height: 84px;
  outline: 0;
}
textarea.ta:focus {
  border-color: var(--copper);
  box-shadow: 0 0 0 3px var(--copper-soft);
}
textarea.ta::placeholder {
  color: var(--faint);
}

.disclaimer {
  text-align: center;
  font-size: 11.5px;
  color: var(--faint);
  margin-top: 20px;
  font-family: var(--fmono);
  line-height: 1.6;
}

/* ===== toast ===== */
.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%) translateY(120%);
  background: var(--ink);
  color: var(--bg);
  padding: 12px 18px;
  border-radius: 12px;
  font-size: 13.5px;
  max-width: min(92vw, 460px);
  box-shadow: var(--shadow-pop);
  z-index: 60;
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  line-height: 1.5;
}
.toast.on {
  transform: translateX(-50%) translateY(0);
}
.toast.bad {
  background: var(--danger);
  color: #fff;
}

.hide {
  display: none !important;
}

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