/* ============================================
   SCALE STACK™ — Agência Rei
   LP de Indicação (R$ 750 de desconto)
   ============================================ */

:root {
  /* Backgrounds */
  --bg-base: #07080F;
  --bg-elevated: #0E1019;
  --bg-input: rgba(11, 12, 23, 0.72);
  --bg-glass: rgba(14, 16, 25, 0.72);

  /* Borders */
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-mid: rgba(255, 255, 255, 0.14);
  --border-glow: rgba(255, 184, 0, 0.4);

  /* Text */
  --text-primary: #FFFFFF;
  --text-secondary: #B0B4C5;
  --text-muted: #7C819A;

  /* Brand */
  --gold: #FFB800;
  --gold-light: #FFD24D;
  --gold-dark: #FF8A00;

  /* Futuristic accents */
  --violet: #7C3AED;
  --cyan: #06B6D4;

  /* Semantic */
  --success: #10B981;
  --danger: #F87171;
  --danger-text: #FCA5A5;

  /* Gradients */
  --gradient-gold: linear-gradient(135deg, #FFD24D 0%, #FF8A00 100%);
  --gradient-text: linear-gradient(135deg, #FFD24D 0%, #FF8A00 55%, #FF6A00 100%);
  --gradient-card: linear-gradient(180deg, rgba(255, 255, 255, 0.055) 0%, rgba(255, 255, 255, 0.02) 100%);

  /* Shadows */
  --shadow-lg: 0 32px 80px -20px rgba(0, 0, 0, 0.75);
  --glow-gold: 0 12px 36px -8px rgba(255, 184, 0, 0.55);

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 26px;
  --radius-pill: 999px;

  /* Typography */
  --font-display: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  /* Transitions */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --t-fast: 0.18s var(--ease);
  --t-base: 0.28s var(--ease);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  font-size: 16px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  font-family: var(--font-body);
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

img, svg { display: block; max-width: 100%; height: auto; }
button { font: inherit; cursor: pointer; background: none; border: 0; color: inherit; }
a { color: inherit; text-decoration: none; }
input, textarea { font: inherit; color: inherit; background: none; border: 0; outline: 0; }

::selection { background: var(--gold); color: var(--bg-base); }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  padding: 0.75rem 1.25rem;
  background: var(--gold);
  color: #07080F;
  font-weight: 700;
  border-radius: var(--radius-sm);
}
.skip-link:focus { left: 1rem; top: 1rem; }

/* ---------- BACKGROUND DECOR ---------- */
.bg-decor {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.bg-grid {
  position: absolute;
  inset: -50% -50%;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
  animation: grid-drift 60s linear infinite;
}

@keyframes grid-drift {
  to { transform: translate(64px, 64px); }
}

.bg-noise {
  position: absolute;
  inset: 0;
  opacity: 0.03;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='0.7'/></svg>");
}

.bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.42;
  animation: orb-float 24s ease-in-out infinite;
  will-change: transform;
}

.bg-orb--gold {
  width: 560px; height: 560px;
  background: radial-gradient(circle, rgba(255, 184, 0, 0.35), transparent 70%);
  top: -180px; left: -140px;
}

.bg-orb--violet {
  width: 480px; height: 480px;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.3), transparent 70%);
  top: 35%; right: -180px;
  animation-delay: -8s;
}

.bg-orb--cyan {
  width: 420px; height: 420px;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.22), transparent 70%);
  bottom: -160px; left: 35%;
  animation-delay: -15s;
}

@keyframes orb-float {
  0%, 100% { transform: translate(0, 0); }
  33% { transform: translate(35px, -25px); }
  66% { transform: translate(-25px, 40px); }
}

/* ---------- LAYOUT ---------- */
.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding-inline: clamp(1rem, 4vw, 2rem);
  position: relative;
  z-index: 1;
}

/* ---------- HEADER ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 1rem 0;
  background: rgba(7, 8, 15, 0.72);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border-bottom: 1px solid var(--border-subtle);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-logo {
  height: 36px;
  width: auto;
}

.header-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
}

.badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 10px var(--gold);
}

/* ---------- MAIN SECTION ---------- */
.main-wrap {
  flex: 1 0 auto;
  position: relative;
  z-index: 1;
}

.referral-section {
  padding: clamp(2rem, 5vw, 4rem) 0 clamp(3rem, 6vw, 5rem);
}

.referral-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.12fr);
  gap: clamp(2rem, 4.5vw, 3.75rem);
  align-items: start;
}

@media (max-width: 960px) {
  .referral-grid {
    grid-template-columns: 1fr;
    gap: 2.25rem;
  }
}

/* ---------- LEFT COLUMN (INTRO) ---------- */
.referral-intro {
  position: sticky;
  top: 5.5rem;
}

