/* ============================================================
   LectorDEHu · main.css
   Diseño sobrio y profesional. Sin dependencias externas.
   ============================================================ */

/* ── Variables ────────────────────────────────────────────── */
:root {
  --clr-brand:      #1a4e8c;
  --clr-brand-dark: #133a6a;
  --clr-accent:     #e05a00;
  --clr-accent-dk:  #b84900;
  --clr-text:       #1c1c1e;
  --clr-muted:      #5a5a72;
  --clr-border:     #d4d8e0;
  --clr-bg:         #f7f8fa;
  --clr-white:      #ffffff;
  --clr-warn-bg:    #fff8ec;
  --clr-warn-bdr:   #e0a000;
  --clr-info-bg:    #edf4ff;
  --clr-info-bdr:   #1a4e8c;
  --clr-ok-bg:      #edfbf3;
  --clr-ok-bdr:     #1a8c4e;

  --radius:    6px;
  --radius-lg: 10px;
  --shadow-sm: 0 1px 4px rgba(0,0,0,.08);
  --shadow:    0 4px 16px rgba(0,0,0,.10);

  --max-w: 1080px;
  --font:  system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* ── Reset mínimo ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--clr-text);
  background: var(--clr-white);
}
img { max-width: 100%; display: block; }
a { color: var(--clr-brand); }
a:hover { color: var(--clr-brand-dark); }

/* ── Utilidades de layout ─────────────────────────────────── */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 1.25rem; }
.section    { padding: 2.5rem 0; }
.section-sm { padding: 1.5rem 0; }
.section-alt { background: var(--clr-bg); }

/* ── Tipografía ───────────────────────────────────────────── */
h1 { font-size: clamp(1.75rem, 4vw, 2.6rem); line-height: 1.2; font-weight: 700; }
h2 { font-size: clamp(1.35rem, 3vw, 2rem);   line-height: 1.25; font-weight: 700; margin-bottom: .75rem; }
h3 { font-size: 1.15rem; font-weight: 600; margin-bottom: .5rem; }
p  { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }
small { font-size: .85rem; color: var(--clr-muted); }

/* ── Botones ──────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .75rem 1.5rem; border-radius: var(--radius);
  font-size: .95rem; font-weight: 600; text-decoration: none;
  cursor: pointer; border: 2px solid transparent;
  transition: background .15s, color .15s, border-color .15s, box-shadow .15s;
  white-space: nowrap;
}
.btn-primary {
  background: var(--clr-accent); color: var(--clr-white);
  border-color: var(--clr-accent);
}
.btn-primary:hover { background: var(--clr-accent-dk); border-color: var(--clr-accent-dk); color: var(--clr-white); }
.btn-secondary {
  background: transparent; color: var(--clr-brand);
  border-color: var(--clr-brand);
}
.btn-secondary:hover { background: var(--clr-brand); color: var(--clr-white); }
.btn-ghost {
  background: transparent; color: var(--clr-muted);
  border-color: var(--clr-border);
}
.btn-ghost:hover { background: var(--clr-bg); }
.btn-sm { padding: .45rem 1rem; font-size: .85rem; }
.btn-danger { background: #c0392b; color: #fff; border-color: #c0392b; }
.btn-danger:hover { background: #962d22; border-color: #962d22; color: #fff; }
.btn-success { background: #1a8c4e; color: #fff; border-color: #1a8c4e; }
.btn-success:hover { background: #136638; border-color: #136638; color: #fff; }

/* ── Cabecera ─────────────────────────────────────────────── */
.site-header {
  background: var(--clr-white);
  border-bottom: 1px solid var(--clr-border);
  position: sticky; top: 0; z-index: 100;
  box-shadow: var(--shadow-sm);
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: .85rem; padding-bottom: .85rem;
  gap: 1rem;
}
.site-logo {
  font-size: 1.2rem; font-weight: 800; color: var(--clr-brand);
  text-decoration: none; letter-spacing: -.02em;
}
.site-logo span { color: var(--clr-accent); }

.site-nav { display: flex; align-items: center; gap: 1.5rem; }
.site-nav a {
  font-size: .9rem; font-weight: 500; color: var(--clr-muted);
  text-decoration: none; transition: color .15s;
}
.site-nav a:hover, .site-nav a.active { color: var(--clr-brand); }
.site-nav .btn { margin-left: .5rem; }

