/* ─────────────────────────────────────────────────────────────
   audit.css  —  AdSense Auditor tool styles
   Uses CSS variables from main.css — no overrides, only additions
   ───────────────────────────────────────────────────────────── */

/* ── Auth gate ───────────────────────────────────────────────── */
#audit-auth-gate { display: none; }
#audit-error-box { display: none; }
.audit-gate-box {
  text-align: center;
  padding: 56px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  max-width: 480px;
  margin: 32px auto;
}
.audit-gate-icon { font-size: 56px; margin-bottom: 16px; line-height: 1; }
.audit-gate-title {
  font-size: 22px; font-weight: 800;
  color: var(--text-1); margin: 0 0 10px;
}
.audit-gate-desc {
  color: var(--text-3); font-size: 15px;
  margin: 0 0 28px; line-height: 1.6;
}
.audit-gate-btns {
  display: flex; gap: 12px;
  justify-content: center; flex-wrap: wrap;
  margin-bottom: 20px;
}
.audit-gate-plans-link {
  font-size: 13px; color: var(--text-3); margin: 0;
}
.audit-gate-plans-link a { color: var(--brand-light); }

/* ── Shared button ───────────────────────────────────────────── */
.audit-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 22px; border-radius: 10px;
  font-size: 14px; font-weight: 700;
  border: none; cursor: pointer;
  transition: all .18s ease; text-decoration: none;
}
.audit-btn-primary {
  background: var(--brand); color: #fff;
  box-shadow: 0 0 20px rgba(36,34,247,.3);
}
.audit-btn-primary:hover {
  background: var(--brand-dark);
  transform: translateY(-1px);
  box-shadow: 0 0 28px rgba(36,34,247,.45);
}
.audit-btn-primary:disabled {
  opacity: .55; cursor: not-allowed;
  transform: none; box-shadow: none;
}
.audit-btn-ghost {
  background: var(--bg-card-2);
  color: var(--text-2);
  border: 1px solid var(--border-med);
}
.audit-btn-ghost:hover { background: var(--bg-hover); color: var(--text-1); }

/* ── Usage bar ───────────────────────────────────────────────── */
.audit-usage-bar {
  display: flex; align-items: center;
  justify-content: space-between; flex-wrap: wrap; gap: 8px;
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 16px;
  font-size: 13px; color: var(--text-3);
  margin-bottom: 20px;
}
.audit-upgrade-link {
  color: var(--brand-light); font-weight: 700;
  font-size: 13px; text-decoration: none;
}
.audit-upgrade-link:hover { text-decoration: underline; }

/* ── URL input card ──────────────────────────────────────────── */
.audit-input-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px; padding: 28px 24px;
  margin-bottom: 24px;
}
.audit-input-label {
  display: block; font-size: 13px; font-weight: 700;
  color: var(--text-3); text-transform: uppercase;
  letter-spacing: .8px; margin-bottom: 12px;
}
.audit-input-row {
  display: flex; gap: 10px; flex-wrap: wrap;
}
.audit-input-wrap {
  flex: 1; min-width: 200px;
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-input);
  border: 1px solid var(--border-med);
  border-radius: 10px; padding: 12px 16px;
  transition: border-color .18s;
}
.audit-input-wrap:focus-within { border-color: var(--brand); }
.audit-input-icon {
  width: 18px; height: 18px;
  color: var(--text-3); flex-shrink: 0;
}
.audit-url-input {
  flex: 1; background: none; border: none; outline: none;
  color: var(--text-1); font-size: 15px; font-family: var(--font-mono);
}
.audit-url-input::placeholder { color: var(--text-3); font-family: var(--font-body); }
.audit-run-btn { white-space: nowrap; padding: 12px 24px; }
.audit-input-hint {
  font-size: 12px; color: var(--text-3);
  margin: 10px 0 0;
}

/* ── Progress ────────────────────────────────────────────────── */
.audit-progress {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px; padding: 32px 24px;
  text-align: center; margin-bottom: 24px;
}
.audit-progress-spinner {
  width: 44px; height: 44px;
  border: 3px solid var(--border-med);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: audit-spin .8s linear infinite;
  margin: 0 auto 24px;
}
@keyframes audit-spin { to { transform: rotate(360deg); } }

