/* Themepaste Security Audit — scanner.css */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

*,
*::before,
*::after {
  box-sizing: border-box;
}

.tpsa-wrap [hidden] {
  display: none !important;
}

/* -------------------------------------------------------------------
   Variables
------------------------------------------------------------------- */
.tpsa-wrap {
  --tp-blue: #1460f3;
  --tp-blue-light: #0aacff;
  --tp-gradient: linear-gradient(135deg, #1460f3 0%, #0aacff 100%);
  --tp-dark: #07102b;
  --tp-text: #1a2340;
  --tp-muted: #64748b;
  --tp-border: #e2e8f0;
  --tp-surface: #f8fafc;
  --tp-white: #ffffff;
  --tp-radius-sm: 8px;
  --tp-radius: 12px;
  --tp-radius-lg: 16px;
  --tp-shadow: 0 2px 12px rgba(20, 96, 243, 0.07);
  --tp-shadow-md: 0 4px 24px rgba(20, 96, 243, 0.10);

  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--tp-text);
  line-height: 1.6;
  max-width: 820px;
  margin: 0 auto;
}

/* -------------------------------------------------------------------
   Hero
------------------------------------------------------------------- */
.tpsa-hero {
  background: var(--tp-dark);
  background-image: radial-gradient(ellipse at 70% 50%, rgba(20, 96, 243, 0.28) 0%, transparent 65%),
    radial-gradient(ellipse at 20% 80%, rgba(10, 172, 255, 0.18) 0%, transparent 55%);
  border-radius: var(--tp-radius-lg);
  padding: 52px 44px 40px;
  margin-bottom: 24px;
  text-align: center;
}

.tpsa-hero__title {
  font-size: 1.75rem;
  font-weight: 800;
  margin: 0 0 10px;
  color: var(--tp-white) !important;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.tpsa-hero__desc {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.65);
  margin: 0 0 32px;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.tpsa-hero__legal {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.35);
  margin: 16px 0 0;
  line-height: 1.6;
}

/* -------------------------------------------------------------------
   Form
------------------------------------------------------------------- */
.tpsa-form__row {
  display: flex;
  gap: 10px;
  max-width: 560px;
  margin: 0 auto;
}

.tpsa-form__input {
  flex: 1 1 0;
  padding: 13px 18px;
  font-size: 0.95rem;
  font-family: inherit;
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: 50px;
  background: rgba(255, 255, 255, 0.09);
  color: var(--tp-white);
  outline: none;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.tpsa-form__input:focus {
  border-color: var(--tp-blue-light);
  background: rgba(255, 255, 255, 0.13);
  box-shadow: 0 0 0 4px rgba(10, 172, 255, 0.18);
}

.tpsa-form__input::placeholder {
  color: rgba(255, 255, 255, 0.38);
}

.tpsa-form__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 28px;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: inherit;
  background: var(--tp-gradient);
  color: var(--tp-white);
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: opacity 0.18s, box-shadow 0.18s, transform 0.15s;
  white-space: nowrap;
  letter-spacing: 0.01em;
  box-shadow: 0 4px 18px rgba(20, 96, 243, 0.38);
  flex-shrink: 0;
}

.tpsa-form__btn:hover:not(:disabled) {
  opacity: 0.92;
  box-shadow: 0 6px 24px rgba(20, 96, 243, 0.48);
  transform: translateY(-1px);
}

.tpsa-form__btn:active:not(:disabled) {
  transform: translateY(0);
}

.tpsa-form__btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

/* Spinner */
.tpsa-form__spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: tpsa-spin 0.7s linear infinite;
  flex-shrink: 0;
}

.tpsa-form__btn--loading .tpsa-form__spinner {
  display: inline-block;
}

.tpsa-form__btn--loading .tpsa-form__btn-label {
  display: none;
}

@keyframes tpsa-spin {
  to {
    transform: rotate(360deg);
  }
}

/* -------------------------------------------------------------------
   Error
------------------------------------------------------------------- */
.tpsa-error {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #fff5f5;
  border: 1px solid #fecaca;
  border-left: 4px solid #ef4444;
  color: var(--tp-text);
  padding: 13px 16px;
  border-radius: var(--tp-radius-sm);
  margin-bottom: 16px;
  font-size: 0.9rem;
}

.tpsa-error__icon {
  font-size: 1rem;
  flex-shrink: 0;
  color: #ef4444;
}

