/* =====================================================================
   DedicaQR — Sprint 13 CSS
   Blog público + Landing pages + Referidos (user) + Admin additions
   ===================================================================== */

:root {
  --dqr-brand: #C9184A;
  --dqr-pink:  #FFB3C1;
  --dqr-gold:  #D4A24C;
  --dqr-bg:    #FFF8F5;
  --dqr-ink:   #1a1a1a;
  --dqr-muted: #6b6b6b;
  --dqr-line:  #ececec;
}

/* =====================================================================
   BLOG PÚBLICO
   ===================================================================== */

.blog-main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 40px 24px 80px;
  font-family: 'Nunito', system-ui, sans-serif;
}

.blog-hero {
  text-align: center;
  margin-bottom: 32px;
}
.blog-hero h1 {
  font-family: 'Playfair Display', serif;
  font-size: 2.6rem;
  color: var(--dqr-brand);
  margin: 0 0 8px;
}
.blog-hero p { color: var(--dqr-muted); font-size: 1.1rem; margin: 0; }

.blog-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 28px;
  justify-content: center;
}
.blog-cat-pill {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--dqr-line);
  color: var(--dqr-ink);
  text-decoration: none;
  font-size: 14px;
  transition: all .15s;
  --c: var(--dqr-brand);
}
.blog-cat-pill:hover { border-color: var(--c); color: var(--c); }
.blog-cat-pill.active { background: var(--c); color: white; border-color: var(--c); }

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 28px;
}
.blog-grid-small {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.blog-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  transition: transform .2s, box-shadow .2s;
  border: 1px solid var(--dqr-line);
}
.blog-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,0.08); }
.blog-card-img { display: block; aspect-ratio: 16/9; overflow: hidden; }
.blog-card-img img { width: 100%; height: 100%; object-fit: cover; }
.blog-card-body { padding: 18px 20px 20px; }
.blog-card-body h2, .blog-card-body h3 {
  margin: 0 0 8px;
  font-family: 'Playfair Display', serif;
  font-size: 1.25rem;
  line-height: 1.3;
}
.blog-card-body h3 { font-size: 1.05rem; }
.blog-card-body h2 a, .blog-card-body h3 a { color: var(--dqr-ink); text-decoration: none; }
.blog-card-body h2 a:hover, .blog-card-body h3 a:hover { color: var(--dqr-brand); }
.blog-card-body p {
  color: var(--dqr-muted);
  font-size: 0.95rem;
  margin: 0 0 12px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.blog-meta {
  display: flex;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--dqr-muted);
  align-items: center;
}

.blog-pager {
  margin: 40px auto 0;
  display: flex;
  gap: 6px;
  justify-content: center;
}
.blog-pager a {
  display: inline-block;
  padding: 8px 14px;
  border: 1px solid var(--dqr-line);
  border-radius: 6px;
  color: var(--dqr-ink);
  text-decoration: none;
  font-size: 14px;
}
.blog-pager a.active { background: var(--dqr-brand); color: white; border-color: var(--dqr-brand); }

.blog-empty { text-align: center; color: var(--dqr-muted); padding: 60px 20px; }

