/* ==========================================================================
   NIVELU SIMULATOR — DESIGN SYSTEM & AESTHETICS
   Palette: Cyber-Emerald / Midnight Obsidian / Neon Cyan / Gold Amber
   Typography: Outfit (Display & Headings) + Plus Jakarta Sans (Body) + JetBrains Mono (Numbers)
   ========================================================================== */

:root {
  /* Colors */
  --bg-main: #060911;
  --bg-card: rgba(15, 23, 42, 0.75);
  --bg-card-hover: rgba(30, 41, 59, 0.85);
  --bg-input: #0b1120;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: #10b981;
  --border-card: rgba(16, 185, 129, 0.18);

  --primary: #10b981;
  --primary-light: #34d399;
  --primary-dark: #059669;
  --primary-glow: rgba(16, 185, 129, 0.35);

  --cyan: #06b6d4;
  --cyan-light: #38bdf8;
  --cyan-glow: rgba(6, 182, 212, 0.3);

  --amber: #f59e0b;
  --amber-light: #fbbf24;
  --amber-glow: rgba(245, 158, 11, 0.3);

  --purple: #8b5cf6;

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-inverse: #030712;

  /* Spacing & Radii */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  /* Shadows & Glass */
  --shadow-card: 0 10px 30px -5px rgba(0, 0, 0, 0.5), 0 0 1px 1px rgba(255, 255, 255, 0.05);
  --shadow-glow-primary: 0 0 25px rgba(16, 185, 129, 0.25);
  --shadow-glow-cyan: 0 0 25px rgba(6, 182, 212, 0.25);
  --glass-blur: blur(16px);
}

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

html {
  scroll-behavior: smooth;
  font-family: 'Plus Jakarta Sans', sans-serif;
  background-color: var(--bg-main);
  color: var(--text-primary);
  color-scheme: dark;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  background: 
    radial-gradient(circle at 15% 15%, rgba(16, 185, 129, 0.09) 0%, transparent 40%),
    radial-gradient(circle at 85% 25%, rgba(6, 182, 212, 0.08) 0%, transparent 45%),
    radial-gradient(circle at 50% 80%, rgba(245, 158, 11, 0.05) 0%, transparent 50%),
    var(--bg-main);
  background-attachment: fixed;
}

/* Typography Helpers */
h1, h2, h3, h4, .font-display {
  font-family: 'Outfit', sans-serif;
  letter-spacing: -0.02em;
}

.mono {
  font-family: 'JetBrains Mono', monospace;
}

/* Container */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ==========================================================================
   HEADER / NAVBAR
   ========================================================================== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  background: rgba(6, 9, 17, 0.82);
  border-bottom: 1px solid var(--border-subtle);
  padding: 16px 0;
}

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

.logo-group {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-primary);
}

.logo-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary-light), var(--primary-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-glow-primary);
}

.logo-icon svg {
  width: 24px;
  height: 24px;
  fill: white;
}

.logo-text {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.logo-tag {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  background: rgba(16, 185, 129, 0.15);
  color: var(--primary-light);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-weight: 700;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  padding: 10px 18px;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-ghost:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  border: none;
  padding: 10px 22px;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-glow-primary);
  transition: all 0.25s ease;
  text-decoration: none;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(16, 185, 129, 0.5);
}

/* ==========================================================================
   HERO / BANNER SECTION
   ========================================================================== */
.hero {
  padding: 48px 0 32px;
  text-align: center;
}

.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 6px 16px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  color: var(--primary-light);
  margin-bottom: 20px;
  animation: pulse-glow 3s infinite;
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 10px rgba(16, 185, 129, 0.1); }
  50% { box-shadow: 0 0 20px rgba(16, 185, 129, 0.3); }
}

.hero-title {
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 16px;
  background: linear-gradient(180deg, #ffffff 40%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-title span {
  background: linear-gradient(135deg, var(--primary-light), var(--cyan-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 18px;
  color: var(--text-secondary);
  max-width: 680px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ==========================================================================
   PRESET QUICK CHIPS
   ========================================================================== */
.presets-section {
  margin: 28px 0 36px;
}

.presets-label {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 12px;
  font-weight: 700;
  text-align: center;
}

.presets-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.preset-chip {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  backdrop-filter: var(--glass-blur);
  padding: 10px 18px;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.preset-chip:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: rgba(16, 185, 129, 0.4);
  transform: translateY(-2px);
}

.preset-chip.active {
  background: rgba(16, 185, 129, 0.15);
  border-color: var(--primary);
  color: var(--primary-light);
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.2);
}

/* ==========================================================================
   SIMULATOR WORKBENCH (GRID 2 COLS)
   ========================================================================== */
.simulator-layout {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 32px;
  margin-bottom: 48px;
  align-items: start;
}

@media (max-width: 1024px) {
  .simulator-layout {
    grid-template-columns: 1fr;
  }
}

/* Glass Card */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 28px;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}

.glass-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent);
}

