/* =========================================================
   TARJETIA — Plataforma SaaS de tarjetas digitales
   styles.css — Design tokens + base + landing page
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@500;600&display=swap');

:root {
  /* --- Brand tokens (sampled from the NexCard logo, overridable from white-label panel) --- */
  --brand-blue: #016ffd;
  --brand-violet: #6a2ffb;
  --brand-cyan: #00c4fd;
  --brand-gradient: linear-gradient(135deg, var(--brand-cyan) 0%, var(--brand-blue) 50%, var(--brand-violet) 100%);

  /* --- Dark theme surface tokens (near-black, matching the logo canvas) --- */
  --bg-0: #030308;
  --bg-1: #08080f;
  --bg-2: #0e0e1a;
  --glass: rgba(255, 255, 255, 0.045);
  --glass-strong: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);

  --text-hi: #f5f7ff;
  --text-mid: #aab2cc;
  --text-low: #6b7291;

  --success: #34d399;
  --warning: #fbbf24;
  --danger: #f87171;

  --font-display: 'Space Grotesk', 'Inter', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 999px;

  --shadow-soft: 0 10px 40px -12px rgba(0, 0, 0, 0.55);
  --shadow-glow: 0 0 60px -15px rgba(59, 107, 255, 0.45);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

[data-theme='light'] {
  --bg-0: #f4f6fb;
  --bg-1: #ffffff;
  --bg-2: #ffffff;
  --glass: rgba(18, 26, 46, 0.035);
  --glass-strong: rgba(18, 26, 46, 0.06);
  --border: rgba(18, 26, 46, 0.09);
  --border-strong: rgba(18, 26, 46, 0.16);

  --text-hi: #10142a;
  --text-mid: #4b526b;
  --text-low: #868da6;

  --shadow-soft: 0 10px 40px -14px rgba(20, 25, 50, 0.18);
  --shadow-glow: 0 0 60px -20px rgba(59, 107, 255, 0.25);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

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

body {
  margin: 0;
  background: var(--bg-0);
  color: var(--text-hi);
  font-family: var(--font-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s var(--ease), color 0.3s var(--ease);
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
h1, h2, h3, h4 { font-family: var(--font-display); margin: 0; line-height: 1.15; letter-spacing: -0.01em; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

:focus-visible {
  outline: 2px solid var(--brand-cyan);
  outline-offset: 3px;
  border-radius: 4px;
}

.container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link {
  position: absolute; left: 12px; top: -48px; background: var(--brand-blue); color: #fff;
  padding: 10px 16px; border-radius: var(--radius-sm); z-index: 200; transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 12px; }

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: var(--radius-pill);
  padding: 12px 22px; font-weight: 600; font-size: 0.94rem;
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease), background 0.18s var(--ease), border-color 0.18s var(--ease);
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--brand-gradient); color: #fff; box-shadow: 0 8px 24px -8px rgba(59, 107, 255, 0.55); }
.btn-primary:hover { box-shadow: 0 12px 32px -8px rgba(59, 107, 255, 0.7); transform: translateY(-1px); }
.btn-ghost { background: var(--glass); color: var(--text-hi); border-color: var(--border); backdrop-filter: blur(12px); }
.btn-ghost:hover { border-color: var(--border-strong); background: var(--glass-strong); }
.btn-outline { background: transparent; border-color: var(--border-strong); color: var(--text-hi); }
.btn-outline:hover { border-color: var(--brand-cyan); color: var(--brand-cyan); }
.btn-sm { padding: 8px 16px; font-size: 0.82rem; }
.btn-block { width: 100%; }
.btn-danger { background: rgba(248, 113, 113, 0.12); color: var(--danger); border-color: rgba(248, 113, 113, 0.3); }
.btn-icon { padding: 10px; border-radius: var(--radius-sm); }

/* --- Glass card --- */
.glass {
  background: var(--glass);
  border: 1px solid var(--border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: var(--radius-lg);
}

/* --- Header --- */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(5, 7, 13, 0.72);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
[data-theme='light'] .site-header { background: rgba(244, 246, 251, 0.78); }
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; }
.brand-logo-img { height: 32px; width: auto; border-radius: 7px; display: block; }
.sidebar .brand-logo-img { height: 30px; }
.footer-col .brand-logo-img { height: 28px; }
.main-nav { display: flex; gap: 28px; }
.main-nav a { color: var(--text-mid); font-size: 0.92rem; font-weight: 500; transition: color 0.2s; }
.main-nav a:hover { color: var(--text-hi); }
.header-actions { display: flex; align-items: center; gap: 10px; }
.theme-toggle {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--glass); display: flex; align-items: center; justify-content: center; font-size: 1rem; color: var(--text-hi);
}
.nav-toggle { display: none; width: 38px; height: 38px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--glass); color: var(--text-hi); font-size: 1.1rem; }

