/* ============================================================
   freeaitokens.net — Sistema de diseño centralizado
   Paleta "Find AI Credits". Edita las variables en :root para
   personalizar toda la web en 1 solo clic.
   ============================================================ */

:root {
  /* Colors */
  --bg-page: #FFFFFF;
  --bg-surface: #F8FAFC;
  --bg-card: #FFFFFF;
  --border-color: #E2E8F0;

  --primary-emerald: #059669;
  --primary-emerald-hover: #047857;
  --primary-emerald-light: #ECFDF5;

  --text-main: #0F172A;
  --text-muted: #64748B;
  --text-white: #FFFFFF;

  --dark-accent: #0F172A;

  /* Typography & Layout */
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-pill: 9999px;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Reset y Estilos Base */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background-color: var(--bg-page);
  color: var(--text-main);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.6;
}
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ---------- Barra de anuncio ---------- */
.announcement {
  background: var(--dark-accent);
  color: var(--text-white);
  text-align: center;
  font-size: 0.85rem;
  padding: 8px 16px;
}
.announcement a { color: #34d399; font-weight: 600; }
.announcement a:hover { text-decoration: underline; }

/* ---------- Header / Navegación ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-color);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.1rem;
}
.logo-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--primary-emerald);
  color: var(--text-white);
  font-weight: 800;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
}
.nav-links a { color: var(--text-muted); font-size: 0.95rem; font-weight: 500; }
.nav-links a:hover { color: var(--text-main); }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  border: none;
  transition: background-color 0.15s ease, transform 0.1s ease;
}
.btn-primary { background: var(--primary-emerald); color: var(--text-white); }
.btn-primary:hover { background: var(--primary-emerald-hover); }
.btn-primary:visited { color: var(--text-white); }
.btn-outline { background: transparent; color: var(--text-main); border: 1px solid var(--border-color); }
.btn-outline:hover { border-color: var(--primary-emerald); color: var(--primary-emerald); }
.btn-telegram {
  background: #229ED9;
  color: var(--text-white);
  box-shadow: var(--shadow-sm);
}
.btn-telegram:hover { background: #1d8fc4; color: var(--text-white); }
.btn-telegram:visited { color: var(--text-white); }

/* ---------- Hero ---------- */
.hero {
  background:
    radial-gradient(60% 60% at 70% 10%, var(--primary-emerald-light) 0%, transparent 60%),
    var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  padding: 64px 0;
}
.hero-inner { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 18px; }
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary-emerald-light);
  color: var(--primary-emerald);
  border: 1px solid #a7f3d0;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-weight: 600;
}
.hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); line-height: 1.15; letter-spacing: -0.02em; }
.hero h1 span { color: var(--primary-emerald); }
.hero-sub { color: var(--text-muted); font-size: 1.1rem; max-width: 640px; }
.hero-stats { display: flex; gap: 40px; margin-top: 12px; }
.stat { text-align: center; }
.stat-value { font-size: 1.6rem; font-weight: 800; color: var(--text-main); }
.stat-label { font-size: 0.85rem; color: var(--text-muted); }

/* ---------- Filtros ---------- */
.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 24px 0 8px;
}
.filter-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-tab {
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.15s ease;
}
.filter-tab:hover { border-color: var(--primary-emerald); color: var(--primary-emerald); }
.filter-tab.active { background: var(--primary-emerald); border-color: var(--primary-emerald); color: var(--text-white); }
.search-input {
  margin-left: auto;
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  min-width: 220px;
  color: var(--text-main);
  background: var(--bg-card);
}
.search-input:focus { outline: 2px solid var(--primary-emerald); outline-offset: 1px; }

