/* ---------------------------------------------
   DiPStrategy -- Tools: Cek Keterbacaan Teks
   style/tools-legibility.css
   Dipakai bersama style/tools-calculator.css (shell .tc-*)
   --------------------------------------------- */

/* ── Step: pemilihan konteks ─────────────────── */
.lg-step {
  margin-bottom: 24px;
}

.lg-step-label {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(9,53,100,0.55);
  margin-bottom: 10px;
}

.lg-step-label span {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 300;
  font-size: 12px;
  color: rgba(9,53,100,0.4);
}

.lg-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.lg-chip {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 13px;
  color: var(--navy);
  background: #fff;
  border: 1px solid rgba(9,53,100,0.15);
  border-radius: 999px;
  padding: 10px 18px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.lg-chip:hover { border-color: var(--navy); }

.lg-chip.active {
  background: var(--navy);
  color: var(--lime);
  border-color: var(--navy);
}

/* ── Kartu utama: kontrol + preview ──────────── */
.tc-card.lg-card {
  grid-template-columns: minmax(0,0.92fr) minmax(0,1.08fr);
  align-items: start;
}

@media (max-width: 900px) {
  .tc-card.lg-card { grid-template-columns: 1fr; }
}

.lg-ctrl-sub {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--lime);
  margin: 26px 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}

.lg-ctrl-sub:first-child { margin-top: 0; }

.lg-grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}

@media (max-width: 480px) {
  .lg-grid2 { grid-template-columns: 1fr; }
}

/* Warna: swatch + hex */
.lg-color-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lg-swatch {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 10px;
  background: none;
  cursor: pointer;
  overflow: hidden;
}

.lg-swatch::-webkit-color-swatch-wrapper { padding: 2px; }
.lg-swatch::-webkit-color-swatch { border: none; border-radius: 7px; }
.lg-swatch::-moz-color-swatch { border: none; border-radius: 7px; }

.lg-color-row .tc-input-wrap { flex: 1 1 auto; min-width: 0; }

.lg-color-row input[type="text"] {
  font-family: 'Courier New', monospace;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Slider */
.lg-range-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.lg-range-head label { margin-bottom: 0 !important; }

.lg-range-val {
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 13px;
  color: var(--lime);
  white-space: nowrap;
}

input[type="range"].lg-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 22px;
  background: transparent;
  cursor: pointer;
  margin: 0;
}

input[type="range"].lg-range::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background: rgba(255,255,255,0.18);
}

input[type="range"].lg-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  margin-top: -6px;
  border: none;
  border-radius: 50%;
  background: var(--lime);
}

input[type="range"].lg-range::-moz-range-track {
  height: 4px;
  border-radius: 999px;
  background: rgba(255,255,255,0.18);
}

input[type="range"].lg-range::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border: none;
  border-radius: 50%;
  background: var(--lime);
}

input[type="range"].lg-range:focus-visible { outline: 2px solid var(--lime); outline-offset: 4px; }