@media (max-width: 860px) {
  .main-nav { position: fixed; top: 68px; left: 0; right: 0; flex-direction: column; background: var(--bg-1); border-bottom: 1px solid var(--border); padding: 18px 24px; gap: 16px; transform: translateY(-130%); opacity: 0; transition: transform 0.28s var(--ease), opacity 0.28s var(--ease); }
  .main-nav.open { transform: translateY(0); opacity: 1; }
  .nav-toggle { display: flex; align-items: center; justify-content: center; }
  .header-actions .btn-outline { display: none; }
}

/* --- Hero --- */
.hero { padding: 148px 0 90px; position: relative; overflow: hidden; }
.hero::before {
  content: ''; position: absolute; top: -180px; right: -160px; width: 620px; height: 620px; border-radius: 50%;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.28), transparent 70%); filter: blur(10px); pointer-events: none;
}
.hero::after {
  content: ''; position: absolute; bottom: -220px; left: -180px; width: 560px; height: 560px; border-radius: 50%;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.18), transparent 70%); pointer-events: none;
}
.hero .container { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 56px; align-items: center; position: relative; z-index: 1; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; font-size: 0.78rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--brand-cyan); background: rgba(34, 211, 238, 0.1); border: 1px solid rgba(34, 211, 238, 0.25);
  padding: 7px 14px; border-radius: var(--radius-pill); margin-bottom: 22px;
}
.hero h1 { font-size: clamp(2.1rem, 4.4vw, 3.4rem); margin-bottom: 20px; }
.hero h1 .grad { background: var(--brand-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { font-size: 1.08rem; color: var(--text-mid); max-width: 480px; margin-bottom: 32px; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 36px; }
.hero-stats { display: flex; gap: 32px; }
.hero-stats div strong { display: block; font-family: var(--font-mono); font-size: 1.5rem; }
.hero-stats div span { font-size: 0.8rem; color: var(--text-low); }

/* Phone mockup — signature element */
.phone-stage { position: relative; display: flex; justify-content: center; }
.phone-frame {
  width: 268px; height: 546px; border-radius: 42px; background: linear-gradient(160deg, #171e33, #0b0f1c);
  border: 1px solid var(--border-strong); padding: 12px; box-shadow: var(--shadow-glow), 0 30px 60px -20px rgba(0,0,0,0.6);
  position: relative; animation: float 6s ease-in-out infinite;
}
.phone-frame::before { content: ''; position: absolute; top: 22px; left: 50%; transform: translateX(-50%); width: 70px; height: 6px; background: rgba(255,255,255,0.15); border-radius: 4px; }
.phone-screen { width: 100%; height: 100%; border-radius: 30px; background: linear-gradient(165deg, #0d1326, #060911); overflow: hidden; padding: 26px 18px; position: relative; }
.mock-card-avatar { width: 64px; height: 64px; border-radius: 50%; background: var(--brand-gradient); margin: 8px auto 12px; display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 700; color: #fff; font-size: 1.4rem; }
.mock-card-name { text-align: center; font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; color: #fff; }
.mock-card-role { text-align: center; font-size: 0.78rem; color: var(--text-mid); margin-top: 3px; }
.mock-card-btns { display: flex; gap: 8px; justify-content: center; margin-top: 18px; }
.mock-pill { width: 34px; height: 34px; border-radius: 50%; background: var(--glass-strong); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 0.85rem; }
.mock-card-block { margin-top: 18px; height: 34px; border-radius: 10px; background: var(--glass-strong); border: 1px solid var(--border); }
.mock-card-block + .mock-card-block { margin-top: 10px; }
.floating-qr {
  position: absolute; bottom: -18px; right: -26px; width: 92px; height: 92px; border-radius: 18px;
  background: var(--bg-1); border: 1px solid var(--border-strong); box-shadow: var(--shadow-soft);
  display: flex; align-items: center; justify-content: center; font-size: 2.2rem; animation: pulseGlow 3.2s ease-in-out infinite;
}
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
@keyframes pulseGlow { 0%, 100% { box-shadow: 0 0 0 0 rgba(34, 211, 238, 0.35); } 50% { box-shadow: 0 0 0 14px rgba(34, 211, 238, 0); } }

/* --- Section shell --- */
.section { padding: 84px 0; }
.section-head { text-align: center; max-width: 620px; margin: 0 auto 48px; }
.section-head .eyebrow { display: inline-flex; }
.section-head h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); margin-bottom: 12px; }
.section-head p { color: var(--text-mid); }
.section-alt { background: var(--bg-1); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

/* --- Benefits grid --- */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.feature-card { padding: 26px; transition: transform 0.22s var(--ease), border-color 0.22s var(--ease); }
.feature-card:hover { transform: translateY(-4px); border-color: var(--border-strong); }
.feature-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--brand-gradient); display: flex; align-items: center; justify-content: center; font-size: 1.2rem; margin-bottom: 16px; }
.feature-card h3 { font-size: 1.05rem; margin-bottom: 8px; }
.feature-card p { color: var(--text-mid); font-size: 0.92rem; }

/* --- Steps --- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; counter-reset: step; }
.step { padding: 28px; position: relative; }
.step .step-num { font-family: var(--font-mono); font-size: 0.8rem; color: var(--brand-cyan); font-weight: 600; margin-bottom: 14px; display: block; }
.step h3 { margin-bottom: 8px; font-size: 1.05rem; }
.step p { color: var(--text-mid); font-size: 0.92rem; }

/* --- Templates gallery --- */
.template-scroller { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; }
.template-chip {
  aspect-ratio: 3/4; border-radius: var(--radius-md); padding: 14px; display: flex; flex-direction: column; justify-content: flex-end;
  position: relative; overflow: hidden; border: 1px solid var(--border); cursor: pointer; transition: transform 0.2s var(--ease);
}
.template-chip:hover { transform: translateY(-3px); }
.template-chip span { font-size: 0.78rem; font-weight: 600; position: relative; z-index: 1; color: #fff; }
.template-chip::after { content: ''; position: absolute; inset: 0; opacity: 0.9; }
.tpl-corporativa::after { background: linear-gradient(160deg, #1e3a8a, #0b0f1c); }
.tpl-minimalista::after { background: linear-gradient(160deg, #334155, #0b0f1c); }
.tpl-tecnologica::after { background: linear-gradient(160deg, #3b6bff, #0b0f1c); }
.tpl-elegante::after { background: linear-gradient(160deg, #78350f, #0b0f1c); }
.tpl-creativa::after { background: linear-gradient(160deg, #8b5cf6, #0b0f1c); }
.tpl-salud::after { background: linear-gradient(160deg, #059669, #0b0f1c); }

/* --- Pricing --- */
.billing-toggle { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 44px; }
.switch { width: 46px; height: 26px; border-radius: var(--radius-pill); background: var(--glass-strong); border: 1px solid var(--border); position: relative; }
.switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: var(--brand-gradient); transition: transform 0.2s var(--ease); }
.switch.on::after { transform: translateX(20px); }
.save-badge { font-size: 0.72rem; background: rgba(52, 211, 153, 0.12); color: var(--success); padding: 3px 10px; border-radius: var(--radius-pill); border: 1px solid rgba(52, 211, 153, 0.3); }

.pricing-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; align-items: stretch; }
.plan-card { padding: 26px 22px; display: flex; flex-direction: column; }
.plan-card.featured { border-color: var(--brand-cyan); box-shadow: var(--shadow-glow); position: relative; }
.plan-badge { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--brand-gradient); color: #fff; font-size: 0.7rem; font-weight: 700; padding: 4px 12px; border-radius: var(--radius-pill); }
.plan-name { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; margin-bottom: 6px; }
.plan-price { font-family: var(--font-mono); font-size: 1.7rem; margin-bottom: 4px; }
.plan-price span { font-size: 0.8rem; color: var(--text-low); font-family: var(--font-body); }
.plan-desc { font-size: 0.82rem; color: var(--text-mid); margin-bottom: 18px; }
.plan-features { display: flex; flex-direction: column; gap: 9px; margin: 0 0 22px; flex: 1; }
.plan-features li { font-size: 0.84rem; color: var(--text-mid); display: flex; gap: 8px; }
.plan-features li::before { content: '✓'; color: var(--brand-cyan); font-weight: 700; }

/* --- Testimonials --- */
.testi-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.testi-card { padding: 24px; }
.testi-stars { color: var(--warning); margin-bottom: 12px; font-size: 0.9rem; }
.testi-quote { font-size: 0.92rem; color: var(--text-mid); margin-bottom: 18px; }
.testi-who { display: flex; align-items: center; gap: 10px; }
.testi-avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--brand-gradient); flex-shrink: 0; }
.testi-name { font-weight: 600; font-size: 0.88rem; }
.testi-role { font-size: 0.76rem; color: var(--text-low); }

/* --- FAQ --- */
.faq-list { max-width: 720px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.faq-item { overflow: hidden; }
.faq-q { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; background: transparent; border: none; color: var(--text-hi); font-weight: 600; font-size: 0.95rem; text-align: left; }
.faq-q .chev { transition: transform 0.25s var(--ease); color: var(--brand-cyan); }
.faq-item[open] .chev { transform: rotate(180deg); }
.faq-a { padding: 0 22px 18px; color: var(--text-mid); font-size: 0.9rem; }

/* --- Contact --- */
.contact-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
.form-row { margin-bottom: 16px; }
.form-row label { display: block; font-size: 0.82rem; font-weight: 600; margin-bottom: 7px; color: var(--text-mid); }
.form-control {
  width: 100%; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--glass); color: var(--text-hi); font-family: inherit; font-size: 0.92rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-control:focus { border-color: var(--brand-cyan); box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.15); outline: none; }
.form-control.invalid { border-color: var(--danger); }
.form-error { color: var(--danger); font-size: 0.78rem; margin-top: 6px; display: none; }
.form-error.show { display: block; }
textarea.form-control { resize: vertical; min-height: 110px; }
.form-success { background: rgba(52, 211, 153, 0.1); border: 1px solid rgba(52, 211, 153, 0.3); color: var(--success); padding: 14px 16px; border-radius: var(--radius-sm); font-size: 0.88rem; display: none; margin-top: 14px; }
.form-success.show { display: block; }

/* --- Footer --- */
.site-footer { border-top: 1px solid var(--border); padding: 56px 0 28px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 32px; margin-bottom: 40px; }
.footer-col h4 { font-size: 0.85rem; margin-bottom: 14px; color: var(--text-hi); }
.footer-col ul { display: flex; flex-direction: column; gap: 10px; }
.footer-col a { font-size: 0.86rem; color: var(--text-mid); }
.footer-col a:hover { color: var(--brand-cyan); }
.footer-desc { color: var(--text-mid); font-size: 0.88rem; max-width: 280px; margin-top: 12px; }
.footer-social { display: flex; gap: 10px; margin-top: 16px; }
.footer-social a { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; padding-top: 24px; border-top: 1px solid var(--border); font-size: 0.8rem; color: var(--text-low); flex-wrap: wrap; gap: 10px; }

/* --- Toast --- */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--bg-2); border: 1px solid var(--border-strong); box-shadow: var(--shadow-soft); padding: 13px 20px; border-radius: var(--radius-pill); font-size: 0.86rem; opacity: 0; pointer-events: none; transition: all 0.28s var(--ease); z-index: 300; display: flex; align-items: center; gap: 8px; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success { border-color: rgba(52, 211, 153, 0.4); }
.toast.error { border-color: rgba(248, 113, 113, 0.4); }

/* --- Auth pages --- */
.auth-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 100px 20px 40px; position: relative; }
.auth-card { width: 100%; max-width: 420px; padding: 36px 32px; }
.auth-card h1 { font-size: 1.5rem; margin-bottom: 6px; }
.auth-card .sub { color: var(--text-mid); font-size: 0.88rem; margin-bottom: 26px; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: var(--text-low); font-size: 0.78rem; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.oauth-row { display: flex; gap: 10px; }
.auth-foot { text-align: center; margin-top: 22px; font-size: 0.86rem; color: var(--text-mid); }
.checkbox-row { display: flex; align-items: center; gap: 8px; font-size: 0.84rem; color: var(--text-mid); margin: 4px 0 20px; }
.strength-bar { height: 4px; border-radius: 2px; background: var(--glass-strong); margin-top: 8px; overflow: hidden; }
.strength-bar i { display: block; height: 100%; width: 0%; background: var(--danger); transition: width 0.25s, background 0.25s; }
.otp-row { display: flex; gap: 10px; justify-content: center; margin: 20px 0; }
.otp-row input { width: 44px; height: 52px; text-align: center; font-size: 1.2rem; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--glass); color: var(--text-hi); }

@media (max-width: 980px) {
  .hero .container { grid-template-columns: 1fr; }
  .phone-stage { order: -1; margin-bottom: 20px; }
  .grid-3, .grid-4, .steps, .testi-grid { grid-template-columns: repeat(2, 1fr); }
  .pricing-grid { grid-template-columns: repeat(3, 1fr); }
  .template-scroller { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
  .contact-wrap { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .grid-3, .grid-4, .steps, .testi-grid, .pricing-grid { grid-template-columns: 1fr; }
  .template-scroller { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr; }
  .hero-stats { flex-wrap: wrap; gap: 20px; }
  .oauth-row { flex-direction: column; }
}
