@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;800&display=swap');

:root {
  --clr-primary: #071d2b;
  --clr-accent: #0070f6;
  --clr-accent-hover: #0067ed;
  --clr-swoosh: #b3e0ff;
  --clr-border: #c5d6e0;
  --clr-bg-light: #f7fafc;
  --clr-warning: #ff7800;
  --clr-danger: #e02424;
  --clr-danger-bg: #fef2f2;
  --clr-white: #ffffff;
  --font-main: 'Inter', system-ui, -apple-system, sans-serif;
  --radius: 8px;
  --shadow: 0 24px 40px rgba(7, 29, 43, 0.08);
  --content-w: 560px;
}

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

html { height: 100%; }

body.app-shell {
  margin: 0;
  min-height: 100%;
  min-height: 100dvh;
  font-family: var(--font-main);
  color: var(--clr-primary);
  background: var(--clr-white);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}

img { max-width: 100%; height: auto; display: block; }

.site-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 24px;
  border-bottom: 1px solid var(--clr-border);
  background: var(--clr-white);
}

.site-header__logo { height: 32px; }

@media (min-width: 992px) {
  .site-header__logo { height: 40px; }
}

.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
  min-height: 0;
}

.hero__illustration {
  display: none;
  position: absolute;
  top: 50%;
  transform: translateY(-40%);
  max-height: 280px;
  opacity: 0.9;
  pointer-events: none;
}

.hero__illustration--left { left: 0; transform: translate(-55%, -40%); }
.hero__illustration--right { right: 0; transform: translate(55%, -40%); }

@media (min-width: 1280px) {
  .hero__illustration { display: block; }
}

/* Stage — vertical center of all screens */
.hero__stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
  min-height: 0;
}

@media (min-width: 992px) {
  .hero__stage { padding: 32px 40px; }
}

.screen {
  display: none;
  width: 100%;
}

.screen.screen--active { display: block; }
.screen.is-hidden { display: none !important; }

.screen__content {
  width: 100%;
  max-width: var(--content-w);
  margin: 0 auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Typography */
.hero__tagline {
  color: var(--clr-accent);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin: 0 0 8px;
}

@media (min-width: 992px) {
  .hero__tagline { font-size: 18px; letter-spacing: 1.2px; }
}

.hero__title {
  font-size: 32px;
  font-weight: 800;
  line-height: 1.15;
  margin: 0 0 16px;
}

@media (min-width: 992px) {
  .hero__title { font-size: 44px; }
}

.hero__title-accent {
  background: linear-gradient(transparent 62%, var(--clr-swoosh) 62%);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.hero__subtitle {
  font-size: 16px;
  line-height: 26px;
  color: var(--clr-primary);
  margin: 0 0 20px;
  max-width: 520px;
}

@media (min-width: 992px) {
  .hero__subtitle { font-size: 17px; line-height: 28px; margin-bottom: 24px; }
}

.hero__status {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.hero__status.is-empty {
  display: none;
}

.scan-status--loading::before {
  content: '';
  width: 16px;
  height: 16px;
  border: 2px solid var(--clr-border);
  border-top-color: var(--clr-accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.scan-status--warning { color: var(--clr-warning); }
.scan-status--neutral { color: #64748b; }

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

.extensions-list--hidden { display: none; }

.hero__note {
  font-size: 13px;
  color: #64748b;
  margin: 16px 0 0;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 32px;
  font-family: var(--font-main);
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
}

.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.btn--primary {
  background: var(--clr-accent);
  color: var(--clr-white);
  box-shadow: 0 4px 12px rgba(0, 112, 246, 0.3);
}

.btn--primary:hover:not(:disabled) {
  background: var(--clr-accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 112, 246, 0.35);
}

.btn--danger {
  background: var(--clr-danger);
  color: var(--clr-white);
  box-shadow: 0 4px 12px rgba(224, 36, 36, 0.3);
  margin-top: 24px;
}

.btn--danger:hover {
  background: #c81e1e;
  transform: translateY(-1px);
}

.btn--lg {
  padding: 16px 40px;
  font-size: 18px;
}

/* Scanning */
.scanning-screen {
  gap: 20px;
  width: 100%;
}

.scanning-icon {
  width: 64px;
  height: 64px;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(0.95); }
}

.scan-message {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
}

.scan-checks-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.scan-check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  background: var(--clr-white);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius);
  text-align: left;
}

.scan-check--done {
  border-color: rgba(224, 36, 36, 0.3);
  background: var(--clr-danger-bg);
}

.scan-check__icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  border-radius: 50%;
  border: 2px solid var(--clr-border);
  animation: spin 0.8s linear infinite;
}

.scan-check--done .scan-check__icon {
  animation: none;
  background: var(--clr-danger);
  border-color: var(--clr-danger);
}

.scan-check--done .scan-check__icon::after {
  content: '!';
  display: block;
  text-align: center;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  line-height: 16px;
}

.scan-check__label {
  display: block;
  font-size: 14px;
  font-weight: 600;
}

.scan-check__detail {
  display: block;
  font-size: 13px;
  color: var(--clr-danger);
  font-weight: 600;
  margin-top: 2px;
}

.progress-wrapper {
  width: 100%;
  background: var(--clr-bg-light);
  border-radius: 12px;
  padding: 20px 24px;
  border: 1px solid var(--clr-border);
}

.progress-bar-track {
  height: 8px;
  background: var(--clr-border);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 10px;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--clr-accent), #00c2ff);
  border-radius: 4px;
  transition: width 0.1s linear;
}

.progress-text {
  font-size: 14px;
  font-weight: 700;
  color: var(--clr-accent);
  text-align: right;
}

/* Results */
.results-header {
  width: 100%;
  text-align: left;
  margin-bottom: 16px;
}

.results-header__device--full {
  width: 100%;
  background: var(--clr-bg-light);
  border: 1px solid var(--clr-border);
  border-radius: 12px;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
}

.results-header__row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
}