/* Menú hamburguesa móvil */
.nav-toggle {
  display: none; background: none; border: none;
  cursor: pointer; padding: .4rem;
  flex-direction: column; gap: 5px;
}
.nav-toggle span {
  display: block; width: 24px; height: 2px;
  background: var(--clr-text); border-radius: 2px;
  transition: all .2s;
}
@media (max-width: 720px) {
  .nav-toggle { display: flex; }
  .site-nav {
    display: none; flex-direction: column; align-items: flex-start;
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--clr-white); padding: 1rem 1.25rem 1.5rem;
    border-bottom: 1px solid var(--clr-border);
    box-shadow: var(--shadow);
    gap: .75rem;
  }
  .site-nav.open { display: flex; }
  .site-nav .btn { width: 100%; justify-content: center; }
}

/* ── Footer ───────────────────────────────────────────────── */
.site-footer {
  background: var(--clr-brand-dark); color: rgba(255,255,255,.75);
  padding: 1.75rem 0 1rem;
  margin-top: 2rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 2rem; margin-bottom: 2rem;
}
.footer-col h4 { color: #fff; font-size: .9rem; margin-bottom: .75rem; font-weight: 600; }
.footer-col a  {
  display: block; color: rgba(255,255,255,.65); text-decoration: none;
  font-size: .85rem; margin-bottom: .35rem;
  transition: color .15s;
}
.footer-col a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.15);
  padding-top: 1.25rem; font-size: .8rem;
  display: flex; flex-wrap: wrap; gap: .5rem;
  justify-content: space-between; align-items: center;
}
.footer-aviso {
  background: rgba(0,0,0,.2); border-radius: var(--radius);
  padding: .75rem 1rem; font-size: .8rem;
  margin-bottom: 1.5rem;
  color: rgba(255,255,255,.7);
}

/* ── Hero ─────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--clr-brand) 0%, var(--clr-brand-dark) 100%);
  color: #fff; padding: 5rem 0 4rem;
  text-align: center;
}
.hero h1 { color: #fff; margin-bottom: 1.25rem; }
.hero-lead {
  font-size: 1.15rem; color: rgba(255,255,255,.85);
  max-width: 640px; margin: 0 auto 2rem;
}
.hero-ctas { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.hero .btn-secondary {
  color: #fff; border-color: rgba(255,255,255,.6);
}
.hero .btn-secondary:hover { background: rgba(255,255,255,.15); color: #fff; }

/* ── Sección de problema ──────────────────────────────────── */
.problem-list {
  list-style: none; display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: .75rem; margin-top: 1.5rem;
}
.problem-list li {
  background: var(--clr-bg); border-radius: var(--radius);
  padding: .75rem 1rem;
  border-left: 3px solid var(--clr-accent);
  font-size: .875rem;
}

/* ── Cards de beneficios / funcionalidades ────────────────── */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.5rem; margin-top: 2rem;
}
.card {
  background: var(--clr-white); border: 1px solid var(--clr-border);
  border-radius: var(--radius-lg); padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s;
}
.card:hover { box-shadow: var(--shadow); }
.card-icon { font-size: 1.75rem; margin-bottom: .75rem; }
.card h3 { font-size: 1rem; margin-bottom: .5rem; }

/* Variante de cards forzada a una sola fila */
.cards-4 {
  grid-template-columns: repeat(4, 1fr);
}
@media (max-width: 720px) {
  .cards-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 400px) {
  .cards-4 { grid-template-columns: 1fr; }
}

/* ── Perfiles ─────────────────────────────────────────────── */
.profiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem; margin-top: 2rem;
}
.profile-card {
  background: var(--clr-info-bg);
  border: 1px solid var(--clr-info-bdr);
  border-radius: var(--radius); padding: 1.25rem;
}
.profile-card h3 { color: var(--clr-brand); font-size: .95rem; }

/* ── Pasos ────────────────────────────────────────────────── */
.steps { list-style: none; counter-reset: step; margin-top: 1.5rem; }
.steps li {
  counter-increment: step;
  display: flex; gap: 1.25rem;
  padding: 1rem 0; border-bottom: 1px solid var(--clr-border);
}
.steps li:last-child { border-bottom: none; }
.step-num {
  flex-shrink: 0; width: 2rem; height: 2rem;
  background: var(--clr-brand); color: #fff;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .9rem;
}

