/* ============================================================
   OKY — URL scanner page (redesign)
   Pixel-mapped from the approved Figma "URL scanner" frame.
   Reuses the dashboard.css --d-* palette + Montserrat/Inter
   fonts; all new classes are pg-scan-* prefixed.
   ============================================================ */

/* ---- header ---------------------------------------------------- */
.pg-scan-head { margin-bottom: 22px; }
.pg-scan-title {
  font-family: var(--font-mont);
  font-weight: 700; font-size: 30px; line-height: 36px;
  letter-spacing: -0.025em;
  color: var(--d-ink);
  margin: 0 0 6px;
}
.pg-scan-subtitle {
  font-family: var(--font-body);
  font-weight: 400; font-size: 14px; line-height: 20px;
  color: var(--d-muted);
  margin: 0;
}

/* ---- scanner card --------------------------------------------- */
.pg-scan-card {
  background: var(--d-card);
  border: 1px solid rgba(229,229,229,0.55);
  border-radius: 22px;
  box-shadow: var(--d-shadow-hero);
  padding: 22px;
  margin-bottom: 24px;
}

/* input row */
.pg-scan-box {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--d-line-2);
  border-radius: 13px;
  padding: 7px 7px 7px 8px;
  transition: border-color .15s, box-shadow .15s;
}
.pg-scan-box:focus-within {
  border-color: var(--d-blue);
  box-shadow: 0 0 0 3px rgba(21,93,252,0.12);
}
.pg-scan-input {
  flex: 1; min-width: 0;
  border: 0; outline: 0; background: none;
  font-family: var(--font-body); font-size: 14px; color: var(--d-ink);
  padding: 0 8px; height: 28px;
}
.pg-scan-input::placeholder { color: var(--d-faint); }
.pg-scan-go {
  flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  height: 40px; padding: 0 22px;
  border-radius: 9px; border: 0; cursor: pointer;
  background: var(--d-blue-600); color: #fff;
  font-family: var(--font-body); font-weight: 600; font-size: 14px;
  transition: background .15s;
}
.pg-scan-go:hover { background: #1d4fd0; }

/* ---- cascade --------------------------------------------------- */
.pg-scan-cascade {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-top: 16px;
}
@media (max-width: 880px) { .pg-scan-cascade { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .pg-scan-cascade { grid-template-columns: 1fr; } }

.pg-scan-stage {
  background: #fafafa;
  border: 1px solid var(--d-line-2);
  border-radius: 12px;
  padding: 13px 14px;
  min-height: 70px;
  transition: background .15s, border-color .15s;
}
.pg-scan-stage-num {
  font-family: var(--font-body);
  font-weight: 500; font-size: 11px;
  color: var(--d-faint);
  margin-bottom: 8px;
}
.pg-scan-stage-name {
  font-family: var(--font-body);
  font-weight: 500; font-size: 14px; line-height: 17px;
  color: var(--d-ink);
  margin-bottom: 3px;
}
.pg-scan-stage-stat {
  font-family: var(--font-body);
  font-weight: 500; font-size: 12px; line-height: 16px;
  color: var(--d-muted);
  min-height: 16px;
}

/* stage states */
.pg-scan-stage.active {
  border-color: rgba(21,93,252,0.35);
  background: #f5f8ff;
}
.pg-scan-stage.active .pg-scan-stage-stat { color: var(--d-blue); }
.pg-scan-stage.pass .pg-scan-stage-stat   { color: #15803d; }
.pg-scan-stage.fail {
  border-color: rgba(110,4,4,0.25);
  background: #fff7f7;
}
.pg-scan-stage.fail .pg-scan-stage-stat   { color: var(--d-danger-ink); }

/* ---- result band ---------------------------------------------- */
.pg-scan-result { display: none; }
.pg-scan-result.show {
  display: flex; align-items: center; gap: 14px;
  margin-top: 16px;
  padding: 16px 18px;
  border-radius: 14px;
  animation: pg-scan-result-in .2s ease;
}
@keyframes pg-scan-result-in {
  from { opacity: 0; transform: translateY(-3px); }
  to   { opacity: 1; transform: none; }
}
.pg-scan-result-icon {
  width: 36px; height: 36px; flex-shrink: 0;
  border-radius: 50%;
  display: grid; place-items: center;
  color: #fff;
}
.pg-scan-result-body { min-width: 0; }
.pg-scan-result-title {
  font-family: var(--font-mont);
  font-weight: 600; font-size: 16px; line-height: 20px;
  letter-spacing: -0.01em;
  margin-bottom: 3px;
}
.pg-scan-result-sub {
  font-family: var(--font-body);
  font-weight: 400; font-size: 13px; line-height: 18px;
}

.pg-scan-result.safe       { background: var(--d-safe-bg); }
.pg-scan-result.safe       .pg-scan-result-icon  { background: #00a63e; }
.pg-scan-result.safe       .pg-scan-result-title { color: var(--d-safe-ink); }
.pg-scan-result.safe       .pg-scan-result-sub   { color: #2f7d52; }

.pg-scan-result.suspicious { background: var(--d-warn-bg); }
.pg-scan-result.suspicious .pg-scan-result-icon  { background: #c2630d; }
.pg-scan-result.suspicious .pg-scan-result-title { color: var(--d-warn-ink); }
.pg-scan-result.suspicious .pg-scan-result-sub   { color: #9a5418; }

.pg-scan-result.malicious  { background: var(--d-danger-bg); }
.pg-scan-result.malicious  .pg-scan-result-icon  { background: #c10007; }
.pg-scan-result.malicious  .pg-scan-result-title { color: var(--d-danger-ink); }
.pg-scan-result.malicious  .pg-scan-result-sub   { color: #9a2222; }

.pg-scan-result.error      { background: var(--d-line); }
.pg-scan-result.error      .pg-scan-result-icon  { background: #6b7280; }
.pg-scan-result.error      .pg-scan-result-title { color: var(--d-ink); }
.pg-scan-result.error      .pg-scan-result-sub   { color: var(--d-muted); }

/* ---- bottom grid ---------------------------------------------- */
.pg-scan-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
@media (max-width: 980px) { .pg-scan-grid { grid-template-columns: 1fr; } }

/* recent scans */
.pg-scan-recent {
  background: var(--d-card);
  border: 1px solid rgba(229,229,229,0.55);
  border-radius: 18px;
  box-shadow: var(--d-shadow-card);
  padding: 8px 8px 12px;
}
.pg-scan-recent-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 12px 10px;
  border-bottom: 1px solid var(--d-line);
  margin: 0 4px 4px;
}
.pg-scan-recent-title {
  font-family: var(--font-mont);
  font-weight: 600; font-size: 17px; letter-spacing: -0.025em;
  color: var(--d-ink); margin: 0;
}
.pg-scan-recent-total {
  font-family: var(--font-body);
  font-weight: 400; font-size: 12px; color: var(--d-muted);
}
.pg-scan-recent-list { display: flex; flex-direction: column; }

.pg-scan-row {
  display: grid;
  grid-template-columns: 30px minmax(0,1fr) auto auto;
  gap: 14px; align-items: center;
  padding: 11px 12px;
  border-radius: 10px;
  transition: background .15s;
}
.pg-scan-row:hover { background: #f7f9fc; }
.pg-scan-row-mark {
  width: 30px; height: 30px; border-radius: 8px;
  background: #fafafa; border: 1px solid var(--d-line-2);
  color: #8a93a3;
  display: grid; place-items: center; flex-shrink: 0;
}
.pg-scan-row-body { min-width: 0; }
.pg-scan-row-host {
  font-family: var(--font-body); font-weight: 500; font-size: 14px;
  line-height: 17px; color: var(--d-ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pg-scan-row-path {
  font-family: var(--font-body); font-weight: 400; font-size: 13px;
  line-height: 17px; color: var(--d-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pg-scan-pill {
  display: inline-flex; align-items: center; justify-content: center;
  height: 26px; padding: 0 14px; border-radius: 99px;
  font-family: var(--font-body); font-weight: 600; font-size: 12px;
  white-space: nowrap;
}
.pg-scan-pill.malicious   { background: var(--d-danger-bg); color: var(--d-danger-ink); }
.pg-scan-pill.suspicious  { background: var(--d-warn-bg);   color: var(--d-warn-ink); }
.pg-scan-pill.unreachable { background: var(--d-safe-bg);   color: var(--d-safe-ink); }
.pg-scan-row-time {
  font-family: var(--font-body); font-weight: 400; font-size: 12px;
  color: var(--d-muted); text-align: right; min-width: 30px;
}

/* recent — honest empty state (threats-only feed) */
.pg-scan-recent-empty {
  display: flex; flex-direction: column; align-items: center;
  text-align: center; gap: 4px;
  padding: 40px 24px;
}
.pg-scan-recent-empty-icon {
  width: 44px; height: 44px; border-radius: 14px;
  background: var(--d-safe-soft); color: var(--d-safe-ink);
  display: grid; place-items: center; margin-bottom: 6px;
}
.pg-scan-recent-empty-title {
  font-family: var(--font-mont); font-weight: 600; font-size: 15px;
  color: var(--d-ink);
}
.pg-scan-recent-empty-sub {
  font-family: var(--font-body); font-size: 13px; color: var(--d-muted);
  max-width: 280px;
}

/* what OKY checks */
.pg-scan-checks {
  background: var(--d-card);
  border: 1px solid rgba(229,229,229,0.55);
  border-radius: 18px;
  box-shadow: var(--d-shadow-card);
  padding: 20px 22px;
}
.pg-scan-checks-title {
  font-family: var(--font-mont);
  font-weight: 600; font-size: 17px; letter-spacing: -0.025em;
  color: var(--d-ink); margin: 0 0 14px;
}
.pg-scan-checks-list {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 12px;
}
.pg-scan-checks-item {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-body); font-weight: 400; font-size: 14px;
  line-height: 18px; color: var(--d-ink);
}
.pg-scan-checks-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--d-blue); flex-shrink: 0;
}
