/* ============================================================
   Simulador de Consórcio — Evoxlife Matched UI (Dark Theme)
   ============================================================ */

#sc-root {
  /* Evoxlife mapped to Light/Dark */
  --bg: transparent;
  --surface: rgba(255, 255, 255, 0.02);
  --border: rgba(255, 255, 255, 0.08);
  --text: #f8fafc;
  --text-2: #94a3b8;
  --blue: #ffffff;
  --blue-dark: #f8fafc;
  --blue-ring: rgba(255, 255, 255, 0.25);
  --blue-bg: rgba(255, 255, 255, 0.05);
  --green: #10b981;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2), 0 4px 10px rgba(0, 0, 0, 0.1);
  --shadow-card: 0 12px 32px rgba(0, 0, 0, 0.3), 0 2px 6px rgba(0, 0, 0, 0.2);
  --shadow-hover: 0 20px 48px rgba(0, 0, 0, 0.4), 0 4px 12px rgba(0, 0, 0, 0.2);
  --shadow-btn: 0 6px 18px rgba(255, 255, 255, 0.1);
  --radius-card: 24px;
  --radius-input: 16px;
  --radius-btn: 999px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
}

#sc-root * {
  box-sizing: border-box;
}

/* ── Wrap ── */
#sc-root .wrap {
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
  padding: clamp(24px, 4vw, 52px) clamp(16px, 3vw, 32px) 24px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}

@media (max-width: 600px) {
  #sc-root .wrap {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 8px !important;
    padding-right: 8px !important;
    padding-top: 24px !important;
    display: block !important;
  }
}

/* ── H1 ── */
#sc-root h1 {
  font-size: clamp(24px, 3.5vw, 34px);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.15;
  margin: 0 0 16px;
}

/* ── TopBar ── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.topbar .res-toolbar {
  margin: 0;
}

@media (max-width: 600px) {
  .topbar {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ── Card ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  transition: box-shadow .3s var(--ease), transform .3s var(--ease);
}

.card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

/* ── Hero / Start Panel ── */
.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  padding: 40px 44px;
}

.hero h2 {
  font-size: clamp(18px, 3vw, 24px);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0 0 8px;
}

.hero p {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-2);
  line-height: 1.5;
  margin: 0;
}

@media (max-width: 600px) {
  .hero {
    flex-direction: column;
    align-items: flex-start;
    padding: 28px 24px;
  }

  .hero .btn {
    width: 100%;
  }
}

/* ── Section Legend ── */
.legend {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
  margin: 0;
}

/* ── Fieldset ── */
.fieldset {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.01);
  overflow: hidden;
}

/* ── Form Row ── */
.row {
  display: grid;
  grid-template-columns: 200px 1fr 220px;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  transition: background .18s var(--ease);
}

.row:hover {
  background: rgba(255, 255, 255, .018);
}

.row+.row {
  border-top: 1px solid var(--border);
}

@media (max-width: 820px) {
  .row {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 14px 12px;
  }
}

/* ── Labels ── */
label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: 0;
  line-height: 1.4;
}

/* ── Inputs & Selects (Evoxlife sizing: 56px) ── */
input[type=text],
input[type=number],
select {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  outline: none;
  transition: all .18s ease;
  -webkit-appearance: none;
  appearance: none;
}

input:focus,
select:focus {
  border-color: var(--blue-ring);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.1);
}

input[disabled],
select[disabled] {
  opacity: .5;
  cursor: not-allowed;
  background: transparent;
}

select option {
  background-color: #050a30;
  color: #ffffff;
}

input[type=range] {
  -webkit-appearance: auto;
  appearance: auto;
  height: auto;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none !important;
}

/* ── Help Text ── */
.help {
  font-size: 12px;
  color: var(--text-2);
  text-align: right;
  line-height: 1.5;
  font-weight: 400;
}

@media (max-width: 820px) {
  .help {
    text-align: left;
  }
}

