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

:root {
  --bg: #0b0d14;
  --card: rgba(255,255,255,0.04);
  --card-border: rgba(255,255,255,0.08);
  --input-bg: rgba(255,255,255,0.06);
  --input-border: rgba(255,255,255,0.12);
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --accent-glow: rgba(59,130,246,0.35);
  --red: #ef4444;
  --green: #22c55e;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --step-inactive: rgba(255,255,255,0.12);
  --radius: 12px;
}

html, body {
  min-height: 100vh;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  overflow-x: hidden;
}

/* Background layers */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(59,130,246,0.12) 0%, transparent 70%),
    radial-gradient(ellipse 60% 40% at 80% 80%, rgba(0,180,80,0.07) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* Simulated code-terminal background */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(0,255,80,0.015) 2px,
      rgba(0,255,80,0.015) 4px
    );
  pointer-events: none;
  z-index: 0;
}

.page {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 900px;
  padding: 2.5rem 1.5rem 4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

/* ── Shield logo ── */
.shield-logo {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: linear-gradient(135deg, #6366f1 0%, #3b82f6 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 32px rgba(99,102,241,0.4);
}

.shield-logo svg {
  width: 34px;
  height: 34px;
  color: #fff;
}

/* ── Header ── */
.site-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.site-header h1 {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 800;
  background: linear-gradient(90deg, #93c5fd 0%, #3b82f6 40%, #818cf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.site-header p {
  margin-top: 0.75rem;
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 560px;
  margin-inline: auto;
  line-height: 1.6;
}

/* ── Step wizard ── */
.steps {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 0;
  width: 100%;
  max-width: 680px;
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  position: relative;
}

.step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 20px;
  left: calc(50% + 20px);
  right: calc(-50% + 20px);
  height: 2px;
  background: var(--step-inactive);
}

.step.done:not(:last-child)::after,
.step.active:not(:last-child)::after {
  background: var(--accent);
}

.step-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 700;
  background: var(--step-inactive);
  color: var(--text-muted);
  border: 2px solid transparent;
  position: relative;
  z-index: 1;
}

.step.active .step-circle {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-glow);
}

.step.done .step-circle {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.step-label {
  margin-top: 0.5rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
}

.step-sublabel {
  font-size: 0.7rem;
  color: var(--text-muted);
  opacity: 0.6;
  text-align: center;
}

.step.active .step-label {
  color: var(--accent);
}

/* ── Card ── */
.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 2rem 2rem 1.5rem;
  width: 100%;
  backdrop-filter: blur(12px);
}

.card-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.card-subtitle {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 1.75rem;
}

/* ── Form grid ── */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.1rem;
}

.form-grid .full {
  grid-column: 1 / -1;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.field label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrap svg {
  position: absolute;
  left: 0.85rem;
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  flex-shrink: 0;
  pointer-events: none;
}

.input-wrap input {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.93rem;
  padding: 0.7rem 0.9rem 0.7rem 2.6rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input-wrap input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.input-wrap input::placeholder {
  color: rgba(148,163,184,0.5);
}

/* Inline verify button inside input row */
.input-with-action {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.input-with-action .input-wrap {
  flex: 1;
}

.btn-inline {
  background: transparent;
  border: 1px solid var(--accent);
  border-radius: 8px;
  color: var(--accent);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.7rem 1rem;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
}

.btn-inline:hover {
  background: var(--accent);
  color: #fff;
}

/* ── Error, Success & Hint ── */
.field-error {
  font-size: 0.78rem;
  color: var(--red);
  margin-top: 0.15rem;
}

.field-success {
  font-size: 0.78rem;
  color: var(--green);
  margin-top: 0.15rem;
}

.field-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
  opacity: 0.7;
}

/* ── Textarea ── */
.input-wrap textarea {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.93rem;
  font-family: inherit;
  padding: 0.7rem 0.9rem 0.7rem 2.6rem;
  outline: none;
  resize: vertical;
  min-height: 100px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input-wrap textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.input-wrap textarea::placeholder {
  color: rgba(148,163,184,0.5);
}

.input-wrap.textarea-wrap svg {
  top: 0.85rem;
  align-self: flex-start;
}

/* ── Page nav (outside card) ── */
.page-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding-top: 0.25rem;
}

.page-nav.end {
  justify-content: flex-end;
}

.btn-back {
  background: rgba(255,255,255,0.07);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: background 0.2s;
}

.btn-back:hover { background: rgba(255,255,255,0.12); }

.btn-back svg, .btn-next svg { width: 18px; height: 18px; }

.btn-next {
  background: var(--accent);
  border: none;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 0.75rem 1.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: background 0.2s, box-shadow 0.2s;
}

.btn-next:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 20px var(--accent-glow);
}

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

/* ── Payment banner ── */
.payment-banner {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #6d28d9 100%);
  border-radius: 10px;
  padding: 1.4rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.5rem;
}

.payment-banner-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.payment-banner-label {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.7);
  font-weight: 500;
}

