/* =========================================================
   Préstamo Cósmico — Sitio corporativo
   CONEXION INFO S.A. DE C.V., SOFOM, E.N.R.
   ========================================================= */

:root {
  --bg: #f6f7fb;
  --bg-alt: #ffffff;
  --surface: #ffffff;
  --text: #1a1f36;
  --text-muted: #5b6478;
  --primary: #4f7cff;
  --primary-dark: #3a63e0;
  --accent: #7a4dff;
  --border: #e6e9f2;
  --shadow-sm: 0 1px 2px rgba(20, 30, 60, 0.06);
  --shadow-md: 0 8px 24px rgba(20, 30, 60, 0.08);
  --shadow-lg: 0 20px 48px rgba(20, 30, 60, 0.12);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --gradient: linear-gradient(135deg, #4f7cff 0%, #7a4dff 100%);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

.muted { color: var(--text-muted); }
.small { font-size: 0.875rem; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand-logo { display: inline-flex; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 1.05rem; }
.brand-text small { color: var(--text-muted); font-size: 0.72rem; letter-spacing: 0.02em; }

.main-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}
.main-nav a {
  color: var(--text);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
  transition: color .15s ease, border-color .15s ease;
}
.main-nav a:hover { color: var(--primary); text-decoration: none; }
.main-nav a.active { color: var(--primary); border-bottom-color: var(--primary); }

.nav-toggle {
  display: none;
  background: transparent;
  border: 0;
  width: 40px;
  height: 40px;
  padding: 8px;
  cursor: pointer;
  flex-direction: column;
  justify-content: space-between;
}
.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform .2s ease, opacity .2s ease;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(1200px 500px at 90% -20%, rgba(122, 77, 255, 0.15), transparent 60%),
    radial-gradient(900px 500px at -10% 10%, rgba(79, 124, 255, 0.18), transparent 60%),
    linear-gradient(180deg, #fbfbff 0%, #f2f5ff 100%);
  padding: 72px 0 88px;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 56px;
  align-items: center;
}

.eyebrow {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(79, 124, 255, 0.1);
  color: var(--primary-dark);
  font-size: 0.82rem;
  font-weight: 600;
  margin: 0 0 20px;
  letter-spacing: 0.02em;
}

.hero h1 {
  font-size: clamp(1.9rem, 3.6vw, 2.9rem);
  line-height: 1.15;
  margin: 0 0 18px;
  letter-spacing: -0.01em;
}

.lead {
  font-size: 1.08rem;
  color: var(--text-muted);
  margin: 0 0 26px;
  max-width: 620px;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 28px;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--border);
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: var(--shadow-sm);
}

.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .15s ease, background .15s ease, color .15s ease;
  text-decoration: none;
}
.btn-primary {
  background: var(--gradient);
  color: #fff;
  box-shadow: 0 8px 20px rgba(79, 124, 255, 0.35);
}
.btn-primary:hover { transform: translateY(-1px); text-decoration: none; }
.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover { background: #fff; text-decoration: none; }

/* Hero illustration */
.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
}
.hero-illustration {
  width: 100%;
  max-width: 520px;
  height: auto;
  display: block;
  filter: drop-shadow(0 20px 40px rgba(122, 77, 255, 0.15));
  animation: floatIn 0.9s ease-out both;
}
@keyframes floatIn {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---------- Sections ---------- */
.section {
  padding: 72px 0;
}
.section-alt { background: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

.section-title {
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  margin: 0 0 16px;
  letter-spacing: -0.01em;
}
.section-text {
  color: var(--text-muted);
  max-width: 820px;
  margin: 0 0 20px;
  font-size: 1.02rem;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
  margin-top: 32px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 26px;
  box-shadow: var(--shadow-sm);
}
.card h3 { margin: 0 0 16px; font-size: 1.15rem; }

.data-list { list-style: none; padding: 0; margin: 0; }
.data-list li {
  display: flex;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 0.95rem;
}
.data-list li:last-child { border-bottom: 0; }
.data-list li span {
  flex: 0 0 40%;
  color: var(--text-muted);
}
.data-list li strong { flex: 1; font-weight: 600; }

.feature-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.feature-list li {
  padding: 8px 0 8px 26px;
  position: relative;
  font-size: 0.98rem;
}
.feature-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 8px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--gradient);
  color: #fff;
  font-size: 0.7rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

/* Tech card */
.tech-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-md);
  max-width: 900px;
  margin-top: 24px;
}
.tech-header {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 20px;
}
.tech-logo {
  width: 56px; height: 56px;
  border-radius: 14px;
  background: var(--gradient);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: 0.04em;
}
.tech-header h3 { margin: 0; }
.tech-header p { margin: 2px 0 0; font-size: 0.9rem; }
.tech-note {
  margin-top: 20px;
  padding: 16px 18px;
  background: rgba(79, 124, 255, 0.06);
  border-left: 3px solid var(--primary);
  border-radius: 10px;
  font-size: 0.95rem;
  color: var(--text);
}

