/* ============================================================
   bengkelweb.my.id — tema "landing gelap-hijau"
   Latar hijau-hitam + grid halus, aksen mint, tombol hijau terang.
   ============================================================ */
:root {
  --bg0: #060a08;
  --bg1: #0a100d;
  --panel: #0d1411;
  --panel2: #090e0b;
  --line: #1c2a23;
  --line2: #26382d;
  --mint: #5eead4;
  --mint-dim: #2dd4bf;
  --green: #4ade80;
  --green-deep: #052e22;
  --amber: #fbbf24;
  --orange: #fb923c;
  --text: #eef4f0;
  --muted: #9db3a7;
  --dim: #67796e;
  --danger: #f87171;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--text);
  background:
    radial-gradient(1100px 520px at 72% -8%, rgba(94, 234, 212, 0.07), transparent 62%),
    radial-gradient(900px 500px at 8% 12%, rgba(74, 222, 128, 0.05), transparent 60%),
    var(--bg0);
  min-height: 100vh;
  color-scheme: dark;
}

/* pola grid halus di seluruh latar */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(rgba(148, 210, 189, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 210, 189, 0.05) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse 120% 70% at 50% 0%, #000 25%, transparent 85%);
          mask-image: radial-gradient(ellipse 120% 70% at 50% 0%, #000 25%, transparent 85%);
}

header, main, footer { position: relative; z-index: 1; }

.hidden { display: none !important; }

.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
p { line-height: 1.65; }
a { color: var(--mint); }
code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: #0a100c;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 6px;
  color: var(--mint);
}

/* ---------- TOPBAR ---------- */
.topbar {
  border-bottom: 1px solid var(--line);
  background: rgba(6, 10, 8, 0.82);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-in {
  max-width: 1220px;
  margin: 0 auto;
  padding: 12px 22px;
  display: flex;
  align-items: center;
  gap: 18px;
}
.brand {
  font-family: var(--mono);
  font-weight: 700;
  color: var(--mint);
  text-decoration: none;
  font-size: 0.98rem;
  letter-spacing: -0.01em;
  margin-right: auto;
}
.topnav { display: flex; gap: 4px; }
.topnav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 8px;
}
.topnav a:hover { color: var(--text); background: rgba(94, 234, 212, 0.08); }

/* indikator status Firebase */
.fb-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 0.74rem;
  padding: 6px 12px;
  border: 1px solid var(--line2);
  border-radius: 999px;
  color: var(--muted);
  white-space: nowrap;
}
.fb-status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); flex: none; }
.fb-status.is-on  { color: var(--green); border-color: #1e4d34; }
.fb-status.is-on .dot { background: var(--green); box-shadow: 0 0 8px var(--green); }
.fb-status.is-off { color: var(--amber); border-color: #4d3d1c; }
.fb-status.is-off .dot { background: var(--amber); }
.fb-status.is-err { color: var(--danger); border-color: #5b2323; }
.fb-status.is-err .dot { background: var(--danger); }

.authbox { display: flex; align-items: center; }
.auth-note { font-size: 0.8rem; color: var(--dim); }

/* chip user */
.uchip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line2);
  background: #0c130f;
  border-radius: 999px;
  padding: 4px 6px 4px 4px;
}
.uchip img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.uname { font-size: 0.84rem; font-weight: 600; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  background: #12241c;
  border: 1px solid var(--line2);
  color: var(--mint);
  border-radius: 5px;
  padding: 2px 7px;
}
.badge.admin { background: var(--green); border-color: var(--green); color: #04170c; }

/* ---------- LAYOUT ---------- */
.wrap { max-width: 1220px; margin: 0 auto; padding: 0 22px 60px; }

/* ---------- HERO ---------- */
.hero {
  display: grid;
  grid-template-columns: 1.65fr 1fr;
  gap: 34px;
  align-items: center;
  padding: 64px 0 46px;
}
.kicker {
  font-family: var(--mono);
  color: var(--mint);
  font-weight: 700;
  font-size: 0.95rem;
  margin: 0 0 14px;
}
.hero h1 {
  margin: 0 0 20px;
  font-size: clamp(2.5rem, 5.4vw, 4.15rem);
  line-height: 1.04;
  letter-spacing: -0.032em;
  font-weight: 800;
  text-wrap: balance;
}
.lede { color: var(--muted); font-size: 1.06rem; max-width: 62ch; margin: 0; }
.lede strong { color: var(--text); }

.hero-card {
  border: 1px solid var(--line2);
  background: linear-gradient(180deg, #0e1613, #0a100d);
  border-radius: 10px;
  padding: 26px 26px 28px;
  box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.38);
  align-self: center;
}
.hero-card h3 { margin: 0 0 10px; color: var(--mint); font-size: 1.02rem; }
.hero-card p { margin: 0; color: var(--muted); font-size: 0.94rem; }

/* ---------- KARTU / PANEL ---------- */
.card, .panel {
  background: linear-gradient(180deg, #0e1512, #0b110e);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 26px;
  margin: 22px 0;
}
.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}
.panel-head h2, .card h2 { margin: 0; font-size: 1.28rem; letter-spacing: -0.015em; }
.input-tag {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--dim);
  white-space: nowrap;
}

/* ---------- WORKSPACE 2 KOLOM ---------- */
.workspace {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  align-items: start;
  margin: 6px 0 8px;
}
.form-panel, .out-panel { margin: 0; display: flex; flex-direction: column; }
.out-panel { padding: 0; overflow: hidden; position: sticky; top: 76px; }
.out-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(94, 234, 212, 0.03);
}
.file-label {
  font-family: var(--mono);
  font-weight: 700;
  color: var(--orange);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
}
.sq { width: 11px; height: 11px; border-radius: 2.5px; background: var(--orange); display: inline-block; }
.out-btns { display: flex; gap: 8px; }
.code {
  flex: 1;
  min-height: 520px;
  background: #04070a;
  border: 0;
  border-radius: 0;
  font-family: var(--mono);
  font-size: 0.87rem;
  line-height: 1.75;
  color: #c9d6cf;
  padding: 20px 22px;
  resize: vertical;
}
.code:focus { outline: none; }

