/* =========================
   GFO Profiling UI (Section + Likert Dots + Money)
   Dark mode: html[data-at-theme="dark"]
   ========================= */

.gfo-pk {
  --text: #0c1116;
  --muted: rgba(12, 17, 22, 0.62);
  --border: rgba(12, 17, 22, 0.1);
  --surface: #fff;
  --surface2: rgba(0, 0, 0, 0.02);
  --green: #00b982;
  --green2: #00785a;
  --purple: #7c3aed;
  --red: #ef4444;
  --neutral: rgba(12, 17, 22, 0.35);
  --radius: 16px;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial,
    sans-serif;
  color: var(--text);
}

html[data-at-theme="dark"] .gfo-pk {
  --text: rgba(255, 255, 255, 0.92);
  --muted: rgba(255, 255, 255, 0.62);
  --border: rgba(255, 255, 255, 0.12);
  --surface: rgba(12, 18, 26, 0.7);
  --surface2: rgba(255, 255, 255, 0.04);
  --neutral: rgba(255, 255, 255, 0.32);
}

.gfo-pk-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.gfo-pk-title {
  font-size: 28px;
  font-weight: 950;
  letter-spacing: -0.3px;
}
.gfo-pk-sub {
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted);
}
.gfo-pk-badge {
  font-weight: 900;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface2);
}

.gfo-pk-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.gfo-sec {
  padding: 18px 0;
  border-top: 1px solid var(--border);
}
.gfo-sec:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.gfo-sec__head {
  margin-bottom: 12px;
}
.gfo-sec__title {
  margin: 0;
  font-size: 16px;
  font-weight: 950;
  letter-spacing: -0.2px;
}
.gfo-sec__desc {
  margin-top: 5px;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.35;
}

.gfo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
@media (max-width: 820px) {
  .gfo-grid {
    grid-template-columns: 1fr;
  }
}

.gfo-label {
  display: block;
  font-size: 12.5px;
  font-weight: 900;
  margin-bottom: 6px;
}
.gfo-input {
  width: 100% !important;
  border: 1px solid var(--border) !important;
  background: var(--surface) !important;
  color: var(--text) !important;
  border-radius: 14px !important;
  padding: 12px 12px !important;
  outline: none !important;
}
.gfo-input:focus {
  border-color: rgba(0, 185, 130, 0.55) !important;
  box-shadow: 0 0 0 4px rgba(0, 185, 130, 0.12) !important;
}
.gfo-help {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}
.gfo-err {
  margin-top: 6px;
  font-size: 12.5px;
  font-weight: 800;
  color: #ef4444;
}

.gfo-qwrap {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.gfo-q {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.gfo-q:last-child {
  border-bottom: 0;
}
.gfo-q__title {
  font-weight: 900;
  font-size: 13px;
  line-height: 1.35;
  margin-bottom: 10px;
  color: var(--text);
}

.gfo-scale {
  display: flex;
  align-items: center;
  gap: 10px;
}
@media (max-width: 680px) {
  .gfo-scale {
    grid-template-columns: 70px 1fr 90px;
  }
}

.gfo-scale__end {
  font-weight: 900;
  font-size: 12.5px;
  color: var(--muted);
}
.gfo-scale__end.is-agree {
  color: rgba(0, 185, 130, 0.95);
}
.gfo-scale__end.is-disagree {
  color: var(--red);
}

.gfo-scale__dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
}

.gfo-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.gfo-dot input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.gfo-dot__ui {
  width: var(--s);
  height: var(--s);
  border-radius: 999px;
  border: 3px solid currentColor;
  background: transparent;
  transition: transform 0.12s ease, background 0.12s ease, box-shadow 0.12s ease;
}

.gfo-dot.is-agree {
  color: var(--green);
}
.gfo-dot.is-disagree {
  color: var(--red);
}
.gfo-dot.is-neutral {
  color: var(--neutral);
}

.gfo-dot input:checked + .gfo-dot__ui {
  background: currentColor;
  box-shadow: 0 0 0 6px rgba(0, 0, 0, 0.06);
}
html[data-at-theme="dark"] .gfo-dot input:checked + .gfo-dot__ui {
  box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.06);
}
.gfo-dot:hover .gfo-dot__ui {
  transform: scale(1.05);
}
.gfo-dot input:focus + .gfo-dot__ui {
  box-shadow: 0 0 0 6px rgba(0, 185, 130, 0.14);
}

/* footer */
.gfo-footer {
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gfo-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: fit-content;
  padding: 12px 16px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: linear-gradient(90deg, var(--green2), var(--green));
  color: #fff;
  font-weight: 950;
  cursor: pointer;
  box-shadow: 0 14px 34px rgba(0, 185, 130, 0.18);
}
html[data-at-theme="dark"] .gfo-btn {
  border-color: rgba(255, 255, 255, 0.1);
}