/* -------------------------------------------------------------------
   Status / progress
------------------------------------------------------------------- */
.tpsa-status {
  background: var(--tp-white);
  border: 1px solid var(--tp-border);
  border-radius: var(--tp-radius);
  padding: 22px 24px;
  margin-bottom: 16px;
  box-shadow: var(--tp-shadow);
}

.tpsa-progress {
  height: 5px;
  background: #e2e8f0;
  border-radius: 9999px;
  overflow: hidden;
  margin-bottom: 12px;
}

.tpsa-progress__bar {
  height: 100%;
  background: var(--tp-gradient);
  border-radius: 9999px;
  transition: width 0.4s ease;
}

.tpsa-status__step {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--tp-muted);
  margin: 0;
}

/* -------------------------------------------------------------------
   Report header
------------------------------------------------------------------- */
.tpsa-report__header {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px;
  background: var(--tp-white);
  border: 1px solid var(--tp-border);
  border-radius: var(--tp-radius);
  margin-bottom: 16px;
  box-shadow: var(--tp-shadow);
  flex-wrap: wrap;
}

.tpsa-grade {
  width: 68px;
  height: 68px;
  border-radius: var(--tp-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  font-weight: 800;
  flex-shrink: 0;
  color: #fff;
  letter-spacing: -0.02em;
}

.tpsa-grade--aplus,
.tpsa-grade--a {
  background: var(--tp-gradient);
}

.tpsa-grade--b {
  background: linear-gradient(135deg, #0ea5e9, #38bdf8);
}

.tpsa-grade--c {
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
  color: #fff;
}

.tpsa-grade--d {
  background: linear-gradient(135deg, #f97316, #fb923c);
}

.tpsa-grade--f {
  background: linear-gradient(135deg, #ef4444, #f87171);
}

.tpsa-report__domain {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--tp-text);
  word-break: break-all;
  letter-spacing: -0.01em;
}

/* -------------------------------------------------------------------
   Severity chips
------------------------------------------------------------------- */
.tpsa-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tpsa-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 9999px;
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid transparent;
}

.tpsa-chip--critical {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fecaca;
}

.tpsa-chip--high {
  background: #fff7ed;
  color: #9a3412;
  border-color: #fed7aa;
}

.tpsa-chip--medium {
  background: #fefce8;
  color: #854d0e;
  border-color: #fde68a;
}

.tpsa-chip--low {
  background: #f0fdf4;
  color: #166534;
  border-color: #bbf7d0;
}

.tpsa-chip--info {
  background: #f1f5f9;
  color: #475569;
  border-color: #e2e8f0;
}

/* -------------------------------------------------------------------
   Site info panel
------------------------------------------------------------------- */
.tpsa-siteinfo {
  margin-bottom: 16px;
}

.tpsa-siteinfo__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.tpsa-siteinfo__tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  background: var(--tp-white);
  border: 1px solid var(--tp-border);
  border-radius: var(--tp-radius-sm);
  padding: 14px 16px;
  box-shadow: var(--tp-shadow);
  transition: box-shadow 0.18s;
}

.tpsa-siteinfo__tile:hover {
  box-shadow: var(--tp-shadow-md);
}

.tpsa-siteinfo__tile--empty {
  opacity: 0.45;
}

.tpsa-siteinfo__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  background: linear-gradient(135deg, rgba(20, 96, 243, 0.1), rgba(10, 172, 255, 0.1));
  border-radius: 7px;
  color: var(--tp-blue);
  flex-shrink: 0;
}

.tpsa-siteinfo__icon svg {
  display: block;
}

.tpsa-siteinfo__label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--tp-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.tpsa-siteinfo__value {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--tp-text);
  word-break: break-all;
  line-height: 1.3;
}

.tpsa-siteinfo__tile--empty .tpsa-siteinfo__value {
  color: #94a3b8;
  font-weight: 400;
}

/* -------------------------------------------------------------------
   Finding cards
------------------------------------------------------------------- */
.tpsa-card {
  border: 1px solid var(--tp-border);
  border-radius: var(--tp-radius);
  margin-bottom: 8px;
  overflow: hidden;
  background: var(--tp-white);
  box-shadow: var(--tp-shadow);
  transition: box-shadow 0.18s;
}

.tpsa-card:hover {
  box-shadow: var(--tp-shadow-md);
}

.tpsa-card__header {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s;
}

.tpsa-card__header:hover {
  background: var(--tp-surface);
}

.tpsa-card__badge {
  flex-shrink: 0;
  padding: 3px 10px;
  border-radius: 9999px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border: 1px solid transparent;
}