/* ---------- FORM ---------- */
.field { margin: 18px 0; }
.flabel {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
  font-weight: 700;
  font-size: 0.96rem;
}
.flabel label { cursor: pointer; }
.tag {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--dim);
  letter-spacing: 0.04em;
}
.tag.req { color: var(--amber); }
.hint { color: var(--dim); font-size: 0.83rem; margin: 8px 0 0; line-height: 1.6; }

input[type="text"], input[type="url"], input[type="password"],
select, textarea {
  width: 100%;
  background: #080d0a;
  border: 1px solid var(--line2);
  border-radius: 8px;
  color: var(--text);
  padding: 12px 14px;
  font-size: 0.95rem;
  font-family: var(--sans);
  transition: border-color 0.15s, box-shadow 0.15s;
}
input::placeholder, textarea::placeholder { color: #4d5f54; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--mint);
  box-shadow: 0 0 0 3px rgba(94, 234, 212, 0.12);
}
select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239db3a7' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
  cursor: pointer;
}
textarea { resize: vertical; min-height: 0; }
input[type="file"] { padding: 10px 12px; cursor: pointer; }
input[type="file"]::file-selector-button {
  background: #1a2620;
  color: var(--text);
  border: 1px solid var(--line2);
  border-radius: 6px;
  padding: 8px 14px;
  margin-right: 12px;
  font-weight: 600;
  cursor: pointer;
}
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid2 .field { margin: 0; }

