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

:root {
  --cyan: #00e5ff;
  --cyan-bright: #5ffbff;
  --cyan-dark: #00b8d4;
  --cyan-light: rgba(0, 229, 255, 0.12);
  --cyan-glow: rgba(0, 229, 255, 0.35);
  --cyan-border: rgba(0, 229, 255, 0.22);
  --bg: #050b18;
  --bg-elevated: #07101f;
  --bg-card: #0a1528;
  --bg-card-hover: #0d1a30;
  --text: #e8f4ff;
  --text-muted: #7a9bb8;
  --border: rgba(0, 229, 255, 0.1);
  --orange: #f59e0b;
  --orange-bg: rgba(245, 158, 11, 0.1);
  --orange-border: rgba(245, 158, 11, 0.3);
  --red: #ff6b6b;
  --red-bg: rgba(255, 107, 107, 0.1);
  --red-border: rgba(255, 107, 107, 0.3);
  --green: #34d399;
  --yellow-bg: rgba(234, 179, 8, 0.1);
  --yellow-border: rgba(234, 179, 8, 0.28);
  --radius: 16px;
  --radius-sm: 12px;
}

html {
  font-size: 16px;
  color-scheme: dark;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(0, 229, 255, 0.08), transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 100%, rgba(0, 100, 180, 0.06), transparent 50%),
    radial-gradient(ellipse 50% 30% at 10% 60%, rgba(0, 229, 255, 0.04), transparent 50%);
  pointer-events: none;
  z-index: 0;
}

.app {
  position: relative;
  z-index: 1;
  max-width: 420px;
  margin: 0 auto;
  min-height: 100dvh;
  background: transparent;
}

/* Header */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-brand {
  display: flex;
  align-items: center;
}

.header-logo {
  height: 34px;
  width: auto;
  display: block;
  filter: drop-shadow(0 0 8px rgba(0, 229, 255, 0.25));
}

.menu-btn {
  background: rgba(0, 229, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 8px 6px;
}

.menu-btn span {
  display: block;
  width: 3px;
  height: 3px;
  background: var(--cyan);
  border-radius: 50%;
  box-shadow: 0 0 4px var(--cyan-glow);
}

/* Phases */
.phase {
  display: none;
  padding: 16px;
  flex-direction: column;
  gap: 16px;
  animation: fadeIn 0.35s ease;
}

.phase.active {
  display: flex;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Welcome */
.welcome-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 28px 24px 32px;
  text-align: center;
  border: 1px solid var(--border);
  margin-top: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(0, 229, 255, 0.06);
}

.welcome-logo-wrap {
  margin: 0 auto 20px;
  position: relative;
  display: inline-block;
}

.welcome-logo-wrap::before {
  content: '';
  position: absolute;
  inset: -20px -30px;
  background: radial-gradient(ellipse, rgba(0, 229, 255, 0.12), transparent 70%);
  pointer-events: none;
}

.welcome-logo {
  width: 220px;
  height: auto;
  display: block;
  margin: 0 auto;
  position: relative;
  filter: drop-shadow(0 0 16px rgba(0, 229, 255, 0.2));
}

.welcome-alert {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--orange-bg);
  border: 1px solid var(--orange-border);
  border-radius: 20px;
  padding: 5px 12px;
  margin-bottom: 16px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #fbbf24;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.welcome-alert svg {
  width: 14px;
  height: 14px;
}

.device-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--cyan-light);
  border: 1px solid var(--cyan-border);
  border-radius: 20px;
  padding: 5px 12px;
  margin-bottom: 16px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--cyan);
  letter-spacing: 0.02em;
}

.device-badge svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.device-badge.hidden {
  display: none;
}

.welcome-card h1 {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 12px;
  line-height: 1.4;
  color: var(--text);
}

.welcome-card p {
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.65;
  margin-bottom: 24px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
  text-decoration: none;
}

.btn:active {
  transform: scale(0.98);
}

.btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.btn-primary {
  background: linear-gradient(135deg, var(--cyan-dark), var(--cyan));
  color: #021018;
  box-shadow: 0 4px 20px var(--cyan-glow), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--cyan), var(--cyan-bright));
  box-shadow: 0 6px 28px rgba(0, 229, 255, 0.45);
}

.btn-full {
  width: 100%;
}

.btn-outline {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  flex: 1;
}

.btn-danger-outline {
  background: var(--red-bg);
  border: 1px solid var(--red-border);
  color: var(--red);
  flex: 1;
}

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

.btn-clean {
  margin-top: 8px;
  padding: 16px;
  font-size: 1rem;
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* Status banner */
.status-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--cyan-light);
  border: 1px solid var(--cyan-border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}

.status-banner strong {
  display: block;
  color: var(--cyan);
  font-size: 0.875rem;
  margin-bottom: 2px;
}

.status-banner span {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.status-banner svg {
  width: 20px;
  height: 20px;
  color: var(--cyan);
  flex-shrink: 0;
  margin-top: 2px;
  filter: drop-shadow(0 0 6px var(--cyan-glow));
}

.status-warning {
  background: var(--orange-bg);
  border: 1px solid var(--orange-border);
}

.status-warning strong {
  color: #fbbf24;
}

.status-warning span {
  color: #fcd34d;
}

.status-warning svg {
  color: var(--orange);
  filter: none;
}

/* Spinner */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(0, 229, 255, 0.15);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
  margin-top: 2px;
  box-shadow: 0 0 8px var(--cyan-glow);
}

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

/* Card */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 28px 24px 20px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(0, 229, 255, 0.05);
}

/* Circular progress */
.circular-progress {
  position: relative;
  width: 160px;
  height: 160px;
  margin: 0 auto 20px;
}

