/* ============================================
   Contadores Aliados — Sitio + Panel de Cliente
   Plan Normal · Paleta clara con acento terracota/coral
   ============================================ */
:root {
  --bg-deep: #FDF8F5;
  --bg-panel: #F8F0EA;
  --bg-panel-2: #F0E8E0;
  --bg-card: #FFFFFF;
  --text-primary: #1A1410;
  --text-secondary: #5A4F44;
  --text-muted: #8A7D72;
  --accent: #C85C4A;
  --accent-light: #E8C4B8;
  --accent-dark: #A84A3A;
  --accent-gradient: linear-gradient(135deg, #C85C4A, #E8A080);
  --border: rgba(26, 20, 16, 0.06);
  --border-light: rgba(26, 20, 16, 0.03);
  --shadow-sm: 0 1px 3px rgba(26, 20, 16, 0.04);
  --shadow-md: 0 4px 20px rgba(26, 20, 16, 0.06);
  --shadow-lg: 0 12px 40px rgba(26, 20, 16, 0.08);
  --green: #4A9A7A;
  --amber: #D4A04A;
  --font-display: 'Poppins', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg-deep);
  color: var(--text-primary);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 1140px; margin: 0 auto; padding: 0 1.5rem; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; }

/* ============================================
   ICONOS SVG
   ============================================ */
.icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: currentColor;
}
.icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon--filled svg {
  fill: currentColor;
  stroke: none;
}
.icon--lg { width: 24px; height: 24px; }
.icon--xl { width: 32px; height: 32px; }
.icon--accent { color: var(--accent); }
.icon--white { color: #fff; }

/* ============================================
   HEADER
   ============================================ */
header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(253, 248, 245, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow 0.3s ease;
}
header.scrolled {
  box-shadow: var(--shadow-sm);
}
header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}
.logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-primary);
}
.logo-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-gradient);
  box-shadow: 0 0 20px rgba(200, 92, 74, 0.15);
}

nav.main-nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}
nav.main-nav a {
  position: relative;
  font-size: 0.86rem;
  color: var(--text-secondary);
  padding-bottom: 4px;
  font-weight: 500;
  transition: color 0.25s ease;
}
nav.main-nav a::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform 0.25s ease;
  border-radius: 2px;
}
nav.main-nav a:hover {
  color: var(--text-primary);
}
nav.main-nav a:hover::after,
nav.main-nav a.active::after {
  transform: scaleX(1);
}
nav.main-nav a.active {
  color: var(--text-primary);
}

.nav-cta {
  background: var(--accent-gradient);
  color: #fff !important;
  padding: 0.55rem 1.3rem;
  border-radius: 999px;
  font-weight: 600;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.nav-cta::after {
  display: none !important;
}
.nav-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(200, 92, 74, 0.2);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  padding: 0.4rem;
}
.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: 0.3s ease;
}

/* ============================================
   HERO
   ============================================ */
.hero {
  position: relative;
  padding: 5rem 0 4rem;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.hero-glow {
  position: absolute;
  width: 480px;
  height: 480px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(200, 92, 74, 0.06), transparent 70%);
  top: -180px;
  right: -140px;
  filter: blur(50px);
  pointer-events: none;
}
.hero .wrap {
  position: relative;
  z-index: 2;
}
.eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.2rem 0.8rem;
  border: 1px solid rgba(200, 92, 74, 0.12);
  border-radius: 999px;
  background: rgba(200, 92, 74, 0.04);
  margin-bottom: 1.1rem;
}
.hero h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.1rem, 4.5vw, 3.2rem);
  letter-spacing: -0.02em;
  max-width: 680px;
  margin-bottom: 1.1rem;
  color: var(--text-primary);
}
.hero h1 .highlight {
  color: var(--accent-dark);
}
.hero p {
  font-size: 1rem;
  color: var(--text-secondary);
  max-width: 540px;
  line-height: 1.8;
}