.payment-banner-amount {
  font-size: 2rem;
  font-weight: 800;
  color: #fff;
  line-height: 1;
}

.payment-banner-found {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.65);
  margin-top: 0.2rem;
}

.btn-pay {
  background: rgba(255,255,255,0.15);
  border: 1.5px solid rgba(255,255,255,0.4);
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 0.7rem 1.3rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
  transition: background 0.2s;
  text-decoration: none;
}

.btn-pay:hover { background: rgba(255,255,255,0.25); }

.btn-pay svg { width: 16px; height: 16px; }

/* ── Info Box ── */
.info-box {
  background: rgba(59,130,246,0.08);
  border: 1px solid rgba(59,130,246,0.2);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
}

.info-box svg {
  color: #60a5fa;
  margin-top: 2px;
}

.info-box strong {
  display: block;
  font-size: 0.88rem;
  color: var(--text);
  margin-bottom: 0.3rem;
}

.info-box p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}

/* ── Search page specifics ── */
.search-row {
  display: flex;
  gap: 0.75rem;
  align-items: flex-end;
}

.search-row .field { flex: 1; }

.btn-search {
  background: var(--accent);
  border: none;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  font-size: 0.93rem;
  font-weight: 700;
  padding: 0.7rem 1.4rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
  transition: background 0.2s, box-shadow 0.2s;
  margin-bottom: 0;
  align-self: flex-end;
  height: 42px;
}

.btn-search:hover { background: var(--accent-hover); }
.btn-search:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Results ── */
#results { width: 100%; }

#summary-bar {
  border-radius: var(--radius);
  padding: 0.85rem 1.1rem;
  margin-bottom: 1rem;
  font-weight: 600;
  font-size: 0.93rem;
}

#summary-bar.found {
  background: rgba(239,68,68,0.12);
  border: 1px solid rgba(239,68,68,0.4);
  color: #fca5a5;
}

#summary-bar.clean {
  background: rgba(34,197,94,0.12);
  border: 1px solid rgba(34,197,94,0.4);
  color: #86efac;
}

.breach-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  margin-bottom: 0.75rem;
  backdrop-filter: blur(8px);
}

.breach-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.breach-source {
  font-weight: 700;
  font-size: 0.97rem;
  color: #fca5a5;
  margin-right: 0.5rem;
}

.breach-source-badge {
  display: inline-block;
  background: rgba(59,130,246,0.15);
  border: 1px solid rgba(59,130,246,0.4);
  border-radius: 4px;
  color: #60a5fa;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.breach-id {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.breach-fields {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.5rem 1rem;
}

.breach-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.breach-field-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
}

.breach-field-value {
  font-size: 0.87rem;
  word-break: break-all;
  color: var(--text);
}