/* ── Toggle Switch ── */
.toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle .slider {
  width: 50px;
  height: 28px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  position: relative;
  transition: background .22s var(--ease);
  flex-shrink: 0;
}

.toggle .slider::after {
  content: "";
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  position: absolute;
  top: 4px;
  left: 4px;
  transition: transform .22s cubic-bezier(.2, .7, .2, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .4);
}

.toggle input:checked+.slider {
  background: var(--green);
}

.toggle input:checked+.slider::after {
  transform: translateX(22px);
}

/* ── Buttons (Evoxlife layout, Porto current colors) ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  border-radius: 2.5rem;
  transition: all .25s ease;
  padding: 0.5rem 1.4rem;
  position: relative;
  overflow: hidden;
  z-index: 1;
  text-decoration: none;
  white-space: nowrap;
  background: linear-gradient(135deg, #ffffff, #f1f5f9);
  color: #050a30;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: var(--shadow-btn);
}

.btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #f1f5f9, #ffffff);
  transition: opacity 0.5s ease;
  border-radius: 2.5rem;
  z-index: -1;
  opacity: 0;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 26px rgba(255, 255, 255, 0.15);
}

.btn:hover::before {
  opacity: 1;
}

.btn:active {
  transform: scale(.98);
}

/* Ghost Buttons (Evox outline style mapped to white) */
.btn.ghost {
  background: transparent;
  color: #ffffff;
  border: 2px solid #ffffff;
  box-shadow: none;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.btn.ghost::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 100%;
  background-color: #ffffff;
  transition: all .3s ease;
  border-radius: var(--radius-btn);
  z-index: -1;
}

.btn.ghost:hover {
  color: #050a30;
  transform: translateY(-2px);
  box-shadow: var(--shadow-btn);
}

.btn.ghost:hover::before {
  width: 100%;
}

.btn.ghost:active {
  transform: scale(.98);
}

/* ── Toolbar & Actions Row ── */
.res-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
  margin: 0;
}

.row.actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 20px;
  flex-wrap: wrap;
  background: transparent !important;
  border-top: 1px solid var(--border);
}

@media (max-width: 600px) {
  .row.actions {
    flex-direction: column;
  }

  .row.actions .btn,
  .res-toolbar .btn {
    width: 100%;
  }
}

/* ── Result Block ── */
.res-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
  padding: 16px 20px 0;
  flex-wrap: wrap;
}

.res-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.res-title .twrap {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.res-title .t1 {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: .12em;
}

.res-title .t2 {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}

#sc-root img.logo {
  height: 42px !important;
  max-width: 120px !important;
  width: auto !important;
  object-fit: contain;
  display: block;
  opacity: .9;
  margin-left: auto;
}

.muted {
  font-size: 12px;
  color: var(--text-2);
  font-weight: 400;
  padding: 0 20px 8px;
}

/* ── Ribbon (Results table) ── */
.ribbon {
  margin: 0 16px 12px;
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.01);
}

.r-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 16px;
  transition: background .2s var(--ease);
}

.r-row:hover {
  background: rgba(255, 255, 255, 0.03);
}

.r-row+.r-row {
  border-top: 1px solid var(--border);
}

.r-row .lbl {
  font-size: 12px;
  color: var(--text-2);
  font-weight: 400;
}

.r-row .val {
  font-size: clamp(14px, 3vw, 18px);
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.02em;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.r-row.emph {
  background: rgba(255, 255, 255, 0.03);
}

.r-row.emph .val {
  color: #ffffff;
}

.r-row.ok {
  background: rgba(16, 185, 129, 0.08);
}

.r-row.ok .val {
  color: var(--green);
  font-size: clamp(16px, 3.5vw, 22px);
  font-weight: 700;
}

/* ── Duo / Mini Cards ── */
.duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 0 16px 16px;
}

.duo .mini {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  transition: box-shadow .25s var(--ease), transform .25s var(--ease);
}

.duo .mini:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, .1);
  transform: translateY(-1px);
}

.mini .lbl {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 6px;
}