.gfo-footnote {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.35;
}

/* sr-only */
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 480px) {
  .gfo-scale__dots {
    gap: 8px;
  }
}

/* Spinner tombol (versi baru: .gfo-btn + .gfo-btn__spin) */
.gfo-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.gfo-btn__spin {
  display: none;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: gfoSpin 0.85s linear infinite;
  opacity: 0.9;
}

.gfo-btn.is-loading .gfo-btn__spin {
  display: inline-block;
}

.gfo-btn.is-loading .gfo-btn__txt {
  opacity: 0.75;
}

@keyframes gfoSpin {
  to {
    transform: rotate(360deg);
  }
}

/* =========================
   RESULT VIEW (Hasil Profiling)
   Scope: .gfo-pk-result
   Dark mode: html[data-at-theme="dark"]
   ========================= */

.gfo-pk-result {
  --text: #0c1116;
  --muted: rgba(12, 17, 22, 0.62);
  --border: rgba(12, 17, 22, 0.1);
  --surface: #ffffff;
  --surface2: rgba(0, 0, 0, 0.02);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.06);
  --green: #00b982;
  --green2: #00785a;
  --red: #ef4444;

  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial,
    sans-serif;
  color: var(--text);
}

html[data-at-theme="dark"] .gfo-pk-result {
  --text: rgba(255, 255, 255, 0.92);
  --muted: rgba(255, 255, 255, 0.62);
  --border: rgba(255, 255, 255, 0.12);
  --surface: rgba(12, 18, 26, 0.7);
  --surface2: rgba(255, 255, 255, 0.04);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

.gfo-pk-result .gfo-pk-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 18px;
}

@media (max-width: 680px) {
  .gfo-pk-result .gfo-pk-card {
    padding: 14px;
    border-radius: 16px;
  }
}

/* header */
.gfo-pk-result .gfo-pk-result-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.gfo-pk-result .gfo-pk-h {
  margin: 0;
  font-size: 20px;
  font-weight: 950;
  letter-spacing: -0.2px;
}

.gfo-pk-result .gfo-pk-muted {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

/* status badge (pakai --st dari inline style) */
.gfo-pk-result .gfo-pk-status {
  --st: var(--green);
  display: inline-flex;
  align-items: center;
  gap: 8px;

  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--st) 40%, transparent);
  background: color-mix(in srgb, var(--st) 12%, transparent);
  font-weight: 950;
  font-size: 13px;
  white-space: nowrap;
}
.gfo-pk-result .gfo-pk-status::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--st);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--st) 18%, transparent);
}

/* pill row */
.gfo-pk-result .gfo-pk-pillrow {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0 14px;
}

.gfo-pk-result .gfo-pk-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 999px;
  background: var(--surface2);
  border: 1px solid var(--border);
  font-size: 13px;
  line-height: 1.2;
}
.gfo-pk-result .gfo-pk-pill b {
  font-weight: 950;
}

/* grids */
.gfo-pk-result .gfo-pk-4grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 8px;
}

.gfo-pk-result .gfo-pk-2grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 10px;
}

@media (max-width: 980px) {
  .gfo-pk-result .gfo-pk-4grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 640px) {
  .gfo-pk-result .gfo-pk-4grid,
  .gfo-pk-result .gfo-pk-2grid {
    grid-template-columns: 1fr;
  }
}

/* mini cards */
.gfo-pk-result .gfo-pk-mini {
  border: 1px solid var(--border);
  background: var(--surface2);
  border-radius: 16px;
  padding: 12px;
}

.gfo-pk-result .gfo-pk-mini-t {
  font-size: 12px;
  font-weight: 950;
  color: var(--muted);
  letter-spacing: 0.2px;
  text-transform: uppercase;
}

.gfo-pk-result .gfo-pk-mini-v {
  margin-top: 8px;
  font-size: 18px;
  font-weight: 950;
  letter-spacing: -0.2px;
}

.gfo-pk-result .gfo-pk-mini-s {
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.35;
}

/* separators */
.gfo-pk-result .gfo-pk-sep {
  height: 1px;
  background: var(--border);
  margin: 14px 0;
}

/* heading kecil di bawah (Diagnosis / Lot Guidance) */
.gfo-pk-result .gfo-pk-h[style*="font-size:16px"] {
  font-size: 16px !important;
  margin: 0;
}

/* make long text nicer */
.gfo-pk-result .gfo-pk-muted {
  word-break: break-word;
}

/* optional: highlight key words */
.gfo-pk-result .gfo-pk-pill b,
.gfo-pk-result .gfo-pk-mini-v {
  color: var(--text);
}