/* Single post */
.blog-single { max-width: 760px; }
.blog-back {
  display: inline-block;
  color: var(--dqr-brand);
  text-decoration: none;
  margin-bottom: 24px;
  font-size: 14px;
}
.blog-back:hover { text-decoration: underline; }
.blog-article-head h1 {
  font-family: 'Playfair Display', serif;
  font-size: 2.4rem;
  line-height: 1.2;
  color: var(--dqr-ink);
  margin: 0 0 12px;
}
.blog-article-head .blog-meta { margin-bottom: 20px; }
.blog-article-img { width: 100%; border-radius: 12px; margin-bottom: 28px; }
.blog-article-body {
  font-size: 1.1rem;
  line-height: 1.75;
  color: #2a2a2a;
}
.blog-article-body h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.7rem;
  color: var(--dqr-brand);
  margin: 36px 0 14px;
}
.blog-article-body h3 { font-size: 1.3rem; margin: 28px 0 10px; color: var(--dqr-ink); }
.blog-article-body p { margin: 0 0 18px; }
.blog-article-body ul, .blog-article-body ol { margin: 0 0 18px; padding-left: 24px; }
.blog-article-body li { margin-bottom: 6px; }
.blog-article-body img { max-width: 100%; height: auto; border-radius: 8px; margin: 16px 0; }
.blog-article-body blockquote {
  border-left: 4px solid var(--dqr-brand);
  padding: 8px 20px;
  margin: 20px 0;
  color: var(--dqr-muted);
  font-style: italic;
  background: var(--dqr-bg);
}
.blog-article-body a { color: var(--dqr-brand); }

.blog-article-foot {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--dqr-line);
}
.blog-tag {
  display: inline-block;
  background: var(--dqr-bg);
  border: 1px solid var(--dqr-line);
  padding: 4px 12px;
  border-radius: 999px;
  margin: 4px 4px 0 0;
  font-size: 13px;
  color: var(--dqr-ink);
  text-decoration: none;
}
.blog-tag:hover { background: var(--dqr-pink); }

.blog-ai-badge {
  display: inline-block;
  background: linear-gradient(135deg, var(--dqr-brand), var(--dqr-gold));
  color: white;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  letter-spacing: 0.5px;
}

.blog-cta {
  background: linear-gradient(135deg, var(--dqr-brand), var(--dqr-pink));
  color: white;
  padding: 40px 32px;
  border-radius: 16px;
  text-align: center;
  margin: 40px 0;
}
.blog-cta h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  margin: 0 0 16px;
}
.blog-related h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  margin: 40px 0 20px;
  color: var(--dqr-ink);
}

/* =====================================================================
   LANDING PAGES (público)
   ===================================================================== */

.ld-page {
  --ld-theme: var(--dqr-brand);
  font-family: 'Nunito', system-ui, sans-serif;
  color: var(--dqr-ink);
}

.ld-hero {
  position: relative;
  padding: 100px 24px 80px;
  text-align: center;
  color: white;
  overflow: hidden;
  isolation: isolate;
}
.ld-hero-img {
  position: absolute; inset: 0; z-index: -2;
  background-size: cover; background-position: center;
  filter: brightness(0.45);
}
.ld-hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(135deg, var(--ld-theme), rgba(0,0,0,0.4));
  opacity: 0.85;
}
.ld-hero-inner { max-width: 800px; margin: 0 auto; }
.ld-hero h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1.15;
  margin: 0 0 16px;
}
.ld-hero p {
  font-size: clamp(1rem, 2vw, 1.25rem);
  opacity: 0.95;
  margin: 0 0 28px;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}
.ld-hero-video {
  max-width: 720px;
  margin: 0 auto 32px;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 16/9;
}
.ld-hero-video iframe { width: 100%; height: 100%; border: 0; }

.ld-btn {
  display: inline-block;
  padding: 14px 32px;
  background: white;
  color: var(--ld-theme);
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  transition: transform .15s, box-shadow .15s;
  box-shadow: 0 6px 16px rgba(0,0,0,0.15);
}
.ld-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0,0,0,0.2); }
.ld-btn-big { padding: 18px 44px; font-size: 1.1rem; }

.ld-block {
  padding: 60px 24px;
}
.ld-block:nth-child(even) { background: var(--dqr-bg); }
.ld-inner { max-width: 1080px; margin: 0 auto; }

.ld-h2 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  color: var(--ld-theme);
  text-align: center;
  margin: 0 0 32px;
}