.card-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.card-title {
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-title svg {
  width: 22px;
  height: 22px;
  color: var(--primary);
}

/* Control Group */
.control-group {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.control-item {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.control-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.control-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.control-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.control-input-prefix {
  position: absolute;
  left: 14px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
}

.control-input-suffix {
  position: absolute;
  right: 14px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
}

.control-number-input {
  width: 140px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--primary-light);
  font-size: 16px;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  text-align: right;
  transition: all 0.2s ease;
}

.control-number-input.has-prefix {
  padding-left: 36px;
}

.control-number-input.has-suffix {
  padding-right: 48px;
}

.control-number-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.25);
  background: rgba(16, 185, 129, 0.05);
}

/* Modern Range Slider */
.slider-container {
  position: relative;
  width: 100%;
}

.custom-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: var(--radius-full);
  background: #1e293b;
  outline: none;
  cursor: pointer;
  transition: background 0.15s ease-in-out;
}

.custom-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary-light);
  border: 3px solid var(--bg-main);
  box-shadow: 0 0 12px var(--primary-glow);
  cursor: grab;
  transition: all 0.15s ease;
}

.custom-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 0 20px var(--primary);
}

.custom-slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary-light);
  border: 3px solid var(--bg-main);
  box-shadow: 0 0 12px var(--primary-glow);
  cursor: grab;
}

.slider-limits {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Benchmark Rentability Buttons */
.benchmark-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.btn-benchmark {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-benchmark:hover {
  background: rgba(16, 185, 129, 0.1);
  border-color: var(--primary);
  color: var(--primary-light);
}

/* ==========================================================================
   RESULTS DASHBOARD (RIGHT COL)
   ========================================================================== */
.results-dashboard {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Main Grand Total Banner */
.grand-total-banner {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(6, 182, 212, 0.1));
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: var(--radius-xl);
  padding: 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-glow-primary);
  position: relative;
  overflow: hidden;
}

.grand-total-banner::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.15), transparent 70%);
  pointer-events: none;
}

.grand-total-info .label {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--primary-light);
  font-weight: 700;
  margin-bottom: 6px;
}

.grand-total-value {
  font-size: clamp(32px, 4vw, 44px);
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -1px;
}

.growth-badge {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(16, 185, 129, 0.4);
  padding: 12px 18px;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  backdrop-filter: var(--glass-blur);
}

.growth-multiplier {
  font-size: 24px;
  font-weight: 800;
  color: var(--primary-light);
}

.growth-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* Metric Cards Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.2s ease;
}

.metric-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.15);
}

.metric-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.metric-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.metric-icon svg {
  width: 16px;
  height: 16px;
}

.metric-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.metric-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
}

.metric-card.cyan .metric-icon { background: rgba(6, 182, 212, 0.15); color: var(--cyan-light); }
.metric-card.cyan .metric-value { color: var(--cyan-light); }

.metric-card.amber .metric-icon { background: rgba(245, 158, 11, 0.15); color: var(--amber-light); }
.metric-card.amber .metric-value { color: var(--amber-light); }