.audit-progress-steps {
  display: flex; flex-direction: column;
  gap: 6px; max-width: 360px;
  margin: 0 auto 16px; text-align: left;
}
.audit-progress-step {
  font-size: 13px; color: var(--text-3);
  padding: 6px 10px; border-radius: 6px;
  transition: all .2s;
}
.audit-progress-step.is-active {
  color: var(--brand-light);
  background: var(--brand-dim);
  font-weight: 700;
}
.audit-progress-step.is-done {
  color: #22c55e;
}
.audit-progress-step.is-done::before { content: "✓ "; }
.audit-progress-note {
  font-size: 12px; color: var(--text-3); margin: 0;
}

/* ── Error box ───────────────────────────────────────────────── */
.audit-error-box {
  display: flex; align-items: flex-start; gap: 10px;
  background: rgba(255,68,68,.08);
  border: 1px solid rgba(255,68,68,.25);
  border-radius: 10px; padding: 14px 16px;
  color: #ff6b6b; font-size: 14px;
  margin-bottom: 20px;
}
.audit-error-box svg { flex-shrink: 0; margin-top: 1px; }

/* ── Report ready ────────────────────────────────────────────── */
.audit-report-ready {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px; padding: 28px 24px;
  margin-bottom: 24px;
}
.audit-report-header {
  display: flex; align-items: center;
  justify-content: space-between; flex-wrap: wrap;
  gap: 12px; margin-bottom: 20px;
}
.audit-report-verdict {
  font-size: 15px; font-weight: 800;
  padding: 8px 20px; border-radius: 40px;
  letter-spacing: .5px;
}
.verdict-green  { background: rgba(34,197,94,.15); color: #22c55e; border: 1px solid rgba(34,197,94,.3); }
.verdict-yellow { background: rgba(250,204,21,.12); color: #facc15; border: 1px solid rgba(250,204,21,.3); }
.verdict-red    { background: rgba(255,68,68,.1);  color: #ff6b6b; border: 1px solid rgba(255,68,68,.25); }
.audit-report-meta { font-size: 13px; color: var(--text-3); }
.audit-report-actions {
  display: flex; flex-wrap: wrap; gap: 10px;
}

/* ── Report iframe ───────────────────────────────────────────── */
.audit-iframe-wrap {
  margin-top: 20px;
  border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden;
}
.audit-iframe {
  width: 100%; height: 80vh;
  min-height: 600px; border: none;
  background: #fff;
}

/* ── History table (profile page) ───────────────────────────── */
.history-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-top: 16px;
}
.history-table {
  width: 100%; border-collapse: collapse;
  font-size: 13px;
}
.history-table th {
  background: var(--bg-card-2);
  color: var(--text-3); font-weight: 700;
  text-transform: uppercase; letter-spacing: .6px;
  font-size: 11px; padding: 10px 14px;
  text-align: left; border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.history-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-2); vertical-align: middle;
}
.history-table tr:last-child td { border-bottom: none; }
.history-table tr:hover td { background: var(--bg-hover); }
.history-domain {
  font-family: var(--font-mono); font-size: 12px;
  color: var(--brand-light); max-width: 180px;
  overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap;
}
.history-tool-badge {
  display: inline-block; padding: 2px 8px;
  border-radius: 20px; font-size: 11px;
  font-weight: 700; background: var(--brand-dim);
  color: var(--brand-light);
}
.history-verdict {
  font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 20px;
}
.history-verdict.g { background: rgba(34,197,94,.12); color: #22c55e; }
.history-verdict.y { background: rgba(250,204,21,.1);  color: #facc15; }
.history-verdict.r { background: rgba(255,68,68,.1);   color: #ff6b6b; }
.history-view-btn {
  font-size: 12px; color: var(--brand-light);
  text-decoration: none; font-weight: 700;
}
.history-view-btn:hover { text-decoration: underline; }

/* ── History locked (free plan) ─────────────────────────────── */
.history-locked {
  text-align: center; padding: 40px 20px;
  background: var(--bg-card);
  border: 1px dashed var(--border-med);
  border-radius: 12px; margin-top: 16px;
}
.history-locked-icon { font-size: 36px; margin-bottom: 12px; }
.history-locked h4 {
  font-size: 16px; font-weight: 700;
  color: var(--text-1); margin: 0 0 6px;
}
.history-locked p {
  font-size: 13px; color: var(--text-3); margin: 0 0 16px;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 640px) {
  .audit-input-row { flex-direction: column; }
  .audit-run-btn   { width: 100%; justify-content: center; }
  .audit-report-header { flex-direction: column; align-items: flex-start; }
  .audit-gate-btns { flex-direction: column; align-items: center; }
  .audit-btn       { width: 100%; justify-content: center; }
}