.ld-align-center { text-align: center; }
.ld-align-right  { text-align: right; }
.ld-body { line-height: 1.7; max-width: 760px; margin: 0 auto; }
.ld-body p { margin: 0 0 16px; }
.ld-body ul, .ld-body ol { margin: 0 0 16px; padding-left: 24px; }

/* Features grid */
.ld-features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 28px;
}
.ld-feature {
  background: white;
  border: 1px solid var(--dqr-line);
  border-radius: 12px;
  padding: 28px 24px;
  text-align: center;
  transition: transform .15s;
}
.ld-feature:hover { transform: translateY(-3px); }
.ld-feature-icon {
  font-size: 2.4rem;
  margin-bottom: 12px;
  color: var(--ld-theme);
}
.ld-feature h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  margin: 0 0 8px;
  color: var(--dqr-ink);
}
.ld-feature p { color: var(--dqr-muted); margin: 0; }

/* Testimonials */
.ld-testimonials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}
.ld-testimonial {
  background: white;
  border-radius: 12px;
  padding: 24px;
  margin: 0;
  border: 1px solid var(--dqr-line);
}
.ld-testimonial img {
  width: 60px; height: 60px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 12px;
}
.ld-testimonial blockquote {
  margin: 0 0 14px;
  color: var(--dqr-ink);
  font-style: italic;
  line-height: 1.5;
}
.ld-testimonial figcaption { display: flex; justify-content: space-between; align-items: center; }
.ld-testimonial figcaption strong { color: var(--dqr-ink); }
.ld-stars { color: var(--dqr-gold); }

/* Pricing */
.ld-pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  max-width: 1000px;
  margin: 0 auto;
}
.ld-plan {
  background: white;
  border: 1px solid var(--dqr-line);
  border-radius: 16px;
  padding: 32px 24px;
  text-align: center;
}
.ld-plan-highlight {
  background: linear-gradient(180deg, var(--ld-theme), var(--dqr-pink));
  color: white;
  transform: scale(1.05);
  box-shadow: 0 12px 28px rgba(201, 24, 74, 0.25);
}
.ld-plan-highlight h3, .ld-plan-highlight .ld-price { color: white; }
.ld-plan-highlight .ld-btn { background: white; color: var(--ld-theme); }
.ld-plan h3 {
  font-family: 'Playfair Display', serif;
  margin: 0 0 12px;
  font-size: 1.3rem;
}
.ld-price {
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--ld-theme);
  margin: 0 0 4px;
}
.ld-price small { font-size: 1rem; opacity: 0.7; font-weight: 400; }
.ld-plan ul { list-style: none; padding: 0; margin: 20px 0; }
.ld-plan ul li { padding: 6px 0; border-bottom: 1px solid rgba(0,0,0,0.06); }
.ld-plan-highlight ul li { border-bottom: 1px solid rgba(255,255,255,0.2); }

/* FAQ */
.ld-faq-item {
  background: white;
  border: 1px solid var(--dqr-line);
  border-radius: 10px;
  margin-bottom: 10px;
  padding: 0;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}
.ld-faq-item summary {
  padding: 16px 20px;
  cursor: pointer;
  font-weight: 600;
  color: var(--dqr-ink);
}
.ld-faq-item summary::-webkit-details-marker { display: none; }
.ld-faq-item summary::after {
  content: '+';
  float: right;
  color: var(--ld-theme);
  font-size: 1.4rem;
  line-height: 1;
}
.ld-faq-item[open] summary::after { content: '−'; }
.ld-faq-a {
  padding: 0 20px 16px;
  color: var(--dqr-muted);
  line-height: 1.6;
}

/* CTA section */
.ld-cta {
  background: linear-gradient(135deg, var(--ld-theme), var(--dqr-pink));
  color: white;
}
.ld-cta .ld-inner { text-align: center; }
.ld-cta h2 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  color: white;
  margin: 0 0 12px;
}
.ld-cta p { font-size: 1.1rem; margin: 0 0 24px; opacity: 0.95; }

