/* ==========================================================================
   ALMEIDA ADVISORY — DESIGN SYSTEM & STYLES
   Brayan Caldas | Grupo Almeida · Lead Capture Form
   ========================================================================== */

/* ---------- CSS CUSTOM PROPERTIES (DESIGN TOKENS) ---------- */
:root {
  --bg-primary: #0A0F0D;
  --bg-secondary: #0F1712;
  --bg-elevated: #14201A;
  --green-deep: #0B3D2E;
  --green-accent: #16A34A;
  --green-glow: #22C55E;
  --text-primary: #F5F7F6;
  --text-secondary: #9CA8A3;
  --border-subtle: rgba(34, 197, 94, 0.15);
  --border-focus: rgba(34, 197, 94, 0.5);
  --shadow-elevation: rgba(0, 0, 0, 0.6);
  --gradient-hero: linear-gradient(135deg, #0A0F0D 0%, #0B3D2E 50%, #0A0F0D 100%);
  --gold-accent: #C5A55A;

  --font-headline: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --font-signature: 'Playfair Display', serif;

  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.08'/%3E%3C/svg%3E");
  z-index: 9999;
}

/* ---------- PARTICLES CANVAS ---------- */
#particles-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ---------- AMBIENT GLOW ---------- */
.ambient-glow {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 700px;
  height: 700px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(22, 163, 74, 0.08) 0%, transparent 70%);
  z-index: 0;
  pointer-events: none;
  animation: pulse-glow 7s ease-in-out infinite alternate;
}

@keyframes pulse-glow {
  0%   { opacity: 0.5; transform: translate(-50%, -50%) scale(1); }
  50%  { opacity: 0.8; transform: translate(-50%, -50%) scale(1.15); }
  100% { opacity: 0.5; transform: translate(-50%, -50%) scale(1); }
}

/* ---------- PAGE LAYOUT ---------- */
.page {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 15px;
  gap: 20px;
}

/* ---------- AUTHORITY COLUMN ---------- */
.authority-column {
  display: none; /* hidden on mobile, shown on large desktop */
  flex-direction: column;
  justify-content: center;
  max-width: 520px;
  gap: 24px;
  opacity: 0;
  transform: translateY(30px);
  animation: fade-up 0.7s var(--ease-out-expo) 0.1s forwards;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  color: var(--green-accent);
  text-transform: uppercase;
}

.headline {
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.15;
  color: var(--text-primary);
}

.highlight {
  color: var(--green-glow);
  position: relative;
}

.highlight::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--green-accent), var(--green-glow));
  border-radius: 2px;
  opacity: 0.6;
}

.subheadline {
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--text-secondary);
  max-width: 460px;
}

.authority-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 8px;
}

.authority-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.check-icon {
  flex-shrink: 0;
  font-size: 0.85rem;
  line-height: 1.6;
}