/* ============================================
   BOTONES
   ============================================ */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--accent-gradient);
  color: #fff;
  border: none;
  padding: 0.9rem 2.1rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 12px 30px -10px rgba(200, 92, 74, 0.25);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.btn-primary .icon {
  width: 18px;
  height: 18px;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px -12px rgba(200, 92, 74, 0.35);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border);
  padding: 0.9rem 2.1rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: border-color 0.25s ease, background 0.25s ease;
}
.btn-ghost .icon {
  width: 18px;
  height: 18px;
}
.btn-ghost:hover {
  border-color: var(--accent);
  background: rgba(200, 92, 74, 0.04);
}

/* ============================================
   SECCIONES
   ============================================ */
section {
  padding: 5rem 0;
}
section:not(:first-of-type) {
  border-top: 1px solid var(--border);
}

.section-head {
  max-width: 560px;
  margin-bottom: 2.5rem;
}
.section-head .eyebrow {
  margin-bottom: 0.5rem;
}
.section-head h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  color: var(--text-primary);
  margin-bottom: 0.6rem;
}
.section-head p {
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.7;
}

/* ============================================
   TARJETAS
   ============================================ */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.card {
  padding: 2.25rem 1.75rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
  box-shadow: var(--shadow-sm);
}
.card:hover {
  transform: translateY(-5px);
  border-color: rgba(200, 92, 74, 0.12);
  box-shadow: var(--shadow-md);
}
.card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--accent-gradient);
  margin-bottom: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 8px 24px rgba(200, 92, 74, 0.1);
}
.card-icon .icon {
  width: 24px;
  height: 24px;
}
.card h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}
.card p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ============================================
   STATS
   ============================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  text-align: center;
}
.stat-item .stat-number {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2.5rem;
  color: var(--accent);
  line-height: 1.1;
}
.stat-item .stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
}

/* ============================================
   TESTIMONIO
   ============================================ */
.testimonial-block {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
}
.testimonial-block .icon {
  width: 32px;
  height: 32px;
  color: var(--accent);
  opacity: 0.3;
  margin-bottom: 0.8rem;
}
.testimonial-block blockquote {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.2rem;
  line-height: 1.6;
  color: var(--text-primary);
}
.testimonial-block .testi-author {
  margin-top: 1rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
}
.testimonial-block .testi-author strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* ============================================
   LOGIN
   ============================================ */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  position: relative;
  overflow: hidden;
}
.login-wrap::before {
  content: '';
  position: absolute;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(200, 92, 74, 0.08), transparent 70%);
  top: -160px;
  left: -160px;
  filter: blur(60px);
  pointer-events: none;
}
.login-card {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 400px;
  padding: 2.5rem;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  box-shadow: var(--shadow-lg);
}
.login-card .logo {
  justify-content: center;
  margin-bottom: 0.5rem;
}
.login-card h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.4rem;
  text-align: center;
  margin: 1.25rem 0 0.4rem;
  color: var(--text-primary);
}
.login-card p {
  text-align: center;
  font-size: 0.87rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  line-height: 1.6;
}
.login-form {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}
.login-form .form-row input {
  background: var(--bg-deep);
}
.login-note {
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 1.5rem;
  line-height: 1.6;
}
.login-note strong {
  color: var(--accent);
}
.login-note a:hover {
  color: var(--accent);
}

/* ============================================
   PANEL PRIVADO
   ============================================ */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  padding: 1.75rem 1.25rem;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
}
.sidebar .logo {
  margin-bottom: 2.5rem;
}
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1;
}
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  transition: background 0.25s ease, color 0.25s ease;
}
.sidebar-nav a .icon {
  width: 18px;
  height: 18px;
  opacity: 0.5;
}
.sidebar-nav a:hover {
  background: rgba(200, 92, 74, 0.04);
  color: var(--text-primary);
}
.sidebar-nav a:hover .icon {
  opacity: 1;
}
.sidebar-nav a.active {
  background: rgba(200, 92, 74, 0.08);
  color: var(--text-primary);
}
.sidebar-nav a.active .icon {
  opacity: 1;
  color: var(--accent);
}
.sidebar-nav a .icon {
  transition: opacity 0.25s ease, color 0.25s ease;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-top: 1.5rem;
  margin-top: 1rem;
  border-top: 1px solid var(--border);
}
.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent-gradient);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
  color: #fff;
}
.sidebar-user div {
  font-size: 0.8rem;
}
.sidebar-user strong {
  display: block;
  font-size: 0.85rem;
  color: var(--text-primary);
}
.sidebar-user span {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.panel-main {
  flex: 1;
  padding: 2.5rem 3rem;
  min-width: 0;
}
.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}
.panel-header h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.6rem;
  margin-bottom: 0.4rem;
  color: var(--text-primary);
}
.panel-header p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.panel-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}
.panel-stat {
  padding: 1.5rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}