/* Toggle kecil (uppercase, align) */
.lg-seg {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.lg-seg button {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 400;
  color: rgba(255,255,255,0.7);
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  padding: 9px 13px;
  cursor: pointer;
  transition: background 0.18s, color 0.18s, border-color 0.18s;
}

.lg-seg button:hover { border-color: rgba(222,255,45,0.5); }

.lg-seg button.active {
  background: var(--lime);
  border-color: var(--lime);
  color: var(--navy);
  font-weight: 500;
}

.lg-file-btn {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 400;
  color: rgba(255,255,255,0.7);
  background: rgba(255,255,255,0.06);
  border: 1px dashed rgba(255,255,255,0.25);
  border-radius: 8px;
  padding: 11px 15px;
  cursor: pointer;
}

.lg-file-btn:hover { border-color: var(--lime); color: #fff; }
.lg-file-btn input { display: none; }

.lg-note {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 300;
  line-height: 1.6;
  color: rgba(255,255,255,0.4);
  margin-top: 8px;
}

/* ── Preview ─────────────────────────────────── */
/* Kolom kontrol jauh lebih tinggi daripada preview, jadi preview dibuat
   menempel saat digulir — percuma mengatur slider kalau hasilnya sudah di
   luar layar. Sticky butuh ancestor tanpa overflow:hidden, sementara
   .tc-card memakainya untuk mengunci pattern di sudut membulat; radius-nya
   dipindahkan ke ::before supaya overflow boleh visible. */
.tc-card.lg-card { overflow: visible; }
.tc-card.lg-card::before { border-radius: 20px; }

.lg-preview-col { position: relative; }

/* base.css memberi `body { overflow-x: hidden }`, dan itu menjadikan body
   scroll container sehingga position:sticky di dalamnya mati. `clip` menahan
   luapan horizontal yang sama tanpa membuat scroll container. Aman dibatasi
   di sini karena file ini hanya dimuat di halaman tools ini; browser lama
   yang tidak mengenal `clip` cukup kehilangan efek sticky-nya. */
body { overflow-x: clip; }

/* .tc-body menahan padding 56px di semua breakpoint, menyisakan ~207px di HP.
   Untuk kalkulator itu masih cukup; untuk halaman ini tidak — preview harus
   bisa menampilkan lebar kolom teks yang sebenarnya. Aturan ini hanya
   berlaku di sini karena file CSS-nya cuma dimuat di halaman ini. */
@media (max-width: 620px) {
  .tc-body { padding-left: 18px; padding-right: 18px; }
}

/* Selektor sengaja dibuat lebih spesifik: tools-calculator.css punya
   `.tc-card > div { position: relative }` (class + tipe) yang mengalahkan
   `.lg-preview-col` biasa. */
@media (min-width: 901px) {
  .tc-card.lg-card > .lg-preview-col {
    position: sticky;
    top: 96px;          /* nav fixed setinggi 72px + jeda */
    z-index: 1;
  }
}

.lg-preview {
  position: relative;
  width: 100%;
  min-height: 360px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.14);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px 24px;
}

/* Site menyediakan toggle perbesar teks (html[data-fs="1"] body { zoom:1.25 }).
   Preview harus tetap presisi dalam px → balikkan zoom-nya. */
html[data-fs="1"] .lg-preview { zoom: 0.8; }

.lg-preview-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.lg-preview-text {
  position: relative;
  z-index: 1;
  width: 100%;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.lg-preview-text p { margin: 0 0 0.85em; }
.lg-preview-text p:last-child { margin-bottom: 0; }

/* HC mode situs memaksa semua teks jadi putih !important. Preview wajib
   mempertahankan warna pilihan user — itu seluruh gunanya halaman ini. */
html[data-hc="1"] .lg-preview-text,
html[data-hc="1"] .lg-preview-text * {
  color: var(--lg-fg) !important;
}

.lg-sim-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
}

.lg-sim-label {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  margin-right: 2px;
}

.lg-sim-btn {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 400;
  color: rgba(255,255,255,0.7);
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 999px;
  padding: 7px 14px;
  cursor: pointer;
  transition: background 0.18s, color 0.18s, border-color 0.18s;
}

.lg-sim-btn:hover { border-color: rgba(222,255,45,0.5); }

.lg-sim-btn.active {
  background: rgba(222,255,45,0.16);
  border-color: var(--lime);
  color: var(--lime);
}

.lg-sim-hint {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 300;
  line-height: 1.6;
  color: rgba(255,255,255,0.42);
  margin-top: 10px;
}

/* ── Skor ────────────────────────────────────── */
.lg-verdict-card {
  margin-top: 28px;
  background: #fff;
  border-radius: 20px;
  padding: 32px;
}

@media (max-width: 560px) {
  .lg-verdict-card { padding: 22px; }
}

.lg-verdict-top {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(9,53,100,0.1);
}

.lg-ring {
  flex: 0 0 auto;
  width: 104px;
  height: 104px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--lg-ring-color) calc(var(--lg-ring-pct) * 1%), rgba(9,53,100,0.1) 0);
}

.lg-ring-inner {
  width: 82px;
  height: 82px;
  border-radius: 50%;
  background: #fff;
  display: grid;
  place-items: center;
  text-align: center;
}

