/* analyzer/static/analyzer/css/index.css */

:root {
  --bg: #07050f;
  --panel: #0f0c1d;
  --panel-alt: #160f2a;
  --border: rgba(160,130,255,0.12);
  --border-hover: rgba(160,130,255,0.3);
  --accent: #a07fff;
  --accent-dim: rgba(160,127,255,0.15);
  --text: #f0ecff;
  --text-soft: #9b93bc;
  --text-muted: #5a5270;
  --success: #4ade80;
  --radius: 16px;
  --radius-sm: 10px;
}

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

body {
  background: var(--bg);
  font-family: 'DM Sans', sans-serif;
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(circle, rgba(160,127,255,0.06) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: '';
  position: fixed;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, rgba(120,80,255,0.12) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ===== Layout ===== */

.page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 20px 80px;
}

/* ===== Navbar ===== */

.navbar {
  width: 100%;
  max-width: 720px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0;
  margin-bottom: 40px;
}

.navbar-logo {
  font-family: 'Syne', sans-serif;
  font-size: 16px;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.01em;
  text-decoration: none;
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.navbar-user {
  font-size: 13px;
  color: var(--text-soft);
}

.navbar-usos {
  font-size: 12px;
  padding: 4px 10px;
  background: var(--accent-dim);
  border: 1px solid var(--border-hover);
  border-radius: 100px;
  color: var(--accent);
  font-weight: 500;
}

.navbar-usos.agotado {
  background: rgba(239,68,68,0.08);
  border-color: rgba(239,68,68,0.2);
  color: #f87171;
}

.btn-nav {
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 13px;
  text-decoration: none;
  font-family: 'DM Sans', sans-serif;
  transition: opacity 0.2s;
}

.btn-nav:hover { opacity: 0.85; }

.btn-nav-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-soft);
}

.btn-nav-solid {
  background: var(--accent);
  border: none;
  color: #07050f;
  font-weight: 600;
}

/* ===== Header ===== */

.header {
  text-align: center;
  margin-bottom: 48px;
  animation: fadeUp 0.6s ease both;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-dim);
  border: 1px solid var(--border-hover);
  border-radius: 100px;
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s infinite;
}