@media (max-width: 960px) {
  .referral-intro { position: static; }
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--gold);
  text-transform: lowercase;
  margin-bottom: 1.25rem;
  padding: 0.38rem 0.9rem;
  background: rgba(255, 184, 0, 0.08);
  border: 1px solid rgba(255, 184, 0, 0.22);
  border-radius: var(--radius-pill);
}

.eyebrow-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 4.2vw, 3.35rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.06;
  color: var(--text-primary);
  margin-bottom: 1.25rem;
}

.text-gradient {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.hero-lead {
  font-size: clamp(1rem, 1.35vw, 1.125rem);
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 2rem;
  max-width: 52ch;
}

.hero-lead strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* Benefit steps */
.benefit-cards {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 1.75rem;
}

.benefit-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 1.15rem;
  background: var(--gradient-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: border-color var(--t-fast), transform var(--t-fast);
}

.benefit-card:hover {
  border-color: var(--border-glow);
  transform: translateX(3px);
}

.benefit-num {
  flex: none;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--gold);
  background: rgba(255, 184, 0, 0.1);
  border: 1px solid rgba(255, 184, 0, 0.25);
  border-radius: var(--radius-sm);
  padding: 0.3rem 0.55rem;
  line-height: 1;
  margin-top: 0.1rem;
}

.benefit-card h2 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.2rem;
}

.benefit-card p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Callout metric strip */
.value-callout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: rgba(14, 16, 25, 0.8);
  border: 1px solid rgba(255, 184, 0, 0.22);
  border-radius: var(--radius-md);
}

.callout-metric {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.callout-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.callout-val {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

.callout-divider {
  width: 1px;
  height: 32px;
  background: var(--border-subtle);
}

@media (max-width: 520px) {
  .value-callout {
    flex-wrap: wrap;
    gap: 1rem;
  }
  .callout-divider { display: none; }
}

/* ---------- RIGHT COLUMN (FORM CARD) ---------- */
.form-card {
  position: relative;
  border-radius: var(--radius-xl);
  background: var(--bg-glass);
  border: 1px solid var(--border-mid);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  overflow: hidden;
  padding: clamp(1.5rem, 3.2vw, 2.5rem);
}

.form-card-accent {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-gold);
}

.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-group-block {
  border: 0;
  padding: 0;
  margin: 0 0 1.75rem;
  min-width: 0;
}

.block-title {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border-subtle);
}

.block-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--gold);
  background: rgba(255, 184, 0, 0.1);
  border: 1px solid rgba(255, 184, 0, 0.25);
  border-radius: 6px;
  padding: 0.15rem 0.45rem;
}

.field-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
}

@media (max-width: 560px) {
  .field-row-2 {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

.field {
  margin-bottom: 1rem;
}

.field label,
.field-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.45rem;
}

.req {
  color: var(--gold);
}

.opt {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.field input[type="text"],
.field input[type="tel"],
.field textarea {
  width: 100%;
  padding: 0 1rem;
  font: 500 0.95rem var(--font-body);
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1.5px solid var(--border-mid);
  border-radius: var(--radius-md);
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background-color var(--t-fast);
  -webkit-appearance: none;
  appearance: none;
}

.field input[type="text"],
.field input[type="tel"] {
  height: 50px;
}

.field textarea {
  padding: 0.85rem 1rem;
  resize: vertical;
  min-height: 92px;
  line-height: 1.5;
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}

.field input:hover,
.field textarea:hover {
  border-color: rgba(255, 255, 255, 0.26);
}

.field input:focus,
.field textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(255, 184, 0, 0.16);
  background: rgba(11, 12, 23, 0.92);
}

.field.has-error input,
.field.has-error textarea {
  border-color: var(--danger);
  box-shadow: 0 0 0 4px rgba(248, 113, 113, 0.15);
}

.field-error {
  margin-top: 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--danger-text);
}
.field-error:empty { display: none; }

/* Segment chips */
.segment-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chip {
  padding: 0.55rem 0.95rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-input);
  border: 1.5px solid var(--border-mid);
  border-radius: var(--radius-pill);
  transition: all var(--t-fast);
}

.chip:hover {
  border-color: rgba(255, 255, 255, 0.3);
  color: var(--text-primary);
}

.chip.is-selected {
  color: #07080F;
  font-weight: 600;
  background: var(--gradient-gold);
  border-color: transparent;
  box-shadow: 0 4px 14px -4px rgba(255, 184, 0, 0.45);
}

/* Checkbox */
.field-check {
  margin-top: 0.5rem;
  margin-bottom: 1.35rem;
}

.check-label {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  background: var(--bg-input);
  border: 1.5px solid var(--border-mid);
  border-radius: var(--radius-md);
  cursor: pointer;
  user-select: none;
  margin-bottom: 0;
  transition: border-color var(--t-fast), background-color var(--t-fast);
}