.lg-ring-num {
  font-family: var(--font-headline);
  font-weight: 900;
  font-size: 28px;
  line-height: 1;
  color: var(--navy);
}

.lg-ring-max {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 400;
  color: rgba(9,53,100,0.45);
  margin-top: 2px;
}

.lg-verdict-txt { flex: 1 1 240px; min-width: 0; }

.lg-verdict-head {
  font-family: var(--font-headline);
  font-weight: 900;
  font-size: 22px;
  line-height: 1.25;
  color: var(--navy);
  margin-bottom: 8px;
}

.lg-verdict-sub {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 300;
  line-height: 1.65;
  color: rgba(9,53,100,0.7);
}

/* ── Daftar pemeriksaan ──────────────────────── */
.lg-checks { margin-top: 6px; }

.lg-check {
  display: grid;
  grid-template-columns: 10px minmax(0,1fr) auto;
  gap: 0 14px;
  align-items: start;
  padding: 18px 0;
  border-bottom: 1px solid rgba(9,53,100,0.08);
}

.lg-check:last-child { border-bottom: none; }

.lg-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 5px;
}

.lg-dot.good { background: #4ba82e; }
.lg-dot.warn { background: #e0a000; }
.lg-dot.bad  { background: #d93f3f; }

.lg-check-name {
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 14px;
  color: var(--navy);
  margin-bottom: 4px;
}

.lg-check-note {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 300;
  line-height: 1.65;
  color: rgba(9,53,100,0.68);
}

.lg-check-note b { font-weight: 500; color: var(--navy); }

.lg-check-val {
  font-family: var(--font-headline);
  font-weight: 900;
  font-size: 15px;
  text-align: right;
  white-space: nowrap;
  color: var(--navy);
}

.lg-check-val small {
  display: block;
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(9,53,100,0.45);
  margin-top: 3px;
}

@media (max-width: 560px) {
  .lg-check { grid-template-columns: 10px minmax(0,1fr); }
  .lg-check-val { grid-column: 2; text-align: left; margin-top: 8px; }
  .lg-check-val small { display: inline; margin-left: 6px; }
}

/* Saran perbaikan warna */
.lg-fix {
  margin-top: 10px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  background: rgba(9,53,100,0.04);
  border-radius: 10px;
  padding: 12px 14px;
}

.lg-fix-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  font-weight: 700;
  color: var(--navy);
  text-transform: uppercase;
}

.lg-fix-dot {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  border: 1px solid rgba(9,53,100,0.2);
}

.lg-fix-txt {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 300;
  line-height: 1.6;
  color: rgba(9,53,100,0.7);
  flex: 1 1 160px;
}

.lg-fix-btn {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  color: var(--navy);
  background: var(--lime);
  border: none;
  border-radius: 999px;
  padding: 9px 16px;
  cursor: pointer;
  white-space: nowrap;
}

.lg-fix-btn:hover { background: #f0ff50; }

/* ── Output CSS ──────────────────────────────── */
.lg-css-card {
  margin-top: 20px;
  background: #06243f;
  border-radius: 16px;
  padding: 24px 26px;
}

.lg-css-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.lg-css-head h3 {
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 14px;
  color: #fff;
}

.lg-copy-btn {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  color: var(--navy);
  background: var(--lime);
  border: none;
  border-radius: 999px;
  padding: 8px 16px;
  cursor: pointer;
}

.lg-copy-btn:hover { background: #f0ff50; }

.lg-css-out {
  font-family: 'Courier New', monospace;
  font-size: 12.5px;
  line-height: 1.75;
  color: rgba(255,255,255,0.8);
  white-space: pre;
  overflow-x: auto;
  margin: 0;
}

html[data-hc="1"] .lg-css-card,
html[data-hc="1"] .lg-css-card * { color: #fff !important; }

html[data-hc="1"] .lg-verdict-card,
html[data-hc="1"] .lg-verdict-card * { color: #000 !important; }

html[data-hc="1"] .lg-chip { color: #000 !important; }
html[data-hc="1"] .lg-chip.active { color: #fff !important; }
