/* ── Reset & base ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy:      #0D1B2A;
  --navy-mid:  #1B3A5C;
  --navy-soft: #253F5C;
  --teal:      #0D9973;
  --teal-light:#12B886;
  --teal-pale: #E6F7F3;
  --gold:      #E8A838;
  --slate:     #8AA0B5;
  --slate-pale:#EBF0F5;
  --white:     #FAFCFF;
  --danger:    #D94F3D;
  --warn:      #E8A838;

  --radius:    8px;
  --radius-lg: 16px;
  --shadow:    0 4px 24px rgba(13,27,42,0.14);
  --shadow-lg: 0 12px 48px rgba(13,27,42,0.22);

  --font-display: 'DM Serif Display', Georgia, serif;
  --font-body:    'Inter', system-ui, sans-serif;
  --font-mono:    'DM Mono', 'Courier New', monospace;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--navy);
  color: var(--white);
  min-height: 100vh;
  line-height: 1.6;
}

/* ── Layout ───────────────────────────────────────────────────────────── */
.page-wrap  { max-width: 860px; margin: 0 auto; padding: 0 24px; }

/* ── Header ───────────────────────────────────────────────────────────── */
header {
  border-bottom: 1px solid rgba(255,255,255,0.07);
  padding: 20px 0;
}
header .inner {
  max-width: 860px; margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between;
}
.logo {
  display: flex; align-items: baseline; gap: 6px;
}
.logo-text {
  font-family: var(--font-display);
  font-size: 26px;
  letter-spacing: -0.5px;
  color: var(--white);
}
.logo-dot { color: var(--teal-light); }
.logo-com {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  color: var(--slate);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-left: 2px;
}
.header-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--teal-light);
  background: rgba(13,153,115,0.15);
  border: 1px solid rgba(13,153,115,0.3);
  padding: 4px 10px;
  border-radius: 20px;
  letter-spacing: 0.5px;
}

/* ── Hero ─────────────────────────────────────────────────────────────── */
.hero {
  padding: 52px 0 40px;
  text-align: center;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(32px, 5vw, 48px);
  line-height: 1.15;
  margin-bottom: 14px;
  color: var(--white);
}
.hero h1 em {
  font-style: italic;
  color: var(--teal-light);
}
.hero p {
  font-size: 16px;
  color: var(--slate);
  max-width: 520px;
  margin: 0 auto;
}

/* ── Upload card ──────────────────────────────────────────────────────── */
.card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-bottom: 24px;
}
.card-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--slate);
  margin-bottom: 20px;
}

/* ── Drop zone ────────────────────────────────────────────────────────── */
.drop-zone {
  border: 2px dashed rgba(255,255,255,0.18);
  border-radius: var(--radius);
  padding: 24px 32px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  position: relative;
}
.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--teal-light);
  background: rgba(13,153,115,0.06);
}
.drop-zone input[type="file"] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%;
}
.drop-icon {
  width: 36px; height: 36px; margin: 0 auto 8px;
  background: rgba(13,153,115,0.15);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.drop-icon svg { color: var(--teal-light); }
.drop-zone h3 { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.drop-zone p  { font-size: 13px; color: var(--slate); }
.drop-zone .hint {
  display: inline-block;
  margin-top: 14px;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--slate);
  background: rgba(255,255,255,0.05);
  padding: 4px 10px;
  border-radius: 4px;
}

/* ── File preview ─────────────────────────────────────────────────────── */
.file-preview {
  display: none;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: rgba(13,153,115,0.08);
  border: 1px solid rgba(13,153,115,0.25);
  border-radius: var(--radius);
  margin-top: 16px;
}
.file-preview.visible { display: flex; }
.file-icon {
  width: 36px; height: 36px; flex-shrink: 0;
  background: rgba(13,153,115,0.2);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
}
.file-details { flex: 1; }
.file-details { flex: 1; }
.file-name { font-size: 14px; font-weight: 600; flex: 1; }
.file-meta { font-size: 12px; color: var(--slate); }
.file-remove {
  background: none; border: none; cursor: pointer;
  color: var(--slate); padding: 4px;
  border-radius: 4px; transition: color 0.2s;
}
.file-remove:hover { color: var(--danger); }

/* ── LEI preview chips ────────────────────────────────────────────────── */
.lei-preview { margin-top: 20px; display: none; }
.lei-preview.visible { display: block; }
.lei-preview-label {
  font-size: 11px; font-weight: 600; letter-spacing: 1px;
  text-transform: uppercase; color: var(--slate); margin-bottom: 10px;
}
.lei-chips {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.lei-chip {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 4px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--slate);
  letter-spacing: 0.5px;
}
.more-chip {
  font-size: 11px; padding: 4px 10px;
  border-radius: 4px;
  background: rgba(232,168,56,0.12);
  border: 1px solid rgba(232,168,56,0.25);
  color: var(--gold);
}

/* ── Process button ───────────────────────────────────────────────────── */
.btn-primary {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%;
  background: var(--teal);
  color: #fff;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  padding: 14px 24px;
  cursor: pointer;
  margin-top: 24px;
  transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
  box-shadow: 0 4px 16px rgba(13,153,115,0.3);
}
.btn-primary:hover:not(:disabled) {
  background: var(--teal-light);
  box-shadow: 0 6px 24px rgba(18,184,134,0.35);
}
.btn-primary:active:not(:disabled) { transform: scale(0.99); }
.btn-primary:disabled {
  opacity: 0.45; cursor: not-allowed; box-shadow: none;
}

/* ── Progress section ─────────────────────────────────────────────────── */
#section-progress { display: none; }
#section-progress.visible { display: block; }

.progress-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.progress-title { font-size: 14px; font-weight: 600; }
.progress-count { font-family: var(--font-mono); font-size: 13px; color: var(--teal-light); }

.progress-bar-wrap {
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 20px;
}
.progress-bar {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
}
.progress-bar::-webkit-progress-bar { background: transparent; }
.progress-bar::-webkit-progress-value {
  background: linear-gradient(90deg, var(--teal), var(--teal-light));
  border-radius: 3px;
  transition: width 0.4s ease;
}
.progress-bar::-moz-progress-bar {
  background: linear-gradient(90deg, var(--teal), var(--teal-light));
  border-radius: 3px;
}

/* ── Live feed ────────────────────────────────────────────────────────── */
.live-feed {
  max-height: 240px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  background: rgba(0,0,0,0.25);
  border-radius: var(--radius);
  padding: 12px;
  border: 1px solid rgba(255,255,255,0.07);
}
.live-feed::-webkit-scrollbar { width: 4px; }
.live-feed::-webkit-scrollbar-track { background: transparent; }
.live-feed::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 2px; }