.results-header__row span { color: #64748b; }
.results-header__row strong { font-weight: 600; text-align: right; }

.text-danger { color: var(--clr-danger) !important; }

.alert-banner {
  width: 100%;
  padding: 16px 20px;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  margin: 0 0 16px;
  order: -1;
}

.alert-banner--critical {
  background: var(--clr-danger-bg);
  color: var(--clr-danger);
  border: 1px solid rgba(224, 36, 36, 0.35);
}

.screen__content--results {
  text-align: center;
  max-height: calc(100dvh - 160px);
  overflow-y: auto;
  padding: 0 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.screen__content--results .alert-banner {
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 2;
  box-shadow: 0 4px 16px rgba(224, 36, 36, 0.12);
}

.threats-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
}

.finding-row {
  display: flex;
  gap: 14px;
  padding: 16px 18px;
  background: var(--clr-white);
  border: 1px solid var(--clr-border);
  border-left: 4px solid var(--clr-danger);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.finding-row--leak { border-left-color: #ea580c; }
.finding-row--malware { border-left-color: #450a0a; background: var(--clr-danger-bg); }
.finding-row--more {
  justify-content: center;
  border-left-color: var(--clr-border);
  color: #64748b;
  font-size: 14px;
  font-weight: 600;
  box-shadow: none;
}

.finding-row__icon {
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--clr-danger);
}

.finding-row--leak .finding-row__icon { background: #ea580c; }

.finding-row__content { flex: 1; min-width: 0; }

.finding-row__title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 6px;
}

.finding-row__detail {
  font-size: 14px;
  line-height: 22px;
  color: #475569;
}

.finding-row__detail code {
  background: rgba(224, 36, 36, 0.08);
  color: var(--clr-danger);
  padding: 3px 7px;
  border-radius: 4px;
  font-family: 'SF Mono', Monaco, Consolas, monospace;
  font-size: 13px;
}

.finding-row__extra {
  font-size: 13px;
  color: #64748b;
  margin-top: 6px;
}

.leak-sites {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.leak-site {
  font-size: 13px;
  font-weight: 600;
  font-family: 'SF Mono', Monaco, Consolas, monospace;
  background: rgba(234, 88, 12, 0.1);
  color: #c2410c;
  padding: 4px 10px;
  border-radius: 4px;
}

.trust-row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 28px;
  font-size: 13px;
  color: #64748b;
}

.trust-row svg { flex-shrink: 0; }

@media (max-width: 600px) {
  .hero__title { font-size: 28px; }
}
