/* =============================================
   TGX Sistemas - Landing styles
   Tema claro único. Sem dark mode, sem toggle.
   ============================================= */

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

:root {
  --brand: #007AFF;
  --brand-hover: #0066DD;
  --brand-soft: rgba(0, 122, 255, 0.10);
  --brand-mid: rgba(0, 122, 255, 0.22);

  --bg: #F5F5F7;
  --bg-elevated: #FFFFFF;
  --bg-inset: #EFEFF2;

  --fg: #1D1D1F;
  --fg-muted: #6E6E73;
  --fg-subtle: #86868B;

  --border: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.14);

  --ok: #34C759;
  --warn: #FF9500;
  --err: #FF3B30;
  --accent-purple: #AF52DE;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 8px 28px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.04);
  --shadow-lg: 0 24px 60px rgba(0,0,0,0.14);

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --radius-xl: 22px;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;

  --header-h: 64px;
  --container: 1120px;
  --reveal-y: 14px;
}

html {
  font-family: var(--font);
  background: var(--bg);
  color: var(--fg);
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  line-height: 1.5;
}

a { color: var(--brand); }
img, svg { display: block; max-width: 100%; }

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

.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;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -40px;
  background: var(--brand);
  color: #fff;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.8125rem;
  font-weight: 600;
  z-index: 200;
  transition: top 0.15s;
}
.skip-link:focus { top: 12px; }

/* ---------- Icon sprite ---------- */
.icon-sprite { width: 0; height: 0; position: absolute; overflow: hidden; }
.icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.icon-lg { width: 22px; height: 22px; }
.icon-solid { fill: currentColor; stroke: none; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(16px, 4vw, 40px);
  background: rgba(245, 245, 247, 0.82);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--fg);
}
.logo-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--brand);
  display: grid;
  place-items: center;
  color: #fff;
  box-shadow: 0 4px 14px rgba(0, 122, 255, 0.32);
}
.logo-mark svg { width: 18px; height: 18px; }
.logo-text {
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.logo-text .brand { color: var(--brand); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.15s;
  white-space: nowrap;
}
.btn:disabled { opacity: 0.65; cursor: not-allowed; }

.btn-primary {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 4px 18px rgba(0, 122, 255, 0.30);
}
.btn-primary:hover {
  background: var(--brand-hover);
  box-shadow: 0 6px 22px rgba(0, 122, 255, 0.38);
  transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); }

.btn-ghost {
  background: var(--bg-elevated);
  color: var(--fg);
  border-color: var(--border);
}
.btn-ghost:hover {
  background: var(--bg-inset);
  border-color: var(--border-strong);
}

.btn-sm {
  padding: 9px 18px;
  font-size: 0.8125rem;
}

.btn-lg {
  padding: 14px 28px;
  font-size: 1rem;
}

/* ---------- Layout helpers ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 48px);
}

section {
  padding: clamp(64px, 9vw, 104px) 0;
}

.section-head {
  max-width: 620px;
  margin-bottom: 40px;
}
.section-label {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 14px;
}
.section-title {
  font-size: clamp(1.5rem, 3vw, 2.125rem);
  font-weight: 800;
  letter-spacing: -0.032em;
  line-height: 1.12;
  margin-bottom: 12px;
}
.section-lead {
  font-size: 1rem;
  color: var(--fg-muted);
  line-height: 1.65;
}

/* ---------- Reveal on scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(var(--reveal-y));
  transition: opacity 0.55s ease, transform 0.55s ease;
  will-change: opacity, transform;
}
.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Hero ---------- */
.hero {
  padding: clamp(56px, 8vw, 96px) 0 clamp(48px, 7vw, 80px);
}
.hero-inner {
  max-width: 820px;
  margin: 0 auto;
  text-align: center;
}
.hero h1 {
  font-size: clamp(2rem, 5.4vw, 3.25rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.08;
  margin-bottom: 20px;
}
.hero h1 .hl { color: var(--brand); }

.hero-lead {
  font-size: clamp(1rem, 2vw, 1.125rem);
  color: var(--fg-muted);
  line-height: 1.65;
  max-width: 620px;
  margin: 0 auto 32px;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  align-items: center;
}

.hero-stats {
  margin-top: 48px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  max-width: 620px;
  margin-left: auto;
  margin-right: auto;
}
.hero-stat {
  padding: 22px 18px;
  text-align: center;
  border-right: 1px solid var(--border);
}
.hero-stat:last-child { border-right: none; }
.hero-stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--fg);
}
.hero-stat-value .unit { color: var(--brand); }
.hero-stat-label {
  font-size: 0.75rem;
  color: var(--fg-subtle);
  font-weight: 500;
  margin-top: 2px;
}