.breach-field-value.password {
  font-family: monospace;
  background: rgba(255,255,255,0.06);
  padding: 2px 6px;
  border-radius: 4px;
  color: #fde68a;
}

/* ── Spinner ── */
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

/* ── Footer ── */
.site-footer {
  margin-top: 2rem;
  color: var(--text-muted);
  font-size: 0.78rem;
  text-align: center;
}

.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--text); }

/* ── Overall Progress Bar ── */
.overall-progress-container {
  margin-bottom: 2rem;
  padding: 1.25rem;
  background: rgba(59,130,246,0.08);
  border: 1px solid rgba(59,130,246,0.2);
  border-radius: var(--radius);
}

.overall-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.overall-progress-label {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.overall-progress-percent {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--accent);
}

.overall-progress-bar {
  height: 12px;
  background: var(--input-bg);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}

.overall-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent) 0%, #818cf8 100%);
  width: 0%;
  transition: width 0.1s linear;
  border-radius: 6px;
  box-shadow: 0 0 10px var(--accent-glow);
}

/* ── Generation Stages ── */
.generation-stages {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

.gen-stage {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.1rem;
  opacity: 0.5;
  transition: opacity 0.3s, border-color 0.3s;
}

.gen-stage.active {
  opacity: 1;
  border-color: var(--accent);
}

.gen-stage.complete {
  opacity: 1;
  border-color: var(--green);
}

.gen-stage-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 0.75rem;
}

.gen-stage-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--input-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.gen-stage.active .gen-stage-icon {
  background: rgba(59,130,246,0.15);
}

.gen-stage.complete .gen-stage-icon {
  background: rgba(34,197,94,0.15);
}

.gen-stage-icon svg {
  width: 20px;
  height: 20px;
  color: var(--text-muted);
}

.gen-stage.active .gen-stage-icon svg {
  color: var(--accent);
}

.gen-stage.complete .gen-stage-icon svg {
  color: var(--green);
}

.gen-stage-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.gen-stage-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

.gen-stage-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.gen-stage-status {
  display: flex;
  align-items: center;
}

.gen-pending {
  font-size: 0.8rem;
  color: var(--text-muted);
  opacity: 0.6;
}

.gen-complete {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--green);
}

.spinner-gen {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(59,130,246,0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.gen-progress-bar {
  height: 6px;
  background: var(--input-bg);
  border-radius: 3px;
  overflow: hidden;
}

.gen-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent) 0%, #818cf8 100%);
  width: 0%;
  transition: width 0.1s linear;
  border-radius: 3px;
}

.gen-stage.complete .gen-progress-fill {
  background: var(--green);
}

/* ── Download Page ── */
.download-card {
  text-align: center;
  padding: 3rem 2rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.success-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(34,197,94,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 0.4s, transform 0.4s;
}

.success-icon.animate {
  opacity: 1;
  transform: scale(1);
}

.success-icon svg {
  width: 44px;
  height: 44px;
  color: var(--green);
}

.success-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.success-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.btn-download {
  background: var(--accent);
  border: none;
  border-radius: 10px;
  color: #fff;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 700;
  padding: 1rem 2rem;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  transition: background 0.2s, box-shadow 0.2s, transform 0.15s;
  text-decoration: none;
  box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-download:hover {
  background: var(--accent-hover);
  box-shadow: 0 6px 28px var(--accent-glow);
  transform: translateY(-2px);
}

.btn-download:active {
  transform: translateY(0);
}

.btn-download svg {
  width: 20px;
  height: 20px;
}

.report-summary {
  width: 100%;
  max-width: 500px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-top: 2rem;
  display: grid;
  gap: 1rem;
}

.summary-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--input-border);
}

.summary-item:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.summary-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.summary-value {
  font-size: 0.95rem;
  color: var(--text);
  font-weight: 600;
}

.hidden { display: none !important; }

@media (max-width: 560px) {
  .form-grid { grid-template-columns: 1fr; }
  .step-sublabel { display: none; }
}