/* Image/video blocks */
.ld-image figure { max-width: 900px; margin: 0 auto; }
.ld-image img { width: 100%; border-radius: 12px; }
.ld-image figcaption {
  text-align: center;
  color: var(--dqr-muted);
  margin-top: 10px;
  font-size: 0.9rem;
}
.ld-video-wrap {
  max-width: 800px;
  margin: 0 auto;
  aspect-ratio: 16/9;
  border-radius: 12px;
  overflow: hidden;
}
.ld-video-wrap iframe { width: 100%; height: 100%; border: 0; }

/* =====================================================================
   REFERIDOS (panel usuario)
   ===================================================================== */

.ref-code-box {
  background: linear-gradient(135deg, var(--dqr-brand), var(--dqr-pink));
  color: white;
  border-radius: 16px;
  padding: 32px 28px;
  margin: 24px 0;
  text-align: center;
}
.ref-code-label { font-size: 14px; opacity: 0.9; }
.ref-code-value {
  font-size: 2.6rem;
  font-weight: 800;
  letter-spacing: 4px;
  margin: 8px 0 16px;
  font-family: 'Courier New', monospace;
}
.ref-share { display: flex; gap: 8px; max-width: 700px; margin: 0 auto; flex-wrap: wrap; align-items: center; }
.ref-share-label { width: 100%; opacity: 0.9; text-align: left; margin-bottom: 8px; font-size: 14px; }
.ref-share input {
  flex: 1;
  min-width: 220px;
  padding: 12px;
  border-radius: 8px;
  border: 0;
  font-family: monospace;
  background: rgba(255,255,255,0.95);
  color: var(--dqr-ink);
}
.ref-share .btn { background: white; color: var(--dqr-brand); }
.ref-program-info {
  margin-top: 18px;
  padding: 12px 16px;
  background: rgba(255,255,255,0.18);
  border-radius: 8px;
  font-size: 14px;
}

.ref-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 16px;
  margin: 20px 0 32px;
}
.ref-stat {
  background: white;
  border: 1px solid var(--dqr-line);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
}
.ref-stat-hi {
  background: linear-gradient(135deg, var(--dqr-gold), #f0c060);
  color: white;
  border-color: var(--dqr-gold);
}
.ref-stat-label { font-size: 13px; color: var(--dqr-muted); margin-bottom: 6px; }
.ref-stat-hi .ref-stat-label { color: rgba(255,255,255,0.9); }
.ref-stat-val { font-size: 1.8rem; font-weight: 700; color: var(--dqr-brand); }
.ref-stat-hi .ref-stat-val { color: white; }

.ref-payout-form {
  background: var(--dqr-bg);
  border-radius: 12px;
  padding: 24px;
  max-width: 540px;
  margin: 0 0 32px;
}
.ref-payout-form label { display: block; margin: 12px 0 6px; font-weight: 600; }
.ref-payout-form input, .ref-payout-form select, .ref-payout-form textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--dqr-line);
  border-radius: 8px;
  font-size: 1rem;
}

.ref-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 24px;
}
.ref-table th, .ref-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid var(--dqr-line);
  font-size: 14px;
}
.ref-table th { background: var(--dqr-bg); color: var(--dqr-muted); font-weight: 600; }
.ref-empty { color: var(--dqr-muted); padding: 24px 0; }

.ref-howto {
  background: var(--dqr-bg);
  padding: 24px;
  border-radius: 12px;
  margin-top: 32px;
}
.ref-howto h3 { margin: 0 0 12px; color: var(--dqr-brand); }
.ref-howto ol { margin: 0; padding-left: 20px; }
.ref-howto li { margin-bottom: 8px; }

/* =====================================================================
   ADMIN ADDITIONS (Sprint 13)
   ===================================================================== */

.adm-blog-list .adm-meta { color: var(--dqr-muted); font-size: 12px; font-family: monospace; margin-top: 4px; }