/* ---------- Grid de ofertas ---------- */
.deals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  padding: 20px 0 48px;
}
.deal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.deal-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.deal-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.geo-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--primary-emerald-light);
  color: var(--primary-emerald);
}
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}
.provider-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.provider-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--dark-accent);
  color: var(--text-white);
}
.benefit-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.8rem;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, #10b981, #059669);
  color: var(--text-white);
  box-shadow: var(--shadow-sm);
}
.deal-dates {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 2px;
}
.deal-date {
  font-size: 0.78rem;
  color: var(--text-muted);
}
.deal-date strong { color: var(--primary-emerald); }
.deal-title { font-size: 1.15rem; font-weight: 700; line-height: 1.35; letter-spacing: -0.01em; }
.deal-desc {
  color: var(--text-muted);
  font-size: 0.92rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.promo-code {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  background: var(--bg-surface);
  border: 1px dashed var(--border-color);
  color: var(--primary-emerald);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
}
.deal-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; flex-wrap: wrap; }
.deal-category { font-size: 0.78rem; color: var(--text-muted); flex: 1 1 auto; min-width: 0; }
.deal-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 160px;
  height: 44px;
  padding: 0 18px;
  box-sizing: border-box;
  line-height: 1;
  text-align: center;
  background: var(--dark-accent);
  color: var(--text-white);
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.88rem;
  transition: background 0.15s ease;
}
.deal-link:hover { background: var(--primary-emerald); }
.deal-link-primary {
  background: var(--primary-emerald);
  font-weight: 700;
  font-size: 0.9rem;
  box-shadow: var(--shadow-sm);
}
.deal-link-primary:hover { background: var(--primary-emerald-hover); }
.deal-link-primary:visited { color: var(--text-white); }

/* ---------- Ofertas caducadas ---------- */
.deal-card-expired {
  position: relative;
  opacity: 0.6;
  filter: grayscale(0.9);
  border-color: var(--border-color);
  box-shadow: none;
}
.deal-card-expired:hover {
  transform: none;
  box-shadow: var(--shadow-sm);
}
.expired-overlay {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  background: #dc2626;
  color: #ffffff;
  font-weight: 800;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-md);
}
.status-badge-expired {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fecaca;
}
.deal-link-disabled {
  background: var(--border-color);
  color: var(--text-muted);
  cursor: not-allowed;
  pointer-events: none;
  font-weight: 700;
}

/* ---------- Empty state ---------- */
.empty-state { text-align: center; padding: 48px 20px; color: var(--text-muted); }

/* ---------- Sección info ---------- */
.info-section { background: var(--bg-surface); border-top: 1px solid var(--border-color); padding: 48px 0; }
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; }
.info-card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: 24px; }
.info-card h3 { font-size: 1rem; margin-bottom: 8px; }
.info-card p { color: var(--text-muted); font-size: 0.9rem; }