/* ── Tabla comparativa / datos ────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; margin-top: 1rem; font-size: .9rem; }
.data-table th {
  background: var(--clr-brand); color: #fff;
  padding: .7rem 1rem; text-align: left; font-weight: 600;
}
.data-table td { padding: .65rem 1rem; border-bottom: 1px solid var(--clr-border); }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:nth-child(even) td { background: var(--clr-bg); }
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--clr-border); }

/* ── Avisos (notice) ──────────────────────────────────────── */
.notice {
  border-radius: var(--radius); padding: 1rem 1.25rem;
  margin: 1.5rem 0; font-size: .9rem; display: flex; gap: .75rem;
}
.notice-warn  { background: var(--clr-warn-bg);  border: 1px solid var(--clr-warn-bdr); }
.notice-info  { background: var(--clr-info-bg);  border: 1px solid var(--clr-info-bdr); }
.notice-ok    { background: var(--clr-ok-bg);    border: 1px solid var(--clr-ok-bdr); }
.notice-icon  { font-size: 1.2rem; flex-shrink: 0; line-height: 1.4; }

/* ── FAQ accordion ────────────────────────────────────────── */
.faq-list { margin-top: 1.5rem; }
.faq-item {
  border: 1px solid var(--clr-border); border-radius: var(--radius);
  margin-bottom: .75rem; overflow: hidden;
}
.faq-question {
  width: 100%; text-align: left; background: none;
  border: none; padding: 1rem 1.25rem;
  font-size: .95rem; font-weight: 600; color: var(--clr-text);
  cursor: pointer; display: flex; justify-content: space-between; align-items: center;
  gap: 1rem;
}
.faq-question:hover { background: var(--clr-bg); }
.faq-question::after { content: '+'; font-size: 1.25rem; color: var(--clr-muted); flex-shrink: 0; }
.faq-item.open .faq-question { background: var(--clr-info-bg); color: var(--clr-brand); }
.faq-item.open .faq-question::after { content: '−'; color: var(--clr-brand); }
.faq-answer {
  display: none; padding: 1rem 1.25rem; font-size: .9rem;
  background: var(--clr-white); border-top: 1px solid var(--clr-border);
}
.faq-item.open .faq-answer { display: block; }

/* ── Bloque de descarga ───────────────────────────────────── */
.download-box {
  background: var(--clr-ok-bg); border: 1px solid var(--clr-ok-bdr);
  border-radius: var(--radius-lg); padding: 2rem;
  text-align: center; margin: 2rem 0;
}
.download-box .version-badge {
  display: inline-block; background: var(--clr-brand); color: #fff;
  font-size: .8rem; font-weight: 700; padding: .2rem .6rem;
  border-radius: 20px; margin-bottom: .75rem; letter-spacing: .04em;
}
.download-box h2 { font-size: 1.4rem; margin-bottom: .5rem; }
.download-meta { font-size: .85rem; color: var(--clr-muted); margin-bottom: 1.25rem; }
.download-meta span { margin: 0 .5rem; }
.sha-block {
  background: #f0f4f8; border-radius: var(--radius);
  padding: .6rem 1rem; font-family: monospace; font-size: .8rem;
  word-break: break-all; margin: 1rem 0;
  border: 1px solid var(--clr-border); text-align: left;
}

/* ── Contadores stats ─────────────────────────────────────── */
.stats-row {
  display: flex; gap: 1.5rem; flex-wrap: wrap;
  justify-content: center; margin: 1.5rem 0;
}
.stat-item { text-align: center; }
.stat-num { font-size: 2rem; font-weight: 800; color: var(--clr-brand); line-height: 1; }
.stat-label { font-size: .8rem; color: var(--clr-muted); }

/* ── Páginas legales ──────────────────────────────────────── */
.legal-content { max-width: 760px; margin: 0 auto; }
.legal-content h2 { margin-top: 2rem; margin-bottom: .5rem; font-size: 1.2rem; }
.legal-content h3 { margin-top: 1.5rem; margin-bottom: .4rem; font-size: 1rem; }
.legal-content ul, .legal-content ol { padding-left: 1.5rem; margin-bottom: 1rem; }
.legal-content li { margin-bottom: .35rem; }