/* Slots counter */
.slots-counter {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: rgba(22, 163, 74, 0.08);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

.slots-number {
  font-family: var(--font-mono);
  font-size: 1.8rem;
  font-weight: 500;
  color: var(--green-glow);
}

.slots-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Signature */
.signature {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.signature-name {
  font-family: var(--font-signature);
  font-style: italic;
  font-weight: 600;
  font-size: 1.6rem;
  line-height: 1.2;
  color: var(--gold-accent);
  margin-bottom: 2px;
}

.signature-role {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* ---------- FORM COLUMN ---------- */
.form-column {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 520px;
  opacity: 0;
  transform: translateY(30px);
  animation: fade-up 0.7s var(--ease-out-expo) 0.3s forwards;
}

/* ---------- FORM CARD ---------- */
.form-card {
  position: relative;
  width: 100%;
  background: linear-gradient(160deg, rgba(14, 46, 28, 0.9), rgba(5, 8, 6, 0.98));
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-top: 1px solid rgba(34, 197, 94, 0.3);
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  will-change: transform;
  transform-style: preserve-3d;
  transition: box-shadow 0.3s var(--ease-smooth), transform 0.3s;
  box-shadow:
    0 30px 60px rgba(0,0,0,0.8),
    0 0 100px rgba(22, 163, 74, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.form-card:hover {
  transform: translateY(-5px) scale(1.01) perspective(1000px) rotateX(1deg);
  box-shadow:
    0 40px 80px rgba(0,0,0,0.9),
    0 0 120px rgba(22, 163, 74, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* ---------- CONTINGENCY TIMER ---------- */
.contingency-timer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(22, 163, 74, 0.1);
  border: 1px solid rgba(22, 163, 74, 0.3);
  padding: 10px 16px;
  border-radius: 8px;
  margin-bottom: 24px;
}

.timer-icon {
  font-size: 1.2rem;
}

.timer-text {
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.timer-text strong {
  color: var(--green-glow);
  font-family: var(--font-mono);
  font-size: 1.1rem;
  letter-spacing: 1px;
}

.form-card-glare {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-xl);
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(
    600px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
    rgba(255, 255, 255, 0.04),
    transparent 40%
  );
  transition: opacity 0.3s;
  z-index: 10;
}

.form-card:hover .form-card-glare {
  opacity: 1;
}

/* ---------- MOBILE HEADER ---------- */
.mobile-header {
  text-align: center;
  margin-bottom: 20px;
}

.mobile-header .eyebrow {
  margin-bottom: 8px;
  display: block;
}

.mobile-header h2 {
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 1.4rem;
  line-height: 1.2;
  margin-bottom: 4px;
}

.mobile-sub {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* ---------- PROGRESS BAR ---------- */
.progress-track {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 2px;
  margin-bottom: 12px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 12.5%;
  background: linear-gradient(90deg, var(--green-accent), var(--green-glow));
  border-radius: 2px;
  transition: width 0.4s var(--ease-out-expo);
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.3);
}

.step-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 20px;
}

.step-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.03);
  padding: 4px 8px;
  border-radius: 4px;
  transition: color 0.3s, background 0.3s;
}

.step-label.active {
  color: var(--green-accent);
  background: rgba(34, 197, 94, 0.1);
}

.step-label.done {
  color: var(--text-secondary);
}

/* ---------- FORM ---------- */
form {
  position: relative;
}

/* Honeypot */
.honeypot {
  position: absolute;
  left: -9999px;
  top: -9999px;
  width: 0;
  height: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}

/* ---------- FORM STEPS ---------- */
.form-step {
  display: none;
  flex-direction: column;
  gap: 14px;
  animation: step-enter 0.35s var(--ease-out-expo);
}

.form-step.active {
  display: flex;
}

@keyframes step-enter {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.form-step.exiting {
  animation: step-exit 0.25s var(--ease-smooth) forwards;
}

@keyframes step-exit {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(-30px);
  }
}

.form-step.entering-back {
  animation: step-enter-back 0.35s var(--ease-out-expo);
}

@keyframes step-enter-back {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ---------- FIELDS ---------- */
.field {
  position: relative;
}

.field input,
.field select {
  width: 100%;
  padding: 24px 16px 8px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-primary);
  background: rgba(10, 15, 12, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.08);
  border-top: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius-sm);
  outline: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  appearance: none;
  -webkit-appearance: none;
  box-shadow: inset 0 2px 5px rgba(0,0,0,0.5);
}

.field input:hover,
.field select:hover {
  border-color: rgba(255,255,255,0.2);
  background: rgba(15, 20, 16, 0.8);
}

.field input:focus,
.field select:focus {
  border-color: rgba(34, 197, 94, 0.8);
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.15), 0 10px 30px rgba(34, 197, 94, 0.15), inset 0 1px 10px rgba(34, 197, 94, 0.05);
  background: rgba(15, 25, 18, 0.9);
}

.field input.error,
.field select.error {
  border-color: #EF4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Float label */
.field label {
  position: absolute;
  top: 50%;
  left: 16px;
  transform: translateY(-50%);
  font-size: 0.92rem;
  color: var(--text-secondary);
  pointer-events: none;
  transition: all 0.2s var(--ease-smooth);
  transform-origin: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: calc(100% - 40px);
}

.field input:focus ~ label,
.field input:not(:placeholder-shown) ~ label,
.field select:focus ~ label,
.field-select.has-value label {
  top: 8px;
  transform: translateY(0) scale(0.75);
  color: var(--green-accent);
}

.optional-tag {
  font-size: 0.85em;
  opacity: 0.6;
}

/* Select arrow */
.field-select {
  position: relative;
}

.field-select::after {
  content: '';
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--text-secondary);
  pointer-events: none;
  transition: border-color 0.2s;
}

.field-select:focus-within::after {
  border-top-color: var(--green-accent);
}

/* Field hint */
.field-hint {
  display: block;
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 6px;
  padding-left: 2px;
  opacity: 0.7;
}

/* Field error */
.field-error {
  display: block;
  font-size: 0.78rem;
  color: #EF4444;
  margin-top: 4px;
  padding-left: 2px;
  min-height: 0;
  overflow: hidden;
  transition: all 0.2s;
}

.field-error:empty {
  margin-top: 0;
}

/* ---------- CONSENT CHECKBOX ---------- */
.consent {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  padding: 4px 0;
  user-select: none;
}

.consent input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.consent-check {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border: 1.5px solid rgba(255,255,255,0.15);
  border-radius: 5px;
  background: var(--bg-elevated);
  transition: all 0.2s;
  position: relative;
  margin-top: 1px;
}

.consent-check::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 6px;
  width: 5px;
  height: 9px;
  border: solid var(--bg-primary);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0);
  transition: transform 0.2s var(--ease-out-expo);
}