.live-feed-placeholder { color: var(--slate); font-size: 11px; padding: 4px 0; }

.feed-row {
  display: flex; gap: 10px; align-items: center;
  padding: 5px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  animation: fadeIn 0.3s ease;
}
@keyframes fadeIn { from { opacity:0; transform:translateY(4px); } to { opacity:1; transform:none; } }
.feed-lei   { color: var(--slate); flex: 0 0 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-status { flex: 0 0 120px; font-weight: 500; }
.feed-status.active   { color: var(--teal-light); }
.feed-status.inactive { color: var(--danger); }
.feed-status.unknown  { color: var(--gold); }
.feed-renewal { color: var(--slate); flex: 1; }
.feed-source  { color: rgba(255,255,255,0.3); font-size: 10px; }

/* ── Results section ──────────────────────────────────────────────────── */
#section-results { display: none; }
#section-results.visible { display: block; }

.results-summary {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
  margin-bottom: 24px;
}
.stat-box {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius);
  padding: 16px 18px;
  text-align: center;
}
.stat-box.active  { border-color: rgba(13,153,115,0.35); background: rgba(13,153,115,0.06); }
.stat-box.inactive{ border-color: rgba(217,79,61,0.35);  background: rgba(217,79,61,0.06);  }
.stat-box.missing { border-color: rgba(232,168,56,0.35); background: rgba(232,168,56,0.06); }
.stat-num {
  font-family: var(--font-display);
  font-size: 36px;
  line-height: 1;
  margin-bottom: 4px;
}
.stat-box.active   .stat-num { color: var(--teal-light); }
.stat-box.inactive .stat-num { color: var(--danger); }
.stat-box.missing  .stat-num { color: var(--gold); }
.stat-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.8px; color: var(--slate); }

/* ── Download button ──────────────────────────────────────────────────── */
.btn-download {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%;
  background: rgba(13,153,115,0.12);
  border: 1.5px solid var(--teal);
  color: var(--teal-light);
  font-family: var(--font-body);
  font-size: 15px; font-weight: 600;
  border-radius: var(--radius);
  padding: 14px 24px;
  cursor: pointer;
  transition: background 0.2s;
  text-decoration: none;
}
.btn-download:hover {
  background: rgba(13,153,115,0.22);
}

/* ── Error / toast ────────────────────────────────────────────────────── */
.toast {
  display: none;
  background: rgba(217,79,61,0.15);
  border: 1px solid rgba(217,79,61,0.4);
  color: #FF8A7A;
  border-radius: var(--radius);
  padding: 14px 18px;
  font-size: 14px;
  margin-bottom: 16px;
}
.toast.visible { display: block; }

/* ── Footer ───────────────────────────────────────────────────────────── */
footer {
  text-align: center;
  padding: 40px 0 32px;
  font-size: 12px;
  color: rgba(138,160,181,0.5);
}
footer a { color: var(--slate); text-decoration: none; }
footer a:hover { color: var(--teal-light); }

/* ── 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.7s linear infinite;
  display: none;
}
@keyframes spin { to { transform: rotate(360deg); } }
.spinning { display: inline-block; }

/* ── Responsive ───────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .results-summary { grid-template-columns: 1fr; }
  .hero h1 { font-size: 28px; }
  .card { padding: 20px; }
}
  