/* ---------- Footer ---------- */
.site-footer { background: var(--dark-accent); color: var(--text-muted); padding: 40px 0; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.footer-brand { color: var(--text-white); font-weight: 700; }
.footer-links { display: flex; gap: 20px; }
.footer-links a:hover { color: var(--text-white); }
.footer-contact {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  font-size: 0.9rem;
}
.footer-contact-label { color: var(--text-muted); }
.footer-contact-email {
  color: var(--primary-emerald);
  font-weight: 600;
  text-decoration: underline;
}
.footer-contact-email:hover { color: var(--text-white); }
.legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.82rem;
}
.legal-links a:hover { color: var(--text-white); text-decoration: underline; }
/* Footer grid used on index (Product/Company/Resources) */
.footer { background: var(--dark-accent); color: var(--text-muted); padding: 48px 0 32px; }
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 2rem;
  align-items: start;
}
.footer-col h4 { color: var(--text-white); font-size: 0.95rem; font-weight: 700; margin-bottom: 12px; letter-spacing: 0.01em; }
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: 8px; }
.footer-col a { color: var(--text-muted); font-size: 0.9rem; transition: color 0.15s ease; }
.footer-col a:hover { color: var(--text-white); text-decoration: underline; }
.footer-bottom {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.12);
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
}
/* Header actions for two CTAs */
.header-actions { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.header-actions .btn { white-space: nowrap; }
.btn svg { flex-shrink: 0; }
/* Newsletter / Subscribe CTA */
.subscribe-cta { padding: 28px 0 8px; }
.subscribe-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 960px;
  margin: 0 auto;
}
.subscribe-card h3 { font-size: 1.05rem; font-weight: 700; margin: 0; }
.subscribe-card p { color: var(--text-muted); font-size: 0.92rem; margin: 4px 0 0; }
.subscribe-card .btn { padding: 10px 18px; font-size: 0.9rem; }
.newsletter-form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.newsletter-form input[type="email"] { padding: 10px 12px; border: 1px solid var(--border-color); border-radius: var(--radius-md); min-width: 240px; font-size: 0.92rem; font-family: var(--font-sans); background: var(--bg-card); }
.newsletter-form input[type="email"]:focus { outline: 2px solid var(--primary-emerald); outline-offset: 1px; border-color: var(--primary-emerald); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid var(--primary-emerald); outline-offset: 2px; }
.subscribe-form-card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: 28px; max-width: 640px; margin: 0 auto; box-shadow: var(--shadow-sm); }
.subscribe-form-card h2 { font-size: 1.3rem; margin-bottom: 16px; }
.form-group { margin-bottom: 14px; display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 0.88rem; font-weight: 600; }
.form-group input[type="text"], .form-group input[type="email"], .form-group input[type="tel"] {
  padding: 10px 12px; border: 1px solid var(--border-color); border-radius: var(--radius-md); font-size: 0.92rem; font-family: var(--font-sans);
}
.form-group input:focus { outline: 2px solid var(--primary-emerald); outline-offset: 1px; border-color: var(--primary-emerald); }
.consent-row { display: flex; gap: 10px; align-items: flex-start; font-size: 0.85rem; color: var(--text-muted); }
.consent-row input[type="checkbox"] { margin-top: 3px; accent-color: var(--primary-emerald); }
.required { color: #dc2626; }
.subscribe-legal-notice { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 28px; }
.subscribe-submit-btn { display: block; width: auto; min-width: 200px; margin: 20px auto 0; padding: 14px 32px; font-size: 1rem; text-align: center; }
.subscribe-submit-btn:focus-visible { outline: 2px solid var(--primary-emerald); outline-offset: 2px; }
.subscribe-form-card .cf-turnstile { display: flex; justify-content: center; margin: 20px auto 0; min-height: 65px; }
.subscribe-status { margin-bottom: 12px; text-align: center; }

/* ---------- Páginas legales ---------- */
.legal-page {
  max-width: 760px;
  margin: 0 auto;
  padding: 48px 20px 64px;
}
.legal-page h1 { font-size: 2rem; margin-bottom: 8px; letter-spacing: -0.02em; }
.legal-page .updated { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 24px; }
.legal-page h2 { font-size: 1.2rem; margin: 28px 0 10px; }
.legal-page p, .legal-page li { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 10px; }
.legal-page ul { padding-left: 20px; margin-bottom: 12px; }
.legal-page strong { color: var(--text-main); }
.legal-page a { color: var(--primary-emerald); text-decoration: underline; }
/* Button links inside article/legal content must retain button contrast. */
.legal-page a.btn-primary,
.legal-page a.btn-telegram {
  color: var(--text-white);
  text-decoration: none;
}
.legal-page a.btn-outline { text-decoration: none; }
.legal-note {
  background: var(--primary-emerald-light);
  border: 1px solid #a7f3d0;
  color: var(--primary-emerald);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin: 24px 0;
  font-size: 0.92rem;
}
.legal-note a { color: var(--primary-emerald-hover); }

@media (max-width: 640px) {
  .nav-links { display: none; }
  .hero-stats { gap: 24px; }
  .search-input { margin-left: 0; width: 100%; }
  .filters { flex-direction: column; align-items: stretch; }
  .header-inner { flex-wrap: wrap; }
  .header-actions { width: 100%; justify-content: flex-end; }
  .subscribe-card { flex-direction: column; align-items: stretch; text-align: left; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .subscribe-submit-btn { width: 100%; min-width: 0; }
}
@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
  .header-actions .btn { flex: 1 1 auto; justify-content: center; font-size: 0.85rem; padding: 9px 12px; }
}