/* ---------- Segments ---------- */
.grid-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px 22px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s;
  display: flex;
  flex-direction: column;
}
.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--border-strong);
}

.card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  margin-bottom: 16px;
  color: var(--brand);
  background: var(--brand-soft);
}
.card-icon.green  { color: var(--ok);            background: rgba(52, 199, 89, 0.12); }
.card-icon.purple { color: var(--accent-purple); background: rgba(175, 82, 222, 0.12); }
.card-icon.orange { color: var(--warn);          background: rgba(255, 149, 0, 0.14); }
.card-icon .icon { width: 22px; height: 22px; }

.card-title {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}
.card-desc {
  font-size: 0.875rem;
  color: var(--fg-muted);
  line-height: 1.55;
  margin-bottom: 0;
}

/* ---------- How it works ---------- */
.how-wrap {
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-elevated) 100%);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  position: relative;
  --step-size: 52px;
}
.steps::before {
  content: "";
  position: absolute;
  top: calc(var(--step-size) / 2 - 1px);
  left: calc(16.66% + var(--step-size) / 2 + 8px);
  right: calc(16.66% + var(--step-size) / 2 + 8px);
  height: 2px;
  background-image: linear-gradient(to right, var(--brand-mid) 50%, transparent 0);
  background-size: 12px 2px;
  background-repeat: repeat-x;
  opacity: 0.7;
  z-index: 0;
  pointer-events: none;
}
.step {
  text-align: center;
  padding: 0 16px;
}
.step-num {
  width: var(--step-size);
  height: var(--step-size);
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  margin: 0 auto 22px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1.25rem;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  box-shadow: 0 6px 18px rgba(0, 122, 255, 0.28);
}
.step-title {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}
.step-desc {
  font-size: 0.875rem;
  color: var(--fg-muted);
  line-height: 1.6;
  max-width: 260px;
  margin: 0 auto;
}

/* ---------- Product tour ---------- */
.tour-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
  margin-bottom: 72px;
}
.tour-row:last-child { margin-bottom: 0; }
.tour-row.reverse .tour-copy { order: 2; }
.tour-row.reverse .tour-visual { order: 1; }

.tour-eyebrow {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 10px;
}
.tour-title {
  font-size: clamp(1.25rem, 2.5vw, 1.625rem);
  font-weight: 800;
  letter-spacing: -0.028em;
  line-height: 1.15;
  margin-bottom: 12px;
}
.tour-desc {
  font-size: 1rem;
  color: var(--fg-muted);
  line-height: 1.65;
  margin-bottom: 18px;
}
.tour-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.tour-list li {
  font-size: 0.9375rem;
  color: var(--fg);
  padding-left: 30px;
  position: relative;
  line-height: 1.5;
}
.tour-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--brand-soft);
  border: 1px solid var(--brand-mid);
}
.tour-list li::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 9px;
  width: 8px;
  height: 5px;
  border-left: 2px solid var(--brand);
  border-bottom: 2px solid var(--brand);
  transform: rotate(-45deg);
}

.tour-visual {
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}
.tour-visual img {
  width: 100%;
  height: auto;
  display: block;
}

/* ---------- Social / Testimonials ---------- */
.social-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.quote-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}
.quote-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--brand);
  margin-bottom: 16px;
}
.quote-tag .icon { width: 16px; height: 16px; stroke-width: 1.6; }
.quote-card blockquote {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--fg);
  font-weight: 500;
  margin-bottom: 18px;
}
.quote-card footer {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--fg-subtle);
  line-height: 1.5;
}
.social-note {
  margin-top: 20px;
  font-size: 0.75rem;
  color: var(--fg-subtle);
  text-align: center;
}