.mini .val {
  font-size: clamp(12px, 2vw, 14px);
  font-weight: 600;
  color: var(--text);
  text-align: left;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

@media (max-width: 600px) {
  .duo {
    grid-template-columns: 1fr;
  }
}

/* ── Hidden & Helpers ── */
.hidden {
  display: none !important;
}

/* ═══════════════════════════════════════════════════════════
   WIZARD STYLES (Evoxlife Matched)
   ═══════════════════════════════════════════════════════════ */

.step-block {
  padding: 24px;
  margin-bottom: 0;
}

.step-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 20px;
  padding: 0 8px;
}

.step-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-2);
  flex-shrink: 0;
  transition: background .3s, color .3s, transform .3s;
  position: relative;
  z-index: 1;
}

.step-dot.active {
  background: #ffffff;
  color: #050a30;
  transform: scale(1.1);
  box-shadow: 0 4px 14px rgba(255, 255, 255, 0.3);
}

.step-dot.done {
  background: #ffffff;
  color: #050a30;
  transform: scale(1.0);
  box-shadow: none;
  opacity: .8;
}

.step-line {
  flex: 1;
  height: 2px;
  background: rgba(255, 255, 255, 0.08);
  /* Evox e9ecef -> dark border */
  max-width: 100px;
  transition: background .3s;
}

.step-header {
  margin-bottom: 28px;
  text-align: center;
}

.step-label {
  font-size: 11px;
  font-weight: 600;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: .1em;
  display: block;
  margin-bottom: 8px;
}

.step-title {
  font-size: clamp(18px, 3vw, 22px);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.2;
  margin: 0;
}

/* ── Type Cards (Step 1) Evoxlife style mapped to dark ── */
.type-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 28px;
}

.type-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px 16px;
  border: 2px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.015);
  cursor: pointer;
  font-family: inherit;
  text-align: center;
  transition: all .22s var(--ease);
  position: relative;
  overflow: hidden;
}

.type-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .02));
  opacity: 0;
  transition: opacity .22s;
  border-radius: 16px;
}

.type-card:hover {
  border-color: #ffffff;
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(255, 255, 255, .1);
}

.type-card:hover::before {
  opacity: 1;
}

.type-card.selected {
  border-color: #ffffff;
  background: rgba(255, 255, 255, 0.05);
  /* Evox eff9ff -> dark */
  box-shadow: 0 0 0 4px rgba(255, 255, 255, .1);
  transform: translateY(-2px);
}

.type-card.selected::before {
  opacity: 1;
}

.type-icon {
  font-size: 36px;
  line-height: 1;
  display: block;
  color: var(--text);
}

.type-card.selected .type-icon {
  color: #ffffff;
}

.type-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  display: block;
}

.type-desc {
  font-size: 11px;
  color: var(--text-2);
  font-weight: 400;
  display: block;
}

/* ── Step Actions (nav buttons row) ── */
.step-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 28px;
  flex-wrap: wrap;
  border-top: 1px solid var(--border);
  padding-top: 24px;
}

/* ── Mobile Fixes (Evoxlife matching) ── */
@media (max-width: 600px) {
  .type-cards {
    grid-template-columns: 1fr;
  }

  .step-actions {
    flex-direction: column-reverse;
    /* Usually back button at bottom on mobile */
  }

  .step-actions .btn {
    width: 100%;
  }

  .step-block {
    padding: 20px 8px;
    width: 100% !important;
    border-radius: 12px !important;
  }
}

@media (max-width: 480px) {
  .card:hover {
    transform: none;
  }

  .ribbon {
    margin: 0 12px 16px;
  }

  .duo {
    padding: 4px 12px 20px;
  }

  .muted {
    padding: 0 16px 12px;
  }

  .res-head {
    padding: 20px 16px 0;
  }

  .step-progress {
    gap: 0;
  }

  .step-dot {
    width: 30px;
    height: 30px;
    font-size: 12px;
  }

  .step-line {
    max-width: 40px;
  }
}