/* ============================================================================
   MWTECH — componentes
   Implementação em CSS dos primitivos do design system consumidos pela landing
   page: Button, Icon, Card, Tag, Badge, Stat, Step, Input, Select, Textarea.
   Regra do sistema: nenhum hex aqui — só os aliases semânticos de tokens/.
   ========================================================================== */

/* ── Layout base ──────────────────────────────────────────────────────── */

.mw-section {
  padding-block: var(--section-y-compact);
  /* compensa o header sticky de 72px na navegação por âncora */
  scroll-margin-top: var(--header-h);
}

.mw-section--divided { border-top: var(--border-w) solid var(--border-subtle); }

/* Fundos de seção. O sistema admite no máximo dois por página (escuro e
   claro); `--sunken` é o mesmo escuro rebaixado, usado nos projetos.
   `--light` anda sempre junto de data-theme="light" no mesmo elemento. */
.mw-section--light { background: var(--bg-page); }
.mw-section--sunken { background: var(--bg-sunken); }

/* Listas semânticas que não devem parecer listas. */
.mw-list-reset { list-style: none; margin: 0; padding: 0; }

/* ── Icon ─────────────────────────────────────────────────────────────
   Ícones Lucide 0.469.0 embutidos como sprite <symbol> no index.html.
   As propriedades de traço são herdadas pelo conteúdo do <use>, então o
   ícone sempre segue currentColor e nunca aparece em duas cores.          */

.mw-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mw-icon--xs { width: 16px; height: 16px; }
.mw-icon--sm { width: 18px; height: 18px; }
.mw-icon--lg { width: 22px; height: 22px; }
.mw-icon--xl { width: 24px; height: 24px; }

/* Container de ícone: quadrado arredondado em vermelho suave. */
.mw-icon-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border-radius: var(--radius-md);
  background: var(--brand-soft);
  border: var(--border-w) solid var(--border-subtle);
  color: var(--accent);
}

.mw-icon-box--sm { width: 40px; height: 40px; }

/* ── Button ───────────────────────────────────────────────────────────── */

.mw-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: 44px;
  padding-inline: var(--space-5);
  border: var(--border-w) solid transparent;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: var(--text-body-sm);
  font-weight: var(--fw-medium);
  letter-spacing: var(--track-button);
  white-space: nowrap;
  cursor: pointer;
  transition:
    background-color var(--dur-fast) var(--ease-standard),
    border-color var(--dur-fast) var(--ease-standard),
    color var(--dur-fast) var(--ease-standard),
    box-shadow var(--dur-fast) var(--ease-standard),
    transform var(--dur-instant) var(--ease-standard);
}

.mw-btn--sm { height: 36px; padding-inline: var(--space-4); border-radius: var(--radius-sm); }
.mw-btn--lg { height: 52px; padding-inline: var(--space-6); font-size: var(--text-body-md); }

.mw-btn--primary {
  background: var(--brand);
  color: var(--text-on-brand);
  box-shadow: var(--shadow-brand);
}
.mw-btn--primary:hover { background: var(--brand-hover); color: var(--text-on-brand); }
.mw-btn--primary:active { background: var(--brand-press); transform: scale(var(--press-scale)); }

.mw-btn--secondary {
  background: transparent;
  color: var(--text-strong);
  border-color: var(--border-default);
}
.mw-btn--secondary:hover {
  background: color-mix(in srgb, var(--text-strong) 7%, transparent);
  border-color: var(--border-strong);
  color: var(--text-strong);
}
.mw-btn--secondary:active { transform: scale(var(--press-scale)); }

.mw-btn--ghost { background: transparent; color: var(--text-body); }
.mw-btn--ghost:hover {
  background: color-mix(in srgb, var(--text-strong) 6%, transparent);
  color: var(--text-strong);
}

.mw-btn:disabled,
.mw-btn[aria-disabled="true"] {
  opacity: 0.42;
  pointer-events: none;
  transform: none;
}

/* Ícone final do botão desloca 2px à direita no hover. */
.mw-btn__icon { transition: transform var(--dur-fast) var(--ease-standard); }
.mw-btn:hover .mw-btn__icon { transform: translateX(2px); }

/* ── Card ─────────────────────────────────────────────────────────────── */

.mw-card {
  display: flex;
  flex-direction: column;
  gap: var(--gap-stack);
  background: var(--surface-card);
  border: var(--border-w) solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-7);
  box-shadow: var(--inner-top);
  transition:
    transform var(--dur-base) var(--ease-standard),
    border-color var(--dur-base) var(--ease-standard),
    box-shadow var(--dur-base) var(--ease-standard);
}

.mw-card--interactive:hover {
  transform: var(--lift-hover);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md), var(--inner-top);
}

.mw-card--brand { border-color: var(--border-brand); }

/* Hairline gradiente no topo do painel (Card.topRule). */
.mw-card--rule { position: relative; }
.mw-card--rule::before {
  content: "";
  position: absolute;
  top: 0;
  left: var(--space-6);
  right: var(--space-6);
  height: 1px;
  background: var(--gradient-hairline);
}

