/* ==========================================================================
   HeicaJPG — por BenaviDev
   Paleta vibrante y amigable pensada para retención: gradientes cálidos,
   microinteracciones y gamificación ligera (racha + logros).
   ========================================================================== */
:root {
  /* Paleta principal: cálida, energética, "adictiva" sin ser agresiva */
  --violet:      #7c3aed;
  --violet-dark: #5b21b6;
  --pink:        #ec4899;
  --orange:      #f97316;
  --amber:       #fbbf24;
  --teal:        #14b8a6;

  --bg:          #fafaf9;
  --surface:     #ffffff;
  --surface-2:   #f4f2ff;
  --border:      #e9e5f5;
  --text:        #1f1b2e;
  --text-dim:    #6b6478;

  --gradient-main: linear-gradient(135deg, var(--violet) 0%, var(--pink) 55%, var(--orange) 100%);
  --gradient-soft: linear-gradient(135deg, #f5f0ff 0%, #fff0f6 50%, #fff7ed 100%);

  --shadow-sm: 0 2px 8px rgba(124, 58, 237, 0.08);
  --shadow-md: 0 8px 24px rgba(124, 58, 237, 0.14);
  --shadow-lg: 0 16px 40px rgba(124, 58, 237, 0.18);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background-color: var(--bg);
  color: var(--text);
  font-family: "Inter", "Segoe UI", sans-serif;
  line-height: 1.5;
}
h1, h2, h3, .brand-name, .btn-primary, .btn-secondary, .hero-badge {
  font-family: "Poppins", "Inter", sans-serif;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

.text-gradient {
  background: var(--gradient-main);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------------------------------------------------------------- Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.brand-lockup {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
}
.brand-logo { border-radius: 9px; }
.brand-name {
  font-weight: 800;
  font-size: 19px;
  color: var(--text);
}
.brand-accent { color: var(--pink); }
.main-nav {
  display: flex;
  gap: 22px;
  font-weight: 600;
  font-size: 14px;
  color: var(--text-dim);
}
.main-nav a:hover { color: var(--violet); }
.nav-cta {
  background: var(--gradient-main);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  padding: 10px 18px;
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
}
.nav-cta:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }

/* ---------------------------------------------------------------- Hero */
.hero {
  background: var(--gradient-soft);
  padding: 64px 24px 40px;
  text-align: center;
}
.hero-inner { max-width: 760px; margin: 0 auto; }
.hero-badge {
  display: inline-block;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 700;
  color: var(--violet-dark);
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}
h1 {
  font-size: 42px;
  font-weight: 800;
  line-height: 1.15;
  margin: 0 0 16px;
}
.hero-sub {
  font-size: 17px;
  color: var(--text-dim);
  max-width: 560px;
  margin: 0 auto 24px;
}
.hero-trust {
  display: flex;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
}

/* ---------------------------------------------------------------- Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow-md);
}

/* ------------------------------------------------------------ Conversor */
.converter-section {
  max-width: 760px;
  margin: -18px auto 0;
  padding: 0 24px 20px;
  position: relative;
  z-index: 2;
}
.converter-card { padding: 28px; }

.dropzone {
  border: 2.5px dashed #d8cdf5;
  border-radius: 18px;
  padding: 46px 24px;
  text-align: center;
  cursor: pointer;
  background: var(--surface-2);
  transition: border-color .15s ease, background-color .15s ease, transform .1s ease;
}
.dropzone:hover, .dropzone:focus {
  border-color: var(--violet);
  background: #efe8ff;
  outline: none;
}
.dropzone.dragover {
  border-color: var(--pink);
  background: #fdeaf3;
  transform: scale(1.01);
}
.dropzone-icon { font-size: 44px; margin-bottom: 10px; }
.dropzone-title { font-weight: 700; font-size: 17px; margin: 0 0 4px; }
.dropzone-sub { color: var(--text-dim); font-size: 13px; margin: 0; }

.options-row {
  display: flex;
  gap: 20px;
  margin-top: 20px;
  flex-wrap: wrap;
}
.option { flex: 1; min-width: 180px; }
.option:only-child { flex: 0 1 260px; }
.option label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.select {
  width: 100%;
  padding: 11px 13px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  font-family: inherit;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}
.select:focus { outline: none; border-color: var(--violet); }
input[type="range"] {
  width: 100%;
  accent-color: var(--violet);
}

.file-list {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 320px;
  overflow-y: auto;
}
.file-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 14px;
}
.file-thumb {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  object-fit: cover;
  background: #eee;
  flex-shrink: 0;
}
.file-info { flex: 1; min-width: 0; }
.file-name {
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.file-meta { font-size: 12px; color: var(--text-dim); }
.file-status {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.file-status.pending { background: #f1eefe; color: var(--violet-dark); }
.file-status.done { background: #e6f8f1; color: #0d9467; }
.file-status.error { background: #fdeaea; color: #d13a3a; }
.file-download {
  font-size: 12px;
  font-weight: 700;
  color: var(--violet);
}

.actions-row {
  display: flex;
  gap: 12px;
  margin-top: 22px;
  flex-wrap: wrap;
}
.btn-primary, .btn-secondary, .btn-ghost {
  border: none;
  border-radius: 999px;
  padding: 14px 24px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: transform .1s ease, box-shadow .15s ease, opacity .15s ease;
  font-family: inherit;
}
.btn-primary {
  background: var(--gradient-main);
  color: #fff;
  box-shadow: var(--shadow-sm);
  flex: 1;
}
.btn-primary:hover:not(:disabled) { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary.btn-lg { padding: 16px 32px; font-size: 16px; flex: none; }
.btn-secondary {
  background: var(--surface-2);
  color: var(--violet-dark);
  border: 1.5px solid var(--border);
}
.btn-secondary:hover { background: #ece6fb; }
.btn-ghost {
  background: transparent;
  color: var(--text-dim);
}
.btn-ghost:hover { color: var(--text); }

.status-text {
  margin: 16px 0 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  text-align: center;
}

/* ------------------------------------------------------------ Racha */
.streak-card {
  max-width: 420px;
  margin: 18px auto 0;
  background: linear-gradient(135deg, #fff7ed, #fff0f6);
  border: 1.5px solid #ffdca8;
  border-radius: 16px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  animation: popIn .3s ease;
}
.streak-flame { font-size: 26px; }
.streak-card strong { display: block; font-size: 14px; }
.streak-card p { margin: 2px 0 0; font-size: 12px; color: var(--text-dim); }
@keyframes popIn {
  from { opacity: 0; transform: translateY(-6px) scale(.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ------------------------------------------------------------ Logros */
.achievements-section {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 24px 10px;
  text-align: center;
}
.achievements-section h2 { font-size: 24px; margin-bottom: 20px; }
.achievements-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.achievement {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 18px 10px;
  text-align: center;
  transition: transform .15s ease, box-shadow .15s ease;
}
.achievement.locked { opacity: 0.4; filter: grayscale(1); }
.achievement.unlocked {
  opacity: 1;
  filter: none;
  border-color: var(--amber);
  box-shadow: var(--shadow-sm);
  animation: popIn .4s ease;
}
.ach-icon { font-size: 30px; display: block; margin-bottom: 6px; }
.ach-name { font-size: 12px; font-weight: 700; color: var(--text-dim); }

/* ------------------------------------------------------------ Secciones genéricas */
.how-section, .why-section, .faq-section {
  max-width: 1000px;
  margin: 0 auto;
  padding: 56px 24px;
}
.how-section h2, .why-section h2, .faq-section h2 {
  text-align: center;
  font-size: 28px;
  margin-bottom: 34px;
}
.steps-grid, .why-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.why-grid { grid-template-columns: repeat(4, 1fr); }
.step-card, .why-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 26px 20px;
  text-align: center;
}
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--gradient-main);
  color: #fff;
  font-weight: 800;
  margin-bottom: 12px;
}
.step-card h3, .why-card h3 { font-size: 16px; margin: 8px 0 6px; }
.step-card p, .why-card p { font-size: 13.5px; color: var(--text-dim); margin: 0; }
.why-icon { font-size: 30px; }

/* ------------------------------------------------------------ FAQ */
.faq-list { display: flex; flex-direction: column; gap: 10px; }
.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 20px;
}
.faq-item summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 15px;
  list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; float: right; color: var(--violet); font-weight: 800; }
.faq-item[open] summary::after { content: "−"; }
.faq-item p { color: var(--text-dim); font-size: 14px; margin: 10px 0 0; }

/* ------------------------------------------------------------ CTA final */
.final-cta {
  background: var(--gradient-main);
  color: #fff;
  text-align: center;
  padding: 60px 24px;
  border-radius: 32px;
  max-width: 1000px;
  margin: 20px auto 60px;
}
.final-cta h2 { font-size: 28px; margin: 0 0 10px; }
.final-cta p { opacity: 0.9; margin: 0 0 24px; }
.final-cta .btn-primary.btn-lg {
  background: #fff;
  color: var(--violet-dark);
  display: inline-block;
}

/* ------------------------------------------------------------ Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 30px 24px 20px;
}
.footer-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 14px;
}
.footer-links {
  display: flex;
  gap: 18px;
  font-size: 13px;
  color: var(--text-dim);
}
.footer-links a:hover { color: var(--violet); }
.footer-copy {
  text-align: center;
  font-size: 12px;
  color: var(--text-dim);
  margin: 18px 0 0;
}

/* ------------------------------------------------------------ Toast */
.toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: #fff;
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  z-index: 100;
  animation: popIn .2s ease;
}
.toast.error { background: #d13a3a; }
.toast.success { background: #0d9467; }

/* ------------------------------------------------------------ Responsivo */
@media (max-width: 720px) {
  .main-nav { display: none; }
  h1 { font-size: 30px; }
  .achievements-grid { grid-template-columns: repeat(2, 1fr); }
  .steps-grid { grid-template-columns: 1fr; }
  .why-grid { grid-template-columns: repeat(2, 1fr); }
  .options-row { flex-direction: column; }
  .actions-row { flex-direction: column; }
  .btn-primary, .btn-secondary, .btn-ghost { width: 100%; }
}