/* segmented control (mode + sumber gambar) */
.seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--line2);
  border-radius: 9px;
  overflow: hidden;
  background: #080d0a;
}
.seg-sm .segbtn { padding: 10px; font-size: 0.9rem; }
.segbtn {
  padding: 14px;
  font-weight: 700;
  font-size: 1rem;
  color: var(--muted);
  background: transparent;
  border: 0;
  cursor: pointer;
  font-family: var(--sans);
  transition: background 0.15s, color 0.15s;
}
.segbtn + .segbtn { border-left: 1px solid var(--line2); }
.segbtn:hover:not(.active) { color: var(--text); background: rgba(94, 234, 212, 0.05); }
.segbtn.active { background: var(--mint); color: #052e2b; }

/* ---------- TOMBOL ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 9px;
  border: 1px solid var(--line2);
  background: #101714;
  color: var(--text);
  font-weight: 700;
  font-size: 0.95rem;
  font-family: var(--sans);
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.08s, box-shadow 0.15s, background 0.15s;
}
.btn:hover:not(:disabled) { border-color: #35503f; background: #14201a; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn.primary {
  background: var(--green);
  border-color: var(--green);
  color: #04170c;
  box-shadow: 0 6px 22px rgba(74, 222, 128, 0.22);
}
.btn.primary:hover:not(:disabled) { background: #5ce88f; border-color: #5ce88f; }
.btn.small { padding: 8px 14px; font-size: 0.84rem; border-radius: 7px; }
.btn.danger { border-color: #5b2323; color: var(--danger); background: #150d0d; }
.btn.danger:hover:not(:disabled) { background: #1e1111; border-color: #7a2e2e; }
.btn.ghost { background: transparent; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }

.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.form-actions { flex-direction: column; margin-top: 24px; }
.form-actions .btn { padding: 15px 22px; font-size: 1.02rem; }

/* ---------- REFERENSI PENDUKUNG ---------- */
.refs { margin: 20px 0 6px; }
.refs-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.refs-title { font-weight: 700; font-size: 0.95rem; }
.ref-item {
  border: 1px dashed var(--line2);
  border-radius: 9px;
  padding: 12px;
  margin-bottom: 10px;
  background: rgba(94, 234, 212, 0.02);
}
.ref-item .row { display: flex; gap: 8px; align-items: center; }
.ref-item .row img {
  width: 44px; height: 44px; object-fit: cover; border-radius: 7px;
  border: 1px solid var(--line2); flex: none;
}
.ref-item .row input[type="text"] { flex: 1; }
.fname { font-family: var(--mono); font-size: 0.76rem; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 46%; }

/* pratinjau gambar utama */
.preview-wrap { margin: 12px 0; }
.preview-wrap img {
  max-width: 100%; max-height: 220px; border-radius: 9px;
  border: 1px solid var(--line2); display: block;
}
.preview-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.preview-meta span { font-family: var(--mono); font-size: 0.78rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* catatan */
.honest, .warn {
  border-radius: 9px;
  padding: 13px 15px;
  font-size: 0.86rem;
  line-height: 1.65;
  margin: 18px 0 4px;
}
.honest {
  background: rgba(94, 234, 212, 0.06);
  border: 1px solid #1e4438;
  color: #b9d9cc;
}
.warn {
  background: rgba(251, 191, 36, 0.06);
  border: 1px solid #4d3d1c;
  color: #d8c391;
}

/* ---------- AKUN & ADMIN ---------- */
.akun-grid { display: grid; grid-template-columns: 330px 1fr; gap: 18px; margin: 18px 0 6px; }
.login-card {
  border: 1px solid var(--line2);
  border-radius: 10px;
  padding: 20px;
  background: rgba(94, 234, 212, 0.03);
  align-self: start;
}
.login-card h3 { margin: 0 0 12px; font-size: 1.05rem; }
.login-box { margin: 6px 0 14px; }
.login-box .btn.primary { width: 100%; }
.login-box .uchip { width: 100%; justify-content: space-between; border-radius: 12px; padding: 6px 8px 6px 6px; }
.modes { display: flex; flex-direction: column; gap: 10px; }
.mode {
  display: flex; gap: 14px; align-items: flex-start;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 15px 17px;
  background: var(--panel2);
}
.mode .mnum {
  font-family: var(--mono);
  color: var(--mint);
  font-weight: 700;
  font-size: 0.85rem;
  border: 1px solid var(--line2);
  border-radius: 7px;
  padding: 5px 9px;
  flex: none;
}
.mode h4 { margin: 2px 0 6px; font-size: 0.98rem; }
.mode p { margin: 0; color: var(--muted); font-size: 0.88rem; }

/* statistik admin */
.statgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 16px 0; }
.stat {
  border: 1px solid var(--line2);
  border-radius: 10px;
  padding: 16px;
  background: var(--panel2);
  text-align: center;
}
.stat .n { font-size: 1.9rem; font-weight: 800; color: var(--mint); letter-spacing: -0.02em; }
.stat .l { color: var(--muted); font-size: 0.82rem; margin-top: 4px; }
.admintbl { width: 100%; border-collapse: collapse; font-size: 0.88rem; margin-top: 6px; }
.admintbl th, .admintbl td {
  text-align: left; padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.admintbl th { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.07em; color: var(--dim); text-transform: uppercase; }
.admintbl td { color: var(--text); }
.uava { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; vertical-align: middle; margin-right: 8px; }

/* history */
.hist-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  margin: 12px 0;
  background: var(--panel2);
}
.hrow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.htitle { font-weight: 700; }
.hmeta { font-family: var(--mono); font-size: 0.74rem; color: var(--dim); margin-top: 6px; }
.empty { color: var(--dim); font-size: 0.9rem; }

/* ---------- JALANKAN DENGAN AI ---------- */
.ai-switch { display: flex; gap: 10px; flex-wrap: wrap; margin: 14px 0 6px; }
.radio {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--line2);
  border-radius: 9px;
  padding: 10px 16px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.92rem;
  background: #0a0f0c;
}
.radio:hover { border-color: #35503f; }
.radio input { accent-color: var(--green); }
.response {
  background: #04070a;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 16px 18px;
  font-family: var(--mono);
  font-size: 0.84rem;
  line-height: 1.7;
  color: #c9d6cf;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 420px;
  overflow: auto;
}
#aiImageWrap img { max-width: 100%; border-radius: 10px; border: 1px solid var(--line2); margin-top: 10px; }

/* ---------- PENGATURAN API ---------- */
.keyrow {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  margin: 12px 0;
  background: var(--panel2);
}
.keyrow .field { margin: 0; }
.keyrow .grow { flex: 1 1 220px; }
.keyrow .field span { display: block; font-size: 0.82rem; font-weight: 700; margin-bottom: 6px; color: var(--muted); }
.status {
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--dim);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 11px;
  white-space: nowrap;
}
.status.ok { color: var(--green); border-color: #1e4d34; }

/* ---------- SETUP STEPS ---------- */
.setup-steps { margin: 14px 0; padding-left: 22px; color: var(--muted); font-size: 0.92rem; }
.setup-steps li { margin: 7px 0; line-height: 1.6; }
.setup-steps b { color: var(--text); }

/* ---------- FOOTER ---------- */
.footer {
  text-align: center;
  color: var(--dim);
  font-size: 0.85rem;
  padding: 26px 0 40px;
  border-top: 1px solid var(--line);
  margin-top: 30px;
}
.footer p { margin: 0; }
.footer a { color: var(--mint); text-decoration: none; font-weight: 600; }
.footer a:hover { text-decoration: underline; }

/* ---------- RESPONSIF ---------- */
@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; padding: 44px 0 30px; }
  .hero-card { max-width: 560px; }
  .workspace { grid-template-columns: 1fr; }
  .out-panel { position: static; }
  .code { min-height: 380px; }
  .akun-grid { grid-template-columns: 1fr; }
  .topbar-in { flex-wrap: wrap; row-gap: 10px; }
  .topnav { order: 3; width: 100%; }
}
@media (max-width: 560px) {
  .grid2 { grid-template-columns: 1fr; }
  .card, .panel { padding: 20px 18px; }
  .hero h1 { font-size: 2.35rem; }
  .keyrow .grow { flex-basis: 100%; }
}

