:root {
  --bg: #f5f5f3;
  --surface: #ffffff;
  --surface-2: #ededeb;
  --ink: #0a0a0a;
  --muted: #686866;
  --line: #deded9;
  --dark: #090909;
  --dark-2: #151515;
  --success: #166534;
  --danger: #b42318;
  --radius: 24px;
  --shadow: 0 24px 70px rgba(0,0,0,.09);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--bg); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { cursor: pointer; }
.container { width: min(1160px, calc(100% - 36px)); margin: 0 auto; }
.site-header { position: sticky; top: 0; z-index: 40; border-bottom: 1px solid rgba(0,0,0,.07); background: rgba(245,245,243,.86); backdrop-filter: blur(18px); }
.nav { min-height: 76px; display: flex; align-items: center; gap: 24px; }
.logo { display: flex; align-items: center; gap: 11px; font-weight: 900; letter-spacing: -.03em; }
.logo img { width: 42px; height: 42px; border-radius: 13px; object-fit: cover; }
.logo small { display: block; color: var(--muted); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; }
.nav-links { display: flex; align-items: center; gap: 26px; margin-left: auto; color: #444; font-size: 14px; font-weight: 700; }
.nav-actions { display: flex; gap: 10px; }
.btn { min-height: 46px; padding: 0 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); font-weight: 800; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: .18s ease; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(0,0,0,.08); }
.btn-dark { color: #fff; border-color: var(--dark); background: var(--dark); }
.btn-light { color: #fff; border-color: rgba(255,255,255,.18); background: rgba(255,255,255,.08); }
.btn-block { width: 100%; }
.hero { padding: 64px 0 42px; }
.hero-shell { min-height: 650px; padding: clamp(34px,6vw,72px); border-radius: 36px; position: relative; overflow: hidden; color: white; background: radial-gradient(circle at 82% 18%, rgba(255,255,255,.16), transparent 22%), radial-gradient(circle at 64% 76%, rgba(255,255,255,.08), transparent 26%), linear-gradient(145deg,#191919 0%,#050505 72%); box-shadow: 0 28px 80px rgba(0,0,0,.18); }
.hero-shell::before { content: ""; position: absolute; width: 420px; height: 420px; right: -80px; bottom: -180px; border: 1px solid rgba(255,255,255,.12); border-radius: 50%; box-shadow: 0 0 0 55px rgba(255,255,255,.025), 0 0 0 115px rgba(255,255,255,.018); }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; color: #d6d6d2; font-size: 12px; font-weight: 900; letter-spacing: .13em; text-transform: uppercase; }
.eyebrow::before { content: ""; width: 28px; height: 1px; background: currentColor; }
h1 { max-width: 820px; margin: 24px 0 18px; font-size: clamp(48px,8vw,96px); line-height: .92; letter-spacing: -.065em; }
.hero p { max-width: 650px; margin: 0; color: #c9c9c5; font-size: clamp(17px,2vw,21px); line-height: 1.65; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.hero-actions .btn { min-height: 54px; padding: 0 22px; border-radius: 16px; }
.hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 720px; margin-top: 70px; }
.hero-stat { padding: 18px 20px; border: 1px solid rgba(255,255,255,.1); border-radius: 18px; background: rgba(255,255,255,.045); }
.hero-stat b { display: block; font-size: 22px; }
.hero-stat span { color: #aaa; font-size: 12px; }
.section { padding: 76px 0; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 30px; margin-bottom: 32px; }
.section-head h2 { max-width: 720px; margin: 0; font-size: clamp(34px,5vw,58px); line-height: 1; letter-spacing: -.05em; }
.section-head p { max-width: 430px; margin: 0; color: var(--muted); line-height: 1.65; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.feature-card { min-height: 230px; padding: 28px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.feature-card .icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px; background: #111; color: white; font-size: 20px; }
.feature-card h3 { margin: 40px 0 10px; font-size: 20px; }
.feature-card p { margin: 0; color: var(--muted); line-height: 1.6; font-size: 14px; }
.dark-section { margin: 36px 0; padding: 82px 0; color: white; background: #0a0a0a; }
.steps { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; }
.step { padding: 28px; border: 1px solid #2d2d2d; border-radius: 22px; background: #121212; }
.step-number { color: #858585; font-size: 12px; font-weight: 900; letter-spacing: .15em; }
.step h3 { margin: 36px 0 10px; font-size: 22px; }
.step p { margin: 0; color: #aaa; line-height: 1.65; }
.pricing-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 18px; max-width: 920px; margin: 0 auto; }
.plan-card { position: relative; padding: 34px; border: 1px solid var(--line); border-radius: 28px; background: white; box-shadow: 0 14px 42px rgba(0,0,0,.045); }
.plan-card.featured { color: white; border-color: #111; background: #0b0b0b; box-shadow: 0 24px 70px rgba(0,0,0,.18); }
.plan-badge { position: absolute; right: 22px; top: 22px; padding: 7px 10px; border-radius: 999px; background: #f0f0ed; color: #111; font-size: 11px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.plan-name { color: var(--muted); font-weight: 850; }
.featured .plan-name { color: #a8a8a4; }
.price { margin: 14px 0 8px; font-size: 56px; font-weight: 950; letter-spacing: -.05em; }
.price small { font-size: 14px; letter-spacing: 0; color: var(--muted); }
.featured .price small { color: #aaa; }
.plan-copy { min-height: 48px; color: var(--muted); line-height: 1.55; }
.featured .plan-copy { color: #aaa; }
.plan-list { list-style: none; padding: 0; margin: 28px 0; display: grid; gap: 13px; }
.plan-list li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.plan-list li::before { content: "✓"; font-weight: 950; }
.plan-card .btn { min-height: 52px; }
.faq { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.faq-item { padding: 24px; border: 1px solid var(--line); border-radius: 20px; background: white; }
.faq-item b { display: block; margin-bottom: 9px; }
.faq-item p { margin: 0; color: var(--muted); line-height: 1.6; }
.cta { padding: 70px 0 90px; }
.cta-box { padding: clamp(32px,6vw,64px); border-radius: 30px; background: white; border: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 32px; }
.cta-box h2 { margin: 0 0 10px; font-size: clamp(34px,5vw,56px); letter-spacing: -.05em; }
.cta-box p { margin: 0; color: var(--muted); }
.footer { padding: 28px 0 40px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.footer-row { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.auth-page { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-visual { position: relative; overflow: hidden; padding: 48px; color: white; background: radial-gradient(circle at 20% 20%, #343434, transparent 28%), linear-gradient(145deg,#161616,#030303); }
.auth-visual .logo { position: relative; z-index: 2; }
.auth-copy { position: absolute; left: 48px; right: 48px; bottom: 54px; z-index: 2; }
.auth-copy h1 { margin: 0 0 18px; font-size: clamp(48px,7vw,82px); }
.auth-copy p { max-width: 560px; color: #bdbdb8; line-height: 1.7; }
.auth-panel { display: grid; place-items: center; padding: 34px; }
.form-card { width: min(470px,100%); }
.form-card .back { color: var(--muted); font-size: 13px; font-weight: 800; }
.form-card h2 { margin: 28px 0 8px; font-size: 38px; letter-spacing: -.045em; }
.form-card > p { margin: 0 0 28px; color: var(--muted); line-height: 1.55; }
.form { display: grid; gap: 15px; }
.field { display: grid; gap: 7px; }
.field label { font-size: 12px; font-weight: 850; }
.field input { min-height: 54px; width: 100%; padding: 0 15px; border: 1px solid var(--line); border-radius: 14px; outline: none; background: white; transition: .15s; }
.field input:focus { border-color: #111; box-shadow: 0 0 0 4px rgba(0,0,0,.06); }
.form-note { margin-top: 20px; color: var(--muted); font-size: 13px; text-align: center; }
.form-note a { color: #111; font-weight: 850; }
.alert { display: none; margin-bottom: 16px; padding: 13px 15px; border-radius: 13px; font-size: 13px; line-height: 1.45; }
.alert.show { display: block; }
.alert.error { color: #8d1b12; background: #fff0ed; border: 1px solid #f4c7bf; }
.alert.success { color: #155a32; background: #edf9f1; border: 1px solid #bce3c8; }
.checkout-page, .account-page { min-height: 100vh; padding-bottom: 70px; }
.simple-top { min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.checkout-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 24px; align-items: start; padding-top: 38px; }
.checkout-card, .summary-card, .account-card { padding: 30px; border: 1px solid var(--line); border-radius: 24px; background: white; }
.checkout-card h1 { margin: 0 0 10px; font-size: 42px; letter-spacing: -.05em; }
.checkout-card > p { color: var(--muted); }
.card-preview { height: 205px; margin: 26px 0; padding: 26px; border-radius: 22px; color: white; background: linear-gradient(135deg,#161616,#3b3b3b); display: flex; flex-direction: column; justify-content: space-between; box-shadow: 0 20px 45px rgba(0,0,0,.15); }
.card-preview .chip { width: 42px; height: 30px; border-radius: 8px; background: linear-gradient(135deg,#ddd,#999); }
.card-preview .number { font-size: 21px; letter-spacing: .11em; }
.card-preview-row { display: flex; justify-content: space-between; color: #d4d4d0; font-size: 11px; text-transform: uppercase; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.summary-card { position: sticky; top: 100px; }
.summary-card h2 { margin: 0; font-size: 24px; }
.summary-plan { margin: 24px 0; padding: 20px; border-radius: 18px; background: var(--surface-2); }
.summary-plan b { font-size: 22px; }
.summary-price { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-top: 12px; }
.summary-price strong { font-size: 32px; }
.summary-line { display: flex; justify-content: space-between; padding: 15px 0; border-top: 1px solid var(--line); color: var(--muted); }
.simulation-note { margin-top: 18px; padding: 14px; border-radius: 14px; color: #665400; background: #fff9d9; border: 1px solid #eadb8e; font-size: 12px; line-height: 1.55; }
.account-hero { padding: 52px 0 24px; }
.account-hero h1 { margin: 0 0 10px; font-size: clamp(42px,7vw,72px); letter-spacing: -.055em; }
.account-hero p { margin: 0; color: var(--muted); }
.account-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: 18px; }
.access-card { padding: 30px; border-radius: 26px; color: white; background: #0b0b0b; }
.access-card .status { display: inline-flex; padding: 7px 10px; border-radius: 999px; background: rgba(74,222,128,.13); color: #78e89e; font-size: 11px; font-weight: 900; text-transform: uppercase; }
.access-card h2 { margin: 28px 0 6px; font-size: 34px; }
.access-card .access-price { color: #aaa; }
.license { margin: 26px 0; padding: 14px; border: 1px dashed #4a4a4a; border-radius: 14px; color: #ddd; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; word-break: break-all; }
.profile-lines { display: grid; gap: 0; margin-top: 22px; }
.profile-line { display: flex; justify-content: space-between; gap: 20px; padding: 14px 0; border-top: 1px solid var(--line); font-size: 14px; }
.profile-line span { color: var(--muted); }
.purchase-list { display: grid; gap: 10px; margin-top: 18px; }
.purchase { padding: 17px; border: 1px solid var(--line); border-radius: 16px; display: grid; grid-template-columns: 1fr auto; gap: 8px 20px; }
.purchase small { color: var(--muted); }
.purchase .paid { color: var(--success); font-weight: 850; }
.purchase .failed { color: var(--danger); font-weight: 850; }
.empty-state { padding: 28px; border: 1px dashed var(--line); border-radius: 18px; color: var(--muted); text-align: center; }
@media (max-width: 900px) {
  .nav-links { display: none; }
  .hero-shell { min-height: auto; }
  .hero-stats, .feature-grid, .steps { grid-template-columns: 1fr; }
  .section-head, .cta-box { align-items: flex-start; flex-direction: column; }
  .pricing-grid, .faq, .checkout-grid, .account-grid, .auth-page { grid-template-columns: 1fr; }
  .auth-visual { min-height: 440px; }
  .summary-card { position: static; }
}
@media (max-width: 620px) {
  .container { width: min(100% - 24px,1160px); }
  .nav { min-height: 68px; }
  .nav-actions .btn:first-child { display: none; }
  .hero { padding-top: 20px; }
  .hero-shell { padding: 30px 22px; border-radius: 24px; }
  .hero-stats { margin-top: 42px; }
  .section { padding: 54px 0; }
  .form-row { grid-template-columns: 1fr; }
  .auth-visual { display: none; }
  .auth-panel { min-height: 100vh; padding: 24px; }
  .checkout-card, .summary-card, .account-card { padding: 22px; border-radius: 20px; }
}

/* v5.4.0 · Configuración multiempresa */
.field small { display:block; margin-top:7px; color:var(--muted); font-size:11px; line-height:1.45; }
.business-choice-grid { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.business-choice { position:relative; display:block; cursor:pointer; }
.business-choice input { position:absolute; opacity:0; pointer-events:none; }
.business-choice span { display:block; min-height:94px; padding:16px; border:1px solid var(--line); border-radius:16px; transition:.18s ease; }
.business-choice span b { display:block; margin-bottom:5px; }
.business-choice span small { margin:0; }
.business-choice input:checked + span { border-color:#111; box-shadow:0 0 0 1px #111 inset; background:#fafaf8; }
.business-choice.locked { opacity:.48; cursor:not-allowed; }
.business-choice.locked span { background:#f4f4f1; }
.workspace-data { display:flex; justify-content:space-between; gap:14px; align-items:center; margin:18px 0; padding:13px 15px; border:1px solid rgba(255,255,255,.14); border-radius:14px; color:#ddd; }
.workspace-data span { color:#aaa; font-size:12px; }
@media (max-width:640px) { .business-choice-grid { grid-template-columns:1fr; } .workspace-data { align-items:flex-start; flex-direction:column; } }

/* ==========================================================================\n   Ajuste de robustez visual para escalado de texto\n   No cambia funcionalidad: evita recortes con fuentes pequeñas/grandes.\n   ========================================================================== */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: hidden;
}
body {
  min-width: 280px;
  overflow-x: hidden;
  line-height: 1.5;
}

/* Permitir que los hijos de flex/grid realmente puedan encogerse. */
:where(.nav, .nav-actions, .hero-shell, .hero-stat, .section-head, .feature-card,
  .step, .pricing-grid, .plan-card, .faq-item, .cta-box, .auth-page, .auth-panel,
  .form-card, .simple-top, .checkout-grid, .checkout-card, .summary-card,
  .account-grid, .account-card, .access-card, .purchase, .profile-line,
  .business-choice, .workspace-data) > * {
  min-width: 0;
}

:where(h1, h2, h3, p, b, strong, small, span, label, a, button) {
  overflow-wrap: break-word;
}

/* Los botones deben crecer en altura cuando el texto ocupa dos o más líneas. */
.btn {
  height: auto;
  min-height: 46px;
  padding-block: 11px;
  line-height: 1.25;
  text-align: center;
  white-space: normal;
}
.hero-actions .btn,
.plan-card .btn { min-height: 52px; }

/* Header: no forzar todo a una sola línea. */
.nav {
  height: auto;
  padding-block: 10px;
  flex-wrap: wrap;
}
.logo { min-width: 0; }
.logo > * { min-width: 0; }
.nav-links,
.nav-actions { flex-wrap: wrap; }
.nav-actions { justify-content: flex-end; }

/* Las tarjetas deben crecer con el contenido. */
.hero-shell,
.feature-card,
.plan-copy,
.business-choice span { height: auto; }
.feature-card,
.step,
.plan-card,
.faq-item,
.checkout-card,
.summary-card,
.account-card,
.access-card { overflow: visible; }

.hero-stat,
.plan-badge,
.access-card .status { line-height: 1.3; }
.plan-badge {
  max-width: calc(100% - 44px);
  text-align: center;
  white-space: normal;
}
.price {
  font-size: clamp(38px, 7vw, 56px);
  overflow-wrap: anywhere;
}

/* Autenticación: eliminar dependencia de texto absoluto en la ilustración. */
.auth-visual {
  min-width: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
.auth-copy {
  position: static;
  margin-top: auto;
  padding-top: clamp(48px, 12vh, 140px);
}
.form-card h2 { font-size: clamp(30px, 5vw, 38px); }
.field input {
  height: auto;
  min-height: 54px;
  padding-block: 12px;
}

/* Checkout: la tarjeta simulada y los resúmenes admiten texto ampliado. */
.card-preview {
  height: auto;
  min-height: 205px;
  gap: 22px;
}
.card-preview .number {
  font-size: clamp(15px, 3.2vw, 21px);
  letter-spacing: clamp(.04em, .8vw, .11em);
  overflow-wrap: anywhere;
}
.card-preview-row,
.summary-price,
.summary-line,
.profile-line,
.simple-top,
.workspace-data {
  flex-wrap: wrap;
}
.summary-line > :last-child,
.profile-line > :last-child { text-align: right; }
.purchase {
  grid-template-columns: minmax(0, 1fr) minmax(min-content, auto);
}
.license { overflow-wrap: anywhere; }

/* Con textos grandes conviene colapsar antes las composiciones de 3/4 columnas. */
@media (max-width: 1080px) {
  .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .hero-stats,
  .feature-grid,
  .steps { grid-template-columns: 1fr; }
  .auth-visual { min-height: 440px; }
  .simple-top { padding-block: 10px; }
}

@media (max-width: 720px) {
  .pricing-grid,
  .faq,
  .checkout-grid,
  .account-grid,
  .auth-page { grid-template-columns: 1fr; }
  .profile-line,
  .summary-line,
  .summary-price { align-items: flex-start; }
  .purchase { grid-template-columns: 1fr; }
  .purchase > :last-child { justify-self: start; }
}

@media (max-width: 620px) {
  .nav { gap: 10px; }
  .logo img { width: 38px; height: 38px; }
  .nav-actions { gap: 6px; }
  .nav-actions .btn { padding-inline: 12px; }
  .hero-shell { padding-inline: 20px; }
  h1 { font-size: clamp(38px, 15vw, 62px); line-height: .98; }
  .account-hero h1 { font-size: clamp(36px, 13vw, 58px); }
  .checkout-card h1 { font-size: clamp(30px, 10vw, 42px); }
  .cta-box h2, .section-head h2 { line-height: 1.08; }
  .card-preview { padding: 20px; }
  .card-preview-row { gap: 12px; }
  .card-preview-row > * { flex: 1 1 120px; }
  .card-preview-row > :last-child { text-align: right; }
}

/* En pantallas muy estrechas, nunca sacrificar botones esenciales. */
@media (max-width: 380px) {
  .container { width: min(100% - 16px, 1160px); }
  .nav-actions { width: 100%; }
  .nav-actions .btn { flex: 1 1 100%; }
  .hero-shell,
  .checkout-card,
  .summary-card,
  .account-card { padding-inline: 16px; }
}

/* Mantener el comportamiento móvil original del acceso. */
@media (max-width: 620px) {
  .auth-visual { display: none; }
}