.consent input:checked ~ .consent-check {
  background: var(--green-accent);
  border-color: var(--green-accent);
}

.consent input:checked ~ .consent-check::after {
  transform: rotate(45deg) scale(1);
}

.consent input:focus-visible ~ .consent-check {
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
}

.consent-text {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.consent-error {
  margin-top: -4px;
}

/* ---------- BUTTONS ---------- */
.step-buttons {
  display: flex;
  gap: 12px;
  align-items: center;
}

.btn-next,
.btn-submit {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  color: var(--bg-primary);
  background: linear-gradient(135deg, var(--green-accent), var(--green-glow));
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s var(--ease-out-expo), box-shadow 0.2s;
}

.btn-next:hover,
.btn-submit:hover {
  transform: scale(1.03);
  box-shadow: 0 0 30px rgba(34, 197, 94, 0.25), 0 4px 16px rgba(0,0,0,0.3);
}

.btn-next:active,
.btn-submit:active {
  transform: scale(0.98);
}

/* Ripple */
.btn-next::after,
.btn-submit::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--ripple-x, 50%) var(--ripple-y, 50%), rgba(255,255,255,0.3) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}

.btn-next.ripple::after,
.btn-submit.ripple::after {
  opacity: 1;
  animation: ripple-fade 0.5s forwards;
}

@keyframes ripple-fade {
  to { opacity: 0; }
}

.btn-back {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 15px 18px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--text-secondary);
  background: transparent;
  border: 1.5px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
  white-space: nowrap;
}

.btn-back:hover {
  border-color: rgba(255,255,255,0.25);
  color: var(--text-primary);
}

/* Submit button states */
.btn-submit {
  font-size: 0.82rem;
  padding: 12px 20px;
}

.btn-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.btn-spinner {
  display: none;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
}

.btn-spinner:not([hidden]) {
  display: flex;
}

.spinner-svg {
  width: 20px;
  height: 20px;
  animation: spin 0.8s linear infinite;
}

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

/* ---------- PRIVACY NOTE ---------- */
.privacy-note {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-secondary);
  opacity: 0.6;
  margin-top: 4px;
}

/* ---------- SUCCESS STATE ---------- */
.form-success {
  align-items: center;
  text-align: center;
  padding: 20px 0;
}