h1 {
  font-family: 'Syne', sans-serif;
  font-size: clamp(32px, 6vw, 52px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 14px;
}

h1 span { color: var(--accent); }

.subtitle {
  font-size: 16px;
  color: var(--text-soft);
  max-width: 440px;
  margin: 0 auto;
  line-height: 1.6;
  font-weight: 300;
}

/* ===== Card ===== */

.card {
  width: 100%;
  max-width: 620px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px;
  animation: fadeUp 0.6s 0.15s ease both;
}

.field { margin-bottom: 20px; }

label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

input[type="text"],
select {
  width: 100%;
  background: var(--panel-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
  appearance: none;
}

input[type="text"]:focus,
select:focus { border-color: var(--border-hover); }

input[type="text"]::placeholder { color: var(--text-muted); }

select option { background: #1a1430; }

/* ===== Upload zone ===== */

.upload-zone {
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  position: relative;
  margin-bottom: 24px;
}

.upload-zone:hover,
.upload-zone.drag-over {
  border-color: var(--border-hover);
  background: var(--accent-dim);
}

.upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.upload-icon {
  width: 40px;
  height: 40px;
  margin: 0 auto 12px;
  background: var(--accent-dim);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.upload-icon svg {
  width: 20px;
  height: 20px;
  stroke: var(--accent);
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.upload-text {
  font-size: 14px;
  color: var(--text-soft);
  line-height: 1.5;
}

.upload-text strong {
  color: var(--accent);
  font-weight: 500;
}

.upload-filename {
  font-size: 13px;
  color: var(--success);
  margin-top: 8px;
  display: none;
}

/* ===== Botones ===== */

button[type="submit"] {
  width: 100%;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  padding: 15px;
  font-family: 'Syne', sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #07050f;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

button[type="submit"]:hover { opacity: 0.88; }
button[type="submit"]:active { transform: scale(0.99); }
button[type="submit"]:disabled { opacity: 0.4; cursor: not-allowed; }

.loader {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(7,5,15,0.3);
  border-top-color: #07050f;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ===== Paywall ===== */

.paywall {
  width: 100%;
  max-width: 620px;
  background: rgba(239,68,68,0.05);
  border: 1px solid rgba(239,68,68,0.15);
  border-radius: var(--radius);
  padding: 40px 36px;
  text-align: center;
  animation: fadeUp 0.6s 0.15s ease both;
}

.paywall-icon { font-size: 32px; margin-bottom: 14px; }

.paywall-title {
  font-family: 'Syne', sans-serif;
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 10px;
}

.paywall-sub {
  font-size: 14px;
  color: var(--text-soft);
  margin-bottom: 24px;
  line-height: 1.6;
}

.btn-paywall {
  display: inline-block;
  background: var(--accent);
  color: #07050f;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 15px;
  padding: 13px 32px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: opacity 0.2s;
}

.btn-paywall:hover { opacity: 0.88; }

/* ===== Resultado ===== */

.resultado-wrap {
  width: 100%;
  max-width: 620px;
  margin-top: 20px;
  display: none;
  animation: fadeUp 0.4s ease both;
}

.resultado-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding: 0 2px;
}

.resultado-header span {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.copy-btn {
  background: var(--panel-alt);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 12px;
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  color: var(--text-soft);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.copy-btn:hover {
  border-color: var(--border-hover);
  color: var(--text);
}

.resultado-box {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  white-space: pre-wrap;
  font-size: 14px;
  line-height: 1.75;
  color: var(--text-soft);
  max-height: 520px;
  overflow-y: auto;
}

.resultado-box::-webkit-scrollbar { width: 4px; }
.resultado-box::-webkit-scrollbar-track { background: transparent; }
.resultado-box::-webkit-scrollbar-thumb {
  background: var(--border-hover);
  border-radius: 4px;
}

/* ===== Botón descarga grande ===== */

.btn-download {
  width: 100%;
  max-width: 620px;
  margin-top: 16px;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  padding: 18px;
  font-family: 'Syne', sans-serif;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #07050f;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn-download:hover { opacity: 0.88; }
.btn-download:active { transform: scale(0.99); }
.btn-download:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-download svg {
  width: 20px;
  height: 20px;
  stroke: #07050f;
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn-download-locked {
  width: 100%;
  max-width: 620px;
  margin-top: 16px;
  background: var(--panel-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px;
  font-family: 'Syne', sans-serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: not-allowed;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-decoration: none;
}

/* ===== Score module ===== */

.score-wrap {
  width: 100%;
  max-width: 620px;
  margin-top: 20px;
  display: none;
  animation: fadeUp 0.4s ease both;
}

.score-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}

.score-top {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 24px;
}

.score-circle-wrap {
  position: relative;
  width: 100px;
  height: 100px;
  flex-shrink: 0;
}

.score-circle-wrap svg { transform: rotate(-90deg); }

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

.score-number span:first-child {
  font-family: 'Syne', sans-serif;
  font-size: 26px;
  font-weight: 800;
  color: var(--text);
}

.score-number span:last-child {
  font-size: 11px;
  color: var(--text-muted);
}

.score-info { flex: 1; }

.score-title {
  font-family: 'Syne', sans-serif;
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 6px;
}

.score-veredicto {
  font-size: 13px;
  color: var(--text-soft);
  line-height: 1.5;
}

.score-bars {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.score-bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.score-bar-label {
  font-size: 12px;
  color: var(--text-soft);
  min-width: 160px;
}

.score-bar-bg {
  flex: 1;
  height: 6px;
  background: var(--panel-alt);
  border-radius: 3px;
  overflow: hidden;
}

.score-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 1s ease;
}

.score-bar-val {
  font-size: 12px;
  font-weight: 500;
  min-width: 28px;
  text-align: right;
}

/* ===== Score bloqueado ===== */

.score-locked {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  text-align: center;
}

.score-locked-icon { font-size: 28px; margin-bottom: 10px; }

.score-locked-title {
  font-family: 'Syne', sans-serif;
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 6px;
}

.score-locked-sub {
  font-size: 13px;
  color: var(--text-soft);
  margin-bottom: 16px;
}

.score-locked-btn {
  display: inline-block;
  background: var(--accent);
  color: #07050f;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 13px;
  padding: 10px 24px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: opacity 0.2s;
}

.score-locked-btn:hover { opacity: 0.88; }

/* ===== Misc ===== */

.error-msg {
  display: none;
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.2);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 13px;
  color: #f87171;
  margin-top: 16px;
}

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 24px 0;
}

/* ===== Animaciones ===== */

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

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

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

/* ===== Responsive ===== */

@media (max-width: 660px) {
  .card, .paywall { padding: 24px 20px; }
  .page { padding: 0 16px 60px; }
  .navbar { padding: 16px 0; margin-bottom: 28px; }
  .navbar-user { display: none; }
  .score-bar-label { min-width: 110px; font-size: 11px; }
  .score-top { flex-direction: column; align-items: flex-start; }
}