.circular-progress svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.progress-bg {
  fill: none;
  stroke: rgba(0, 229, 255, 0.08);
  stroke-width: 8;
}

.progress-fill {
  fill: none;
  stroke: var(--cyan);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 326.73;
  stroke-dashoffset: 326.73;
  transition: stroke-dashoffset 0.3s ease;
  filter: drop-shadow(0 0 6px var(--cyan-glow));
}

.progress-fill-green {
  stroke: var(--green);
  filter: drop-shadow(0 0 6px rgba(52, 211, 153, 0.4));
}

.progress-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.progress-text span {
  font-family: 'Montserrat', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  color: var(--cyan);
  text-shadow: 0 0 20px var(--cyan-glow);
}

.progress-text small {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.scanning-label {
  text-align: center;
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.scanning-path {
  text-align: center;
  font-size: 0.8125rem;
  font-weight: 600;
  font-family: 'SF Mono', 'Fira Code', monospace;
  color: var(--cyan);
  margin-bottom: 16px;
  word-break: break-all;
  opacity: 0.85;
  min-height: 1.25rem;
}

.platform-ios .scanning-path.path-update {
  animation: pathFadeIos 0.45s ease;
}

.platform-android .scanning-path.path-update {
  animation: pathSlideAndroid 0.35s ease;
}

.platform-other .scanning-path.path-update {
  animation: pathFadeIos 0.4s ease;
}

@keyframes pathFadeIos {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 0.85; transform: translateY(0); }
}

@keyframes pathSlideAndroid {
  from { opacity: 0; transform: translateX(-8px); }
  to { opacity: 0.85; transform: translateX(0); }
}

.platform-ios .progress-fill {
  transition: stroke-dashoffset 0.45s ease;
}

.platform-android .progress-fill {
  transition: stroke-dashoffset 0.25s ease;
}

.platform-android .linear-fill {
  transition: width 0.2s ease;
}

.platform-ios .linear-fill {
  transition: width 0.35s ease;
}

.platform-ios .spinner {
  animation: spin 1s linear infinite;
}

.platform-android .spinner {
  animation: spin 0.65s linear infinite;
}

.linear-progress {
  height: 6px;
  background: rgba(0, 229, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
}

.linear-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--cyan-dark), var(--cyan));
  border-radius: 3px;
  width: 0%;
  transition: width 0.3s ease;
  box-shadow: 0 0 10px var(--cyan-glow);
}

.linear-fill-green {
  background: linear-gradient(90deg, #059669, var(--green));
  box-shadow: 0 0 10px rgba(52, 211, 153, 0.4);
}

/* Stats */
.stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.stat-card svg {
  width: 22px;
  height: 22px;
  color: var(--cyan);
  margin-bottom: 4px;
  filter: drop-shadow(0 0 4px var(--cyan-glow));
}

.stat-value {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
}

/* Action row */
.action-row {
  display: flex;
  gap: 12px;
}

/* Threats */
.threats-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.threats-header h2 {
  font-family: 'Montserrat', sans-serif;
  font-size: 1rem;
  font-weight: 700;
}

.badge {
  background: var(--cyan);
  color: #021018;
  font-size: 0.75rem;
  font-weight: 700;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 10px var(--cyan-glow);
}

.threats-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.threat-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
}

.threat-card.low {
  background: var(--yellow-bg);
  border-color: var(--yellow-border);
}

.threat-card.medium {
  background: var(--orange-bg);
  border-color: var(--orange-border);
}

.threat-card.high {
  background: var(--red-bg);
  border-color: var(--red-border);
}

.threat-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.threat-card.low .threat-icon {
  background: rgba(234, 179, 8, 0.2);
  color: #facc15;
}

.threat-card.medium .threat-icon {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
}

.threat-card.high .threat-icon {
  background: rgba(255, 107, 107, 0.2);
  color: var(--red);
}

.threat-icon svg {
  width: 18px;
  height: 18px;
}

.threat-info {
  flex: 1;
  min-width: 0;
}

.threat-name {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.threat-path {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: 'SF Mono', 'Fira Code', monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.threat-severity {
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  color: #021018;
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.threat-card.low .threat-severity {
  background: #eab308;
}

.threat-card.medium .threat-severity {
  background: var(--orange);
}

.threat-card.high .threat-severity {
  background: #ef4444;
  color: #fff;
}

/* Summary box */
.summary-box {
  background: var(--orange-bg);
  border: 1px solid var(--orange-border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: #fcd34d;
}

.summary-box svg {
  width: 18px;
  height: 18px;
  color: var(--orange);
  flex-shrink: 0;
  margin-top: 1px;
}

/* Error phase */
.error-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 28px 24px;
  text-align: center;
  margin-top: 16px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

.error-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  background: var(--red-bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--red-border);
}

.error-icon svg {
  width: 32px;
  height: 32px;
  color: var(--red);
}

.error-card h2 {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.125rem;
  margin-bottom: 8px;
}

.error-file {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.8125rem;
  color: var(--red);
  background: var(--red-bg);
  border: 1px solid var(--red-border);
  padding: 8px 12px;
  border-radius: 8px;
  margin: 12px 0;
  word-break: break-all;
}

.error-card > p {
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1.6;
  margin-bottom: 20px;
}

.avast-box {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(255, 120, 0, 0.08);
  border: 1px solid rgba(255, 120, 0, 0.25);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 20px;
  text-align: left;
}

.avast-logo svg {
  width: 48px;
  height: 48px;
}

.avast-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.avast-info strong {
  font-size: 0.9375rem;
}

.avast-info span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.country-note {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 12px;
}