/* Checkbox "Siap edit di Canva" */
.check{display:flex;gap:10px;align-items:flex-start;cursor:pointer;font-size:14px;color:var(--muted);margin:4px 0}
.check input{width:18px;height:18px;margin-top:2px;accent-color:var(--green);flex:none}
.check b{color:var(--text)}

/* Kotak Perintah */
.cmd-card{margin-bottom:18px}
.cmd-row{display:flex;gap:10px}
.cmd-row input{flex:1;min-width:0}
.cmd-status{min-height:20px;margin:8px 0 0}
.cmd-status.ok{color:var(--green)}
.cmd-status.err{color:#ff8a8a}
.chips{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px}
.chip{border:1px solid var(--line);background:rgba(255,255,255,.03);color:var(--muted);border-radius:999px;padding:6px 12px;font-size:12.5px;cursor:pointer}
.chip:hover{color:var(--text);border-color:var(--green)}
/* Pecah gambar gabungan */
.split-box{border:1px dashed var(--line2);border-radius:12px;padding:14px;margin-top:12px}
.split-controls{display:flex;gap:10px;align-items:flex-end;flex-wrap:wrap;margin:8px 0}
.split-controls label{font-size:13px;color:var(--muted);display:flex;gap:6px;align-items:center}
.split-controls input{width:64px}
.panel-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(110px,1fr));gap:10px;margin:10px 0}
.panel-cell{position:relative;border:2px solid var(--line);border-radius:10px;overflow:hidden;cursor:pointer;background:#000}
.panel-cell img{display:block;width:100%;height:auto}
.panel-cell .pnum{position:absolute;top:6px;left:6px;background:rgba(0,0,0,.65);color:#fff;font-size:11px;font-weight:700;border-radius:6px;padding:2px 7px;z-index:2}
.panel-cell .pcheck{position:absolute;top:6px;right:6px;width:22px;height:22px;border-radius:6px;background:rgba(0,0,0,.65);border:2px solid #fff;display:flex;align-items:center;justify-content:center;color:#fff;font-size:14px;font-weight:700;z-index:2}
.panel-cell.sel{border-color:var(--green)}
.panel-cell.sel .pcheck{background:var(--green);border-color:var(--green);color:#04241a}
.panel-cell:not(.sel) img{opacity:.45}