/* ---------- CTA strip ---------- */
.cta-strip {
  margin: clamp(48px, 7vw, 80px) auto 0;
  max-width: var(--container);
  padding: clamp(32px, 5vw, 56px) clamp(24px, 5vw, 56px);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(120% 120% at 0% 0%, rgba(0, 122, 255, 0.14), transparent 60%),
    linear-gradient(135deg, var(--bg-elevated), var(--bg-inset));
  border: 1px solid var(--border);
  text-align: center;
}
.cta-strip h2 {
  font-size: clamp(1.25rem, 2.6vw, 1.625rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  margin-bottom: 10px;
}
.cta-strip p {
  color: var(--fg-muted);
  font-size: 0.9375rem;
  margin-bottom: 22px;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

/* ---------- Footer ---------- */
.site-footer {
  padding: 28px clamp(20px, 5vw, 48px);
  border-top: 1px solid var(--border);
  text-align: center;
  margin-top: clamp(56px, 8vw, 96px);
}
.site-footer p {
  font-size: 0.75rem;
  color: var(--fg-subtle);
  line-height: 1.7;
}
.site-footer a { color: var(--fg-muted); text-decoration: underline; }
.site-footer a:hover { color: var(--brand); }

/* ---------- Modal ---------- */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: clamp(28px, 4vw, 40px);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  animation: modal-in 0.22s cubic-bezier(0.34, 1.2, 0.6, 1);
}
@keyframes modal-in {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .modal { animation: none; }
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: var(--bg-inset);
  color: var(--fg-muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.15s, color 0.15s;
}
.modal-close:hover {
  background: var(--border);
  color: var(--fg);
}
.modal-close .icon { width: 16px; height: 16px; stroke-width: 2; }

.modal-header { margin-bottom: 26px; }
.modal-header h2 {
  font-size: 1.375rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 6px;
}
.modal-header p {
  font-size: 0.875rem;
  color: var(--fg-muted);
  line-height: 1.5;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}
.form-group.full { grid-column: 1 / -1; }

label {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-muted);
}

input[type="text"],
input[type="email"],
input[type="tel"],
textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-inset);
  color: var(--fg);
  font-family: inherit;
  font-size: 0.9375rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  -webkit-appearance: none;
  appearance: none;
}
input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
textarea:focus {
  border-color: var(--brand);
  background: var(--bg-elevated);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
input[aria-invalid="true"],
textarea[aria-invalid="true"] {
  border-color: var(--err);
  background: rgba(255, 59, 48, 0.04);
}
input[aria-invalid="true"]:focus,
textarea[aria-invalid="true"]:focus {
  box-shadow: 0 0 0 3px rgba(255, 59, 48, 0.14);
}
textarea { min-height: 92px; resize: vertical; }

.field-error {
  font-size: 0.75rem;
  color: var(--err);
  display: none;
  gap: 6px;
  align-items: flex-start;
  line-height: 1.4;
}
.field-error.show { display: inline-flex; }
.field-error .icon { width: 14px; height: 14px; stroke-width: 2; flex-shrink: 0; margin-top: 1px; }

.consent {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 6px 0 20px;
}
.consent input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--brand);
  margin-top: 2px;
  flex-shrink: 0;
  cursor: pointer;
}
.consent label {
  text-transform: none;
  letter-spacing: normal;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--fg-muted);
  line-height: 1.5;
  cursor: pointer;
}
.consent label a { color: var(--brand); text-decoration: underline; }

.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.btn-submit {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(0, 122, 255, 0.30);
  transition: background 0.15s, box-shadow 0.15s, transform 0.15s, opacity 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.btn-submit:hover:not(:disabled) {
  background: var(--brand-hover);
  box-shadow: 0 6px 22px rgba(0, 122, 255, 0.38);
  transform: translateY(-1px);
}
.btn-submit:active:not(:disabled) { transform: translateY(0); }
.btn-submit:disabled { opacity: 0.7; cursor: not-allowed; }

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: none;
}
.btn-submit.loading .spinner { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .spinner { animation: none; }
}

.form-success {
  display: none;
  text-align: center;
  padding: 22px 0 8px;
}
.form-success.show { display: block; }
.form-success .check-ring {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(52, 199, 89, 0.14);
  color: var(--ok);
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
}
.form-success .check-ring .icon { width: 26px; height: 26px; stroke-width: 2.5; }
.form-success h3 {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
  color: var(--fg);
}
.form-success p {
  font-size: 0.875rem;
  color: var(--fg-muted);
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .grid-cards { grid-template-columns: repeat(2, 1fr); }
  .tour-row { gap: 36px; }
}

@media (max-width: 768px) {
  .steps { grid-template-columns: 1fr; gap: 28px; }
  .steps::before { display: none; }
  .tour-row,
  .tour-row.reverse {
    grid-template-columns: 1fr;
    gap: 24px;
    margin-bottom: 56px;
  }
  .tour-row.reverse .tour-copy,
  .tour-row.reverse .tour-visual { order: unset; }
  .social-grid { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .grid-cards { grid-template-columns: 1fr; }
  .hero-stats { grid-template-columns: 1fr; }
  .hero-stat { border-right: none; border-bottom: 1px solid var(--border); }
  .hero-stat:last-child { border-bottom: none; }
  .form-row { grid-template-columns: 1fr; }
}