/* Phone shell (holds app screenshots in preview section) */
.phone-shell {
  position: relative;
  width: 260px;
  aspect-ratio: 9 / 19.5;
  background: #0f1226;
  border-radius: 40px;
  padding: 11px;
  box-shadow: var(--shadow-lg), inset 0 0 0 3px #191d3a;
  margin: 0 auto;
}
.phone-shell::before {
  content: "";
  position: absolute;
  top: 15px; left: 50%;
  transform: translateX(-50%);
  width: 96px; height: 20px;
  background: #0f1226;
  border-radius: 0 0 12px 12px;
  z-index: 2;
}
.phone-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 30px;
  display: block;
  background: linear-gradient(180deg, #f4f5ff 0%, #e9ecff 100%);
}
.phone-img.missing {
  position: relative;
  background: repeating-linear-gradient(45deg, #e9ecff 0 10px, #f4f5ff 10px 20px);
}
.phone-img.missing::after {
  content: "Falta la imagen";
  position: absolute; inset: 0;
  display: grid; place-items: center;
  color: #7d84a8; font-size: 0.85rem; font-weight: 600;
}

/* Preview grid */
.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 48px;
  margin-top: 40px;
  justify-items: center;
}
.preview-item {
  text-align: center;
  max-width: 320px;
  margin: 0;
}
.preview-item figcaption {
  margin-top: 22px;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Contact */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-top: 32px;
}
.contact-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.contact-icon {
  width: 44px; height: 44px;
  margin: 0 auto 14px;
  border-radius: 12px;
  background: rgba(79, 124, 255, 0.1);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}
.contact-card h3 { margin: 0 0 8px; font-size: 1.02rem; }
.contact-card p { margin: 4px 0; }

.doc-links {
  margin-top: 40px;
  text-align: center;
  color: var(--text-muted);
}
.doc-links a { margin: 0 6px; }

/* ---------- Legal (privacy / user / loan) ---------- */
.legal {
  background: var(--bg);
  padding: 56px 0 80px;
}
.legal-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px;
}
.legal-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px clamp(20px, 5vw, 56px);
  box-shadow: var(--shadow-md);
}
.legal h1 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin: 0 0 8px;
}
.legal .updated {
  color: var(--text-muted);
  margin: 0 0 24px;
  font-size: 0.9rem;
}
.legal h2 {
  font-size: 1.25rem;
  margin: 32px 0 12px;
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.legal h2 .num {
  color: #fff;
  background: var(--gradient);
  width: 32px; height: 32px;
  border-radius: 50%;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}
.legal h3 { font-size: 1.05rem; margin: 20px 0 8px; }
.legal h4 { font-size: 0.98rem; margin: 16px 0 8px; }
.legal p { margin: 10px 0; color: var(--text); }
.legal ul { padding-left: 20px; margin: 10px 0; }
.legal li { margin: 6px 0; }
.legal .callout {
  background: rgba(79, 124, 255, 0.06);
  border-left: 4px solid var(--primary);
  padding: 16px 18px;
  border-radius: 10px;
  margin: 20px 0;
}
.legal .info-block {
  background: #f6f7fb;
  padding: 16px 18px;
  border-radius: 10px;
  border: 1px solid var(--border);
  margin: 16px 0;
  font-size: 0.95rem;
}
.legal .info-block p { margin: 4px 0; }

.legal-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 0.95rem;
}
.legal-table th, .legal-table td {
  padding: 10px 12px;
  border: 1px solid var(--border);
  text-align: left;
}
.legal-table th {
  background: #f6f7fb;
  font-weight: 600;
}

.signature-block {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 24px;
}
.signature-block .sign {
  padding: 18px;
  border: 1px dashed var(--border);
  border-radius: 10px;
}
.signature-block .line {
  border-top: 1px solid #333;
  margin: 30px 0 6px;
}

/* ---------- Footer ---------- */
.site-footer {
  background: #0f1226;
  color: #cfd3e5;
  padding: 40px 0 30px;
  margin-top: 0;
}
.site-footer strong { color: #fff; }
.footer-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: start;
}
.footer-links {
  display: flex;
  gap: 20px;
  align-items: center;
}
.footer-links a { color: #cfd3e5; }
.footer-links a:hover { color: #fff; }
.copyright {
  grid-column: 1 / -1;
  color: #8a92ad;
  font-size: 0.85rem;
  margin: 20px 0 0;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero { padding: 48px 0 56px; }
  .hero-inner { grid-template-columns: 1fr; gap: 40px; }
  .hero-visual { order: 2; }
  .hero-illustration { max-width: 420px; }
  .section { padding: 56px 0; }
}

@media (max-width: 720px) {
  .main-nav { display: none; }
  .main-nav.open {
    display: flex;
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 12px 24px 18px;
    flex-direction: column;
    gap: 8px;
  }
  .nav-toggle { display: inline-flex; }
  .header-inner { position: relative; }
  .brand-text small { display: none; }
  .footer-inner { grid-template-columns: 1fr; }
  .signature-block { grid-template-columns: 1fr; }
}