.success-check {
  width: 64px;
  height: 64px;
  margin-bottom: 8px;
}

.success-svg {
  width: 64px;
  height: 64px;
}

.success-check-circle {
  stroke: var(--green-accent);
  stroke-width: 2;
  stroke-dasharray: 166;
  stroke-dashoffset: 166;
  animation: draw-circle 0.5s var(--ease-out-expo) forwards;
}

.success-check-path {
  stroke: var(--green-glow);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: draw-check 0.35s var(--ease-out-expo) 0.4s forwards;
}

@keyframes draw-circle {
  to { stroke-dashoffset: 0; }
}

@keyframes draw-check {
  to { stroke-dashoffset: 0; }
}

.success-title {
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--text-primary);
}

.success-sub {
  font-size: 0.92rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

/* WhatsApp CTA */
.btn-whatsapp {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 0.9rem;
  color: #fff;
  background: #25D366;
  border: none;
  border-radius: var(--radius-md);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s var(--ease-out-expo), box-shadow 0.2s;
}

.btn-whatsapp:hover {
  transform: scale(1.03);
  box-shadow: 0 0 30px rgba(37, 211, 102, 0.3), 0 4px 16px rgba(0,0,0,0.3);
}

/* ---------- FADE-UP ANIMATION ---------- */
@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   RESPONSIVE BREAKPOINTS
   ========================================================================== */

/* --- Tablet (≥ 768px) --- */
@media (min-width: 768px) {
  .page {
    padding: 60px 40px;
  }

  .form-card {
    padding: 44px 36px 36px;
  }

  .mobile-header h2 {
    font-size: 1.85rem;
  }
}

/* --- Notebook (≥ 1024px) — Layout duas colunas --- */
@media (min-width: 1024px) {
  .page {
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 40px;
    padding: 10px 40px;
    max-width: 1200px;
    margin: 0 auto;
    min-height: 100vh;
  }

  .authority-column {
    display: flex;
    flex: 1;
    max-width: 460px;
    gap: 16px;
  }

  .headline {
    font-size: clamp(1.8rem, 3.5vw, 2.5rem);
  }

  .subheadline {
    font-size: 0.95rem;
    line-height: 1.5;
  }

  .form-column {
    flex: 0 0 auto;
    width: 420px;
    max-width: 420px;
  }

  .form-card {
    padding: 24px 24px;
  }

  .field input, .field select {
    padding: 18px 12px 6px;
  }

  .field label {
    font-size: 0.85rem;
  }

  /* Compact the form spacing to prevent vertical scrolling */
  form {
    gap: 12px;
  }
  
  .step-labels {
    margin-top: 12px;
    margin-bottom: 20px;
  }

  .mobile-header {
    display: none;
  }
}

/* --- Desktop grande (≥ 1440px) --- */
@media (min-width: 1440px) {
  .page {
    gap: 80px;
    padding: 20px 80px;
    max-width: 1280px;
  }

  .authority-column {
    max-width: 520px;
    gap: 24px;
  }

  .headline {
    font-size: 3.2rem;
  }

  .subheadline {
    font-size: 1.1rem;
  }

  .form-column {
    width: 500px;
    max-width: 500px;
  }
  
  .form-card {
    padding: 32px 40px;
  }

  .ambient-glow {
    left: 65%;
  }
}

/* --- Ultra-wide (≥ 1680px) --- */
@media (min-width: 1680px) {
  .page {
    gap: 120px;
    max-width: 1400px;
  }
}

/* ==========================================================================
   ACCESSIBILITY & MOTION PREFERENCES
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .ambient-glow {
    animation: none;
    opacity: 0.5;
  }

  #particles-canvas {
    display: none;
  }
}

/* Focus visible for keyboard users */
:focus-visible {
  outline: 2px solid var(--green-accent);
  outline-offset: 2px;
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--green-glow);
  outline-offset: 2px;
}

/* Selection */
::selection {
  background: rgba(34, 197, 94, 0.25);
  color: var(--text-primary);
}