.panel-stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.panel-stat-value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.6rem;
  color: var(--text-primary);
}
.panel-stat-value.ok {
  color: var(--green);
}
.panel-stat-value.warn {
  color: var(--amber);
}

.panel-card {
  padding: 1.75rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
}
.panel-card h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 1.1rem;
  color: var(--text-primary);
}

.table {
  width: 100%;
  border-collapse: collapse;
}
.table th {
  text-align: left;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}
.table td {
  padding: 0.85rem 0.75rem;
  font-size: 0.87rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}
.table tr:last-child td {
  border-bottom: none;
}
.table td:first-child {
  color: var(--text-primary);
  font-weight: 500;
}
.status-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
}
.status-badge.pagada {
  background: rgba(74, 154, 122, 0.1);
  color: var(--green);
}
.status-badge.pendiente {
  background: rgba(212, 160, 74, 0.1);
  color: var(--amber);
}
.download-link {
  font-size: 0.82rem;
  color: var(--accent);
  font-weight: 600;
  transition: color 0.25s ease;
}
.download-link:hover {
  color: var(--accent-dark);
  text-decoration: underline;
}

.doc-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.doc-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: border-color 0.25s ease, background 0.25s ease;
}
.doc-item:hover {
  border-color: rgba(200, 92, 74, 0.15);
  background: rgba(200, 92, 74, 0.02);
}
.doc-info {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}
.doc-icon {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: rgba(200, 92, 74, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--accent);
}
.doc-info h4 {
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 0.15rem;
  color: var(--text-primary);
}
.doc-info span {
  font-size: 0.76rem;
  color: var(--text-muted);
}

/* ============================================
   FOOTER
   ============================================ */
footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 0;
  background: var(--bg-panel);
}
footer .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
}
.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.footer-brand strong {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.footer-brand small {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.footer-links {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}
.footer-links a {
  font-size: 0.82rem;
  color: var(--text-secondary);
  transition: color 0.2s ease;
}
.footer-links a:hover {
  color: var(--accent);
}
.footer-social {
  display: flex;
  gap: 1rem;
}
.footer-social a {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all 0.3s ease;
  background: #fff;
}
.footer-social a .icon {
  width: 16px;
  height: 16px;
}
.footer-social a:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}
.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
  margin-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  width: 100%;
}
.footer-bottom .accent {
  color: var(--accent);
}

/* ============================================
   SCROLL-REVEAL
   ============================================ */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {
  .card-grid {
    grid-template-columns: 1fr 1fr;
  }
  .panel-stats {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .contact-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  nav.main-nav {
    position: fixed;
    top: 76px;
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: flex-start;
    padding: 1.5rem;
    gap: 1.25rem;
    transform: translateY(-130%);
    transition: transform 0.3s ease;
    z-index: 49;
    box-shadow: var(--shadow-lg);
  }
  nav.main-nav.open {
    transform: translateY(0);
  }
  .nav-toggle {
    display: flex;
  }
  .card-grid {
    grid-template-columns: 1fr;
  }
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }
  .stat-item .stat-number {
    font-size: 2rem;
  }
  footer .wrap {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .footer-links {
    justify-content: center;
  }

  .app-shell {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
    flex-direction: row;
    align-items: center;
    padding: 1rem 1.25rem;
    overflow-x: auto;
  }
  .sidebar .logo {
    margin-bottom: 0;
    margin-right: 1.5rem;
  }
  .sidebar-nav {
    flex-direction: row;
    flex: none;
    gap: 0.3rem;
  }
  .sidebar-nav a {
    padding: 0.5rem 0.7rem;
    font-size: 0.78rem;
  }
  .sidebar-nav a .icon {
    width: 16px;
    height: 16px;
  }
  .sidebar-user {
    display: none;
  }
  .panel-main {
    padding: 1.75rem 1.25rem;
  }
  .table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}