/* ── Admin ────────────────────────────────────────────────── */
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 220px; flex-shrink: 0;
  background: var(--clr-brand-dark); color: #fff;
  padding: 1.5rem 0;
}
.admin-sidebar .logo {
  padding: 0 1.25rem 1.5rem; font-size: 1.1rem; font-weight: 800;
  border-bottom: 1px solid rgba(255,255,255,.15); margin-bottom: 1rem;
  display: block; color: #fff; text-decoration: none;
}
.admin-sidebar nav a {
  display: flex; align-items: center; gap: .6rem;
  padding: .6rem 1.25rem; color: rgba(255,255,255,.7);
  text-decoration: none; font-size: .9rem;
  transition: background .15s, color .15s;
}
.admin-sidebar nav a:hover, .admin-sidebar nav a.active {
  background: rgba(255,255,255,.1); color: #fff;
}
.admin-main { flex: 1; background: var(--clr-bg); overflow-y: auto; }
.admin-topbar {
  background: var(--clr-white); border-bottom: 1px solid var(--clr-border);
  padding: 1rem 2rem; display: flex; justify-content: space-between; align-items: center;
}
.admin-content { padding: 2rem; }
.admin-content h1 { font-size: 1.5rem; margin-bottom: 1.5rem; }

.admin-card {
  background: var(--clr-white); border: 1px solid var(--clr-border);
  border-radius: var(--radius-lg); padding: 1.5rem; margin-bottom: 1.5rem;
}
.admin-card h2 { font-size: 1rem; color: var(--clr-muted); font-weight: 600; margin-bottom: .25rem; }
.admin-card .big-num { font-size: 2.5rem; font-weight: 800; color: var(--clr-brand); line-height: 1; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; margin-bottom: 2rem; }

/* ── Formularios ──────────────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; font-size: .9rem; font-weight: 600; margin-bottom: .4rem; }
.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"],
.form-group textarea,
.form-group select {
  width: 100%; padding: .65rem .85rem;
  border: 1px solid var(--clr-border); border-radius: var(--radius);
  font-size: .95rem; font-family: var(--font);
  transition: border-color .15s, box-shadow .15s;
  background: var(--clr-white);
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--clr-brand);
  box-shadow: 0 0 0 3px rgba(26,78,140,.15);
}
.form-group textarea { resize: vertical; min-height: 80px; }
.form-hint { font-size: .8rem; color: var(--clr-muted); margin-top: .3rem; }

/* ── Alertas ──────────────────────────────────────────────── */
.alert { border-radius: var(--radius); padding: .85rem 1.1rem; margin-bottom: 1.25rem; font-size: .9rem; }
.alert-ok    { background: var(--clr-ok-bg);   border: 1px solid var(--clr-ok-bdr);   color: #1a5c35; }
.alert-error { background: #fef0f0;             border: 1px solid #e74c3c;             color: #7b1e1e; }
.alert-warn  { background: var(--clr-warn-bg); border: 1px solid var(--clr-warn-bdr); color: #7a4a00; }

/* ── Tabla admin ──────────────────────────────────────────── */
.admin-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.admin-table th { background: var(--clr-bg); padding: .65rem .85rem; text-align: left; font-weight: 600; border-bottom: 2px solid var(--clr-border); }
.admin-table td { padding: .65rem .85rem; border-bottom: 1px solid var(--clr-border); vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: none; }
.badge { display: inline-block; padding: .15rem .55rem; border-radius: 20px; font-size: .75rem; font-weight: 700; }
.badge-active   { background: var(--clr-ok-bg);   color: #1a5c35; border: 1px solid var(--clr-ok-bdr); }
.badge-inactive { background: var(--clr-bg);       color: var(--clr-muted); border: 1px solid var(--clr-border); }

/* ── Login admin ──────────────────────────────────────────── */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--clr-bg); padding: 2rem;
}
.login-box {
  background: var(--clr-white); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); padding: 2.5rem; width: 100%; max-width: 380px;
}
.login-box h1 { font-size: 1.4rem; margin-bottom: 1.5rem; text-align: center; }

/* ── Errors ───────────────────────────────────────────────── */
.error-page { text-align: center; padding: 6rem 1rem; }
.error-code { font-size: 5rem; font-weight: 900; color: var(--clr-border); line-height: 1; }
.error-page h1 { font-size: 1.5rem; margin-bottom: .75rem; }

/* ── Responsive general ───────────────────────────────────── */
@media (max-width: 900px) {
  .problem-list { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 540px) {
  .problem-list { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .section { padding: 1.5rem 0; }
  .hero    { padding: 2rem 0 1.75rem; }
  .hero-ctas { flex-direction: column; align-items: center; }
  .admin-layout { flex-direction: column; }
  .admin-sidebar { width: 100%; }
  .admin-content { padding: 1rem; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}