/* ── Tag / Chip / Badge ───────────────────────────────────────────────── */

.mw-tag {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: var(--text-mono-label);
  font-weight: var(--fw-medium);
  letter-spacing: var(--track-tag);
  text-transform: uppercase;
  color: var(--text-muted);
  border: var(--border-w) solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: 5px var(--space-3);
}

.mw-tag--filled { background: color-mix(in srgb, var(--text-muted) 6%, transparent); }

.mw-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  height: 24px;
  padding-inline: var(--space-3);
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  border: var(--border-w) solid var(--border-accent);
  color: var(--accent-text);
  font-size: var(--text-caption);
  font-weight: var(--fw-medium);
}

.mw-badge__dot { width: 6px; height: 6px; border-radius: var(--radius-pill); background: currentColor; }

/* ── SectionLabel (sobretítulo mono) ──────────────────────────────────── */

.mw-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--text-mono-label);
  font-weight: var(--fw-medium);
  line-height: 1;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--accent-text);
}

.mw-eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: currentColor;
  opacity: 0.55;
}

/* Variante sem o traço, usada nos títulos de seção. */
.mw-eyebrow--plain { gap: 0; }
.mw-eyebrow--plain::before { content: none; }

.mw-eyebrow--faint { color: var(--text-faint); }

/* ── Stat ─────────────────────────────────────────────────────────────── */

.mw-stat { display: flex; flex-direction: column; gap: 6px; }

.mw-stat__value {
  font-family: var(--font-display);
  font-weight: var(--fw-semibold);
  font-size: var(--text-h2);
  line-height: 1.05;
  letter-spacing: var(--track-display);
  color: var(--text-strong);
}

.mw-stat__unit { font-size: 0.5em; color: var(--accent-text); margin-left: 2px; }

.mw-stat__label { font-size: var(--text-body-sm); color: var(--text-muted); }

/* ── Steps ────────────────────────────────────────────────────────────── */

.mw-step {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding-top: var(--space-5);
  /* a régua de topo é um background de 1px: gradiente da marca nas etapas
     ativas, borda neutra nas demais */
  background-image: linear-gradient(var(--border-subtle), var(--border-subtle));
  background-size: 100% 1px;
  background-repeat: no-repeat;
}

.mw-step--active { background-image: var(--gradient-brand); }

.mw-step__index {
  font-family: var(--font-mono);
  font-size: var(--text-mono-label);
  line-height: 1;
  letter-spacing: var(--track-label);
  color: var(--text-faint);
}

.mw-step--active .mw-step__index { color: var(--accent-text); }

.mw-step__title {
  font-family: var(--font-display);
  font-weight: var(--fw-medium);
  font-size: var(--text-h4);
  line-height: var(--lh-h4);
  color: var(--text-strong);
}

.mw-step__text { font: var(--font-body-text-sm); color: var(--text-muted); }

/* ── Campos de formulário (Input / Select / Textarea) ─────────────────── */

.mw-field { display: flex; flex-direction: column; gap: var(--space-2); }

.mw-field__label {
  font-size: var(--text-body-sm);
  font-weight: var(--fw-medium);
  color: var(--text-body);
}

.mw-field__control {
  width: 100%;
  min-height: 44px;
  padding: var(--space-3) var(--space-4);
  background: var(--surface-inset);
  border: var(--border-w-strong) solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-strong);
  font-family: var(--font-body);
  font-size: var(--text-body-sm);
  line-height: var(--lh-body-sm);
  transition:
    border-color var(--dur-fast) var(--ease-standard),
    box-shadow var(--dur-fast) var(--ease-standard);
}

.mw-field__control::placeholder { color: var(--text-faint); }

.mw-field__control:hover { border-color: var(--border-default); }

.mw-field__control:focus,
.mw-field__control:focus-visible {
  outline: none;
  border-color: var(--border-brand);
  box-shadow: var(--ring-focus);
}

.mw-field__control:disabled { opacity: 0.42; }

/* Só marca em vermelho depois que o campo foi tocado e perdeu o foco. */
.mw-field__control:user-invalid { border-color: var(--status-danger); }

textarea.mw-field__control { min-height: 118px; resize: vertical; }

.mw-field__hint {
  font-size: var(--text-caption);
  line-height: var(--lh-caption);
  color: var(--text-faint);
}

/* Select: a seta nativa é substituída pelo chevron do sistema. */
.mw-select { position: relative; display: flex; }

.mw-select .mw-field__control {
  appearance: none;
  padding-right: var(--space-9);
  cursor: pointer;
}

.mw-select__chevron {
  position: absolute;
  right: var(--space-4);
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--text-muted);
}

/* Placeholder do select fica no tom de texto ausente enquanto nada foi escolhido. */
.mw-select .mw-field__control:invalid { color: var(--text-faint); }