.tpsa-badge--critical {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fecaca;
}

.tpsa-badge--high {
  background: #fff7ed;
  color: #9a3412;
  border-color: #fed7aa;
}

.tpsa-badge--medium {
  background: #fefce8;
  color: #854d0e;
  border-color: #fde68a;
}

.tpsa-badge--low {
  background: #f0fdf4;
  color: #166534;
  border-color: #bbf7d0;
}

.tpsa-badge--info {
  background: #f1f5f9;
  color: #475569;
  border-color: #e2e8f0;
}

.tpsa-card__title {
  flex: 1;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--tp-text);
  line-height: 1.45;
}

.tpsa-card__chevron {
  width: 7px;
  height: 7px;
  border-right: 2px solid #94a3b8;
  border-bottom: 2px solid #94a3b8;
  transform: rotate(45deg);
  flex-shrink: 0;
  transition: transform 0.2s;
  margin-right: 2px;
}

.tpsa-card--open .tpsa-card__chevron {
  transform: rotate(-135deg);
}

.tpsa-card__body {
  padding: 4px 18px 18px;
  border-top: 1px solid var(--tp-border);
}

.tpsa-card__desc {
  margin: 12px 0 0;
  font-size: 0.875rem;
  color: #475569;
  line-height: 1.7;
}

.tpsa-card__rem {
  margin-top: 14px;
  font-size: 0.86rem;
}

.tpsa-card__rem strong {
  display: block;
  color: var(--tp-muted);
  margin-bottom: 7px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.tpsa-card__rem pre,
.tpsa-card__evidence pre {
  background: var(--tp-surface);
  border: 1px solid var(--tp-border);
  border-radius: var(--tp-radius-sm);
  padding: 11px 14px;
  font-size: 0.8rem;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-x: auto;
  margin: 0;
  color: var(--tp-text);
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}

.tpsa-card__evidence {
  margin-top: 12px;
}

.tpsa-card__evidence summary {
  font-size: 0.73rem;
  font-weight: 600;
  color: var(--tp-muted);
  cursor: pointer;
  margin-bottom: 7px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Left border accent by severity */
.tpsa-card--critical {
  border-left: 4px solid #f87171;
}

.tpsa-card--high {
  border-left: 4px solid #fb923c;
}

.tpsa-card--medium {
  border-left: 4px solid #fbbf24;
}

.tpsa-card--low {
  border-left: 4px solid #4ade80;
}

.tpsa-card--info {
  border-left: 4px solid #94a3b8;
}

/* -------------------------------------------------------------------
   Misc
------------------------------------------------------------------- */
.tpsa-no-findings {
  text-align: center;
  padding: 36px 24px;
  background: var(--tp-white);
  border: 1px solid var(--tp-border);
  border-radius: var(--tp-radius);
  box-shadow: var(--tp-shadow);
}

.tpsa-no-findings p {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--tp-text);
  margin: 0 0 6px;
}

.tpsa-no-findings span {
  font-size: 0.88rem;
  color: var(--tp-muted);
}

.tpsa-report__rescan {
  text-align: center;
  padding: 20px 0 4px;
}

.tpsa-btn-link {
  background: none;
  border: none;
  color: var(--tp-blue);
  cursor: pointer;
  font-size: 0.88rem;
  font-family: inherit;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 0;
  transition: color 0.15s, opacity 0.15s;
}

.tpsa-btn-link:hover {
  opacity: 0.75;
}

/* -------------------------------------------------------------------
   Responsive
------------------------------------------------------------------- */
@media (max-width: 600px) {
  .tpsa-hero {
    padding: 36px 22px 28px;
    border-radius: var(--tp-radius);
  }

  .tpsa-hero__title {
    font-size: 1.35rem;
  }

  .tpsa-hero__desc {
    font-size: 0.9rem;
  }

  .tpsa-form__row {
    flex-direction: column;
    gap: 10px;
  }

  .tpsa-form__input,
  .tpsa-form__btn {
    width: 100%;
    flex: none;
    border-radius: 50px;
  }

  .tpsa-siteinfo__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .tpsa-report__header {
    flex-direction: column;
    align-items: flex-start;
    padding: 18px;
  }

  .tpsa-grade {
    width: 54px;
    height: 54px;
    font-size: 1.45rem;
  }

  .tpsa-card__header {
    padding: 12px 14px;
  }

  .tpsa-card__body {
    padding: 4px 14px 14px;
  }
}