.check-label:hover {
  border-color: rgba(255, 255, 255, 0.28);
}

.check-label input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.check-box {
  flex: none;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  border-radius: 6px;
  border: 1.5px solid rgba(255, 255, 255, 0.32);
  display: grid;
  place-items: center;
  transition: background-color var(--t-fast), border-color var(--t-fast);
}

.check-box::after {
  content: "";
  width: 10px;
  height: 6px;
  margin-top: -2px;
  border: solid #07080F;
  border-width: 0 0 2.4px 2.4px;
  transform: rotate(-45deg) scale(0);
  transition: transform var(--t-fast);
}

.check-label:has(input:checked) {
  border-color: var(--gold);
  background: rgba(255, 184, 0, 0.08);
}

.check-label input:checked + .check-box {
  background: var(--gold);
  border-color: var(--gold);
}

.check-label input:checked + .check-box::after {
  transform: rotate(-45deg) scale(1);
}

.check-label:has(input:focus-visible) {
  box-shadow: 0 0 0 4px rgba(255, 184, 0, 0.2);
}

.field-check.has-error .check-label {
  border-color: var(--danger);
  box-shadow: 0 0 0 4px rgba(248, 113, 113, 0.14);
}

.check-text {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  line-height: 1.45;
}

.check-text strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  padding: 1rem 1.75rem;
  border-radius: var(--radius-pill);
  transition: transform var(--t-base), box-shadow var(--t-base), background var(--t-base), border-color var(--t-base);
  position: relative;
  isolation: isolate;
}

.btn-block {
  width: 100%;
}

.btn-primary {
  background: var(--gradient-gold);
  color: #07080F;
  box-shadow: 0 10px 30px -8px rgba(255, 184, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px -8px rgba(255, 184, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  border: 1px solid var(--border-mid);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: var(--gold);
  transform: translateY(-2px);
}

.btn-arrow {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.3;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform var(--t-fast);
}

.btn-primary:hover .btn-arrow {
  transform: translateX(3px);
}

.btn-spinner {
  display: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2.5px solid rgba(7, 8, 15, 0.25);
  border-top-color: #07080F;
  animation: spin 0.75s linear infinite;
}

.referral-form.is-loading .btn-arrow { display: none; }
.referral-form.is-loading .btn-spinner { display: inline-block; }
.referral-form.is-loading #submitBtn {
  pointer-events: none;
  opacity: 0.9;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---------- RULES LIST ---------- */
.rules-list {
  list-style: none;
  margin-top: 1.35rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.rules-list li {
  position: relative;
  padding-left: 1.1rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.rules-list li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--gold);
  font-weight: 700;
}

/* ---------- SUCCESS STATE ---------- */
.form-success {
  text-align: center;
  padding: 2rem 0.5rem;
  animation: fadeIn 0.35s var(--ease);
}

/* ---------- MULTI-STEP (FASES) ---------- */
.form-progress {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 0.75rem;
}

.fp-bar {
  height: 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
  position: relative;
}

.fp-bar::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--gradient-gold);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 0.45s var(--ease);
}

.fp-bar.is-on::after {
  transform: scaleX(1);
}

.form-step-label {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--gold);
  margin-bottom: 1.25rem;
}

.form-step {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}

.form-step[hidden] {
  display: none;
}

.form-step.is-entering {
  animation: stepIn 0.36s var(--ease);
}

.form-step.is-entering-back {
  animation: stepInBack 0.36s var(--ease);
}

@keyframes stepIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes stepInBack {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

.form-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.form-actions .btn-back {
  flex: none;
  padding-inline: 1.25rem;
}

.form-actions .btn-primary {
  flex: 1;
}

@media (max-width: 460px) {
  .form-actions {
    flex-direction: column-reverse;
  }
  .form-actions .btn-back,
  .form-actions .btn-primary {
    width: 100%;
  }
}

.form-success[hidden] { display: none; }
.referral-form[hidden] { display: none; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.success-ico {
  width: 64px;
  height: 64px;
  margin: 0 auto 1.25rem;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.14);
  border: 1.5px solid rgba(16, 185, 129, 0.45);
  display: grid;
  place-items: center;
  color: var(--success);
}

.success-ico svg {
  width: 30px;
  height: 30px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.success-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--success);
  margin-bottom: 0.5rem;
}

.success-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

.success-desc {
  font-size: 0.96rem;
  color: var(--text-secondary);
  line-height: 1.65;
  max-width: 44ch;
  margin: 0 auto 1.75rem;
}

.success-desc strong {
  color: var(--text-primary);
}

/* ---------- FOOTER ---------- */
.site-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border-subtle);
  padding: 1.35rem 0;
  background: rgba(7, 8, 15, 0.6);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.footer-note {
  font-family: var(--font-mono);
  font-size: 0.74rem;
}
