/* WhatsApp Float Router – Frontend Widget */

:root {
  --wfr-btn-color: #25D366;
  --wfr-acc-color: #128C7E;
  --wfr-btn-size:  56px;
  --wfr-offset-h:  24px;
  --wfr-offset-v:  24px;
  --wfr-font-size: 14px;
}

/* ── Container utama: fixed, out-of-flow, tidak memengaruhi layout page ─── */
#wfr-widget {
  position: fixed;
  bottom: var(--wfr-offset-v);
  z-index: 9999;
  font-size: var(--wfr-font-size);
  line-height: 1.4;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
#wfr-widget.wfr-pos-right { right: var(--wfr-offset-h); }
#wfr-widget.wfr-pos-left  { left:  var(--wfr-offset-h); }

/* ── Tombol float ───────────────────────────────────────────────────────── */
#wfr-float-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  height: var(--wfr-btn-size);
  min-width: var(--wfr-btn-size);
  padding: 0 18px 0 14px;
  background: var(--wfr-btn-color);
  color: #fff;
  border: none;
  border-radius: 100px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,.2);
  transition: transform .15s, box-shadow .15s;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
}
#wfr-float-btn:hover { transform: scale(1.04); box-shadow: 0 6px 22px rgba(0,0,0,.25); }
#wfr-float-btn:focus { outline: 3px solid rgba(255,255,255,.7); outline-offset: 2px; }

/* ── Panel ──────────────────────────────────────────────────────────────── */
#wfr-panel {
  position: absolute;
  bottom: calc(var(--wfr-btn-size) + 12px);
  width: 320px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0,0,0,.18);
  overflow: hidden;
  animation: wfrIn .2s ease;
}
.wfr-pos-right #wfr-panel { right: 0; }
.wfr-pos-left  #wfr-panel { left:  0; }
#wfr-panel[hidden] { display: none !important; }

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

/* ── Header panel ───────────────────────────────────────────────────────── */
.wfr-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--wfr-acc-color);
  padding: 14px 16px;
}

#wfr-close-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
}
#wfr-close-btn:focus { outline: 2px solid rgba(255,255,255,.7); }

/* ── Deskripsi ──────────────────────────────────────────────────────────── */
.wfr-panel-desc {
  padding: 10px 16px 0;
  font-size: 13px;
  color: #555;
  margin: 0;
}

/* ── Form ───────────────────────────────────────────────────────────────── */
#wfr-form { padding: 14px 16px 18px; }

.wfr-field { margin-bottom: 12px; }

.wfr-field label {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
  font-weight: 600;
  color: #333;
}
.wfr-field label span { color: #e00; }

.wfr-field input[type="text"],
.wfr-field select,
.wfr-field textarea {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
  background: #fff;
  color: #111;
}
.wfr-field input:focus,
.wfr-field select:focus,
.wfr-field textarea:focus {
  border-color: var(--wfr-acc-color);
  outline: none;
}
.wfr-field textarea { resize: vertical; }

/* ── Error ──────────────────────────────────────────────────────────────── */
.wfr-error {
  background: #fff0f0;
  border: 1px solid #fcc;
  color: #c00;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 13px;
  margin-bottom: 10px;
}

/* ── Submit ─────────────────────────────────────────────────────────────── */
#wfr-submit {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 11px;
  background: var(--wfr-btn-color);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s;
}
#wfr-submit:hover    { background: var(--wfr-acc-color); }
#wfr-submit:focus    { outline: 3px solid var(--wfr-acc-color); outline-offset: 2px; }
#wfr-submit:disabled { opacity: .6; cursor: not-allowed; }

/* ── Mobile ─────────────────────────────────────────────────────────────── */
@media (max-width: 400px) {
  #wfr-panel { width: 290px; }
}