.badge-ai {
  background: linear-gradient(135deg, var(--dqr-brand), var(--dqr-gold));
  color: white;
}
.btn-ai {
  background: linear-gradient(135deg, var(--dqr-brand), var(--dqr-gold));
  color: white;
  border: 0;
}
.btn-ai:hover { opacity: 0.9; }
.btn-ai:disabled { opacity: 0.5; cursor: not-allowed; }

.badge-pending   { background: #fff3cd; color: #856404; }
.badge-approved  { background: #d4edda; color: #155724; }
.badge-paid      { background: #d1ecf1; color: #0c5460; }
.badge-cancelled { background: #e2e3e5; color: #383d41; }
.badge-reversed  { background: #f8d7da; color: #721c24; }
.badge-running   { background: #d1ecf1; color: #0c5460; }
.badge-completed { background: #d4edda; color: #155724; }
.badge-failed    { background: #f8d7da; color: #721c24; }
.badge-done      { background: #d4edda; color: #155724; }
.badge-draft     { background: #fefefe; color: var(--dqr-muted); border: 1px solid var(--dqr-line); }
.badge-published { background: #d4edda; color: #155724; }
.badge-archived  { background: #e2e3e5; color: #383d41; }
.badge-scheduled { background: #fff3cd; color: #856404; }
.badge-active    { background: #d4edda; color: #155724; }
.badge-paused    { background: #fff3cd; color: #856404; }
.badge-ended     { background: #e2e3e5; color: #383d41; }
.badge-disabled  { background: #f8d7da; color: #721c24; }
.badge-processing{ background: #d1ecf1; color: #0c5460; }
.badge-hidden    { background: #e2e3e5; color: #383d41; }

.adm-stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.adm-stat {
  background: white;
  border: 1px solid var(--dqr-line);
  border-radius: 10px;
  padding: 18px;
}
.adm-stat-label { font-size: 12px; color: var(--dqr-muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px; }
.adm-stat-value { font-size: 1.6rem; font-weight: 700; color: var(--dqr-ink); }
.adm-stat-bar { grid-column: span 2; }
.adm-bar { background: var(--dqr-line); border-radius: 6px; overflow: hidden; height: 12px; margin: 8px 0 4px; }
.adm-bar-fill { background: linear-gradient(90deg, var(--dqr-brand), var(--dqr-gold)); height: 100%; }

.adm-grid-2 {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 28px;
}
@media (max-width: 880px) { .adm-grid-2 { grid-template-columns: 1fr; } }

.adm-helper {
  background: var(--dqr-bg);
  border: 1px solid var(--dqr-line);
  border-radius: 8px;
  padding: 12px 14px;
  margin: 10px 0;
  font-size: 13px;
}
.adm-helper pre { margin: 0; font-size: 12px; overflow-x: auto; }
.adm-helper summary { cursor: pointer; font-weight: 600; }

.adm-ai-meta { margin-top: 12px; padding: 8px; background: var(--dqr-bg); border-radius: 6px; }
.adm-ai-info { background: var(--dqr-bg); padding: 16px; border-radius: 8px; margin-top: 16px; font-size: 14px; }
.adm-ai-info h3 { margin: 0 0 8px; font-size: 1rem; }
.adm-ai-info p { margin: 0 0 8px; color: var(--dqr-muted); }

.adm-check { display: flex; align-items: center; gap: 8px; margin: 10px 0; cursor: pointer; }
.adm-check input { width: auto; }

.adm-form-inline {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: end;
}
.adm-form-inline label { width: 100%; font-size: 12px; font-weight: 600; }
.adm-form-inline input, .adm-form-inline select { padding: 8px 10px; border: 1px solid var(--dqr-line); border-radius: 6px; }

.adm-stat-mini { font-size: 13px; line-height: 1.8; padding: 12px; background: var(--dqr-bg); border-radius: 8px; }