.metric-card.purple .metric-icon { background: rgba(139, 92, 246, 0.15); color: #c084fc; }
.metric-card.purple .metric-value { color: #c084fc; }

/* ==========================================================================
   CHART SECTION
   ========================================================================== */
.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 24px;
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.chart-legends {
  display: flex;
  align-items: center;
  gap: 18px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.chart-wrapper {
  position: relative;
  height: 320px;
  width: 100%;
}

/* ==========================================================================
   MILESTONES & INSIGHTS
   ========================================================================== */
.insights-card {
  background: linear-gradient(180deg, var(--bg-card), rgba(15, 23, 42, 0.95));
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 24px;
}

.milestones-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.milestone-box {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.milestone-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(245, 158, 11, 0.15);
  color: var(--amber-light);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.milestone-icon svg {
  width: 20px;
  height: 20px;
}

.milestone-details .m-title {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
}

.milestone-details .m-time {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
}

/* ==========================================================================
   EVOLUTION TABLE
   ========================================================================== */
.table-section {
  margin-bottom: 60px;
}

.table-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 24px;
}

.table-responsive {
  overflow-x: auto;
  margin-top: 16px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: right;
  font-size: 14px;
}

.data-table th, .data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.data-table th {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.5px;
}

.data-table th:first-child, .data-table td:first-child {
  text-align: left;
}

.data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.data-table .highlight-green {
  color: var(--primary-light);
  font-weight: 700;
}

.data-table .highlight-cyan {
  color: var(--cyan-light);
}

.data-table .highlight-amber {
  color: var(--amber-light);
}

/* ==========================================================================
   CALL TO ACTION — NIVELU APP PROMO
   ========================================================================== */
.app-promo-card {
  background: radial-gradient(circle at top right, rgba(16, 185, 129, 0.18), transparent 60%),
              radial-gradient(circle at bottom left, rgba(6, 182, 212, 0.15), transparent 50%),
              var(--bg-card);
  border: 1px solid rgba(16, 185, 129, 0.4);
  border-radius: var(--radius-xl);
  padding: 40px;
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 32px;
  align-items: center;
  margin-bottom: 60px;
  box-shadow: var(--shadow-glow-primary);
}

@media (max-width: 860px) {
  .app-promo-card {
    grid-template-columns: 1fr;
    text-align: center;
    padding: 28px;
  }
}

.promo-title {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 12px;
  color: #ffffff;
}

.promo-desc {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 24px;
}

.lead-form {
  display: flex;
  gap: 10px;
}

@media (max-width: 600px) {
  .lead-form {
    flex-direction: column;
  }
}

.lead-input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: white;
  padding: 14px 20px;
  border-radius: var(--radius-full);
  font-size: 14px;
  outline: none;
}

.lead-input:focus {
  border-color: var(--primary);
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.footer {
  border-top: 1px solid var(--border-subtle);
  padding: 32px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

.footer-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--primary-light);
}

/* Tooltip & Responsive Utilities */
@media (max-width: 640px) {
  .grand-total-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  .growth-badge {
    align-self: stretch;
    flex-direction: row;
    justify-content: space-between;
  }
}

/* ==================== AVISOS (Fase 0) ==================== */
.rate-note,
.disclaimer {
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-secondary);
}

.rate-note {
  margin-top: 10px;
}

.rate-note a,
.disclaimer a {
  color: inherit;
  text-decoration: underline;
}

.disclaimer {
  margin-top: 4px;
  padding: 12px 14px;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
}

.promo-soon {
  margin-top: 16px;
  font-weight: 600;
  color: var(--text-secondary);
}

.rate-note p {
  margin: 0;
}

.rate-note details {
  margin-top: 6px;
}

.rate-note summary {
  cursor: pointer;
  text-decoration: underline;
}

.rate-note ul {
  margin: 6px 0;
  padding-left: 18px;
}

.rate-note li {
  margin-bottom: 4px;
}

/* ==================== CELULAR: cabeçalho e rodapé ====================
   O cabeçalho tinha ~536px de conteúdo e forçava a página a ficar mais
   larga que a tela nos celulares. */
.header-content {
  gap: 12px;
}

.footer-links {
  flex-wrap: wrap;
  justify-content: center;
  row-gap: 8px;
}

@media (max-width: 640px) {
  .logo-tag,
  .header-cta {
    display: none;
  }

  .header {
    padding: 12px 0;
  }

  .btn-ghost {
    padding: 8px 14px;
  }

  .footer-links {
    column-gap: 18px;
  }
}

@media (max-width: 360px) {
  /* Telas muito estreitas: só o ícone de compartilhar. */
  .btn-ghost .btn-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .btn-ghost {
    padding: 8px 10px;
  }
}

/* Itens do grid podem encolher abaixo do tamanho do conteúdo
   (sem isso o card de parâmetros vazava em telas de 320px). */
.simulator-layout > * {
  min-width: 0;
}

@media (max-width: 480px) {
  .container {
    padding: 0 16px;
  }

  .glass-card {
    padding: 20px;
  }

  .control-header {
    flex-wrap: wrap;
    gap: 8px;
  }

  .control-number-input {
    width: 124px;
  }
}
