/*
 * MX Design System — componentes (F2).
 * Requer: assets/fonts/fonts.css + tokens/tokens.css. Usa só tokens (camada 3: --btn-*, --badge-*, --card-*, --input-*...).
 * Tema escuro: envolver em [data-theme="dark"]. Prefixo de classe: mx-.
 */

/* ---------- Base e tipografia web ---------- */
.mx { font-family: var(--font-base); color: var(--color-text); background: var(--color-bg); -webkit-font-smoothing: antialiased; }
.mx-container { max-width: var(--layout-web-max); margin-inline: auto; padding-inline: var(--layout-web-margin); }

.mx-display, .mx-h1, .mx-h2, .mx-h3, .mx-h4 { margin: 0; color: var(--color-text); }
.mx-display { font-size: var(--type-web-display-size); line-height: var(--type-web-display-line); font-weight: var(--type-display-weight); letter-spacing: var(--type-display-tracking); }
.mx-h1 { font-size: var(--type-web-h1-size); line-height: var(--type-web-h1-line); font-weight: var(--type-h1-weight); letter-spacing: var(--type-h1-tracking); }
.mx-h2 { font-size: var(--type-web-h2-size); line-height: var(--type-web-h2-line); font-weight: var(--type-h2-weight); letter-spacing: var(--type-h2-tracking); }
.mx-h3 { font-size: var(--type-web-h3-size); line-height: var(--type-web-h3-line); font-weight: var(--type-h3-weight); letter-spacing: var(--type-h3-tracking); }
.mx-h4 { font-size: var(--type-web-h4-size); line-height: var(--type-web-h4-line); font-weight: var(--type-h4-weight); }
.mx-body { font-size: var(--type-web-body-size); line-height: var(--type-web-body-line); margin: 0; }
.mx-small { font-size: var(--type-web-small-size); line-height: var(--type-web-small-line); margin: 0; }
.mx-caption { font-size: var(--type-web-caption-size); line-height: var(--type-web-caption-line); letter-spacing: var(--type-caption-tracking); margin: 0; }
.mx-overline { font-size: var(--type-web-overline-size); line-height: var(--type-web-overline-line); font-weight: var(--type-overline-weight);
  letter-spacing: var(--type-overline-tracking); text-transform: var(--type-overline-case); color: var(--color-brand); margin: 0; }
.mx-muted { color: var(--color-text-muted); }

@media (max-width: 767px) {
  .mx-container { padding-inline: var(--layout-web-margin-mobile); }
  .mx-display { font-size: var(--type-web-h1-size); line-height: var(--type-web-h1-line); }
  .mx-h1 { font-size: var(--type-web-h2-size); line-height: var(--type-web-h2-line); }
}

/* ---------- Ícone inline (SVG Lucide/Tabler com currentColor) ---------- */
.mx-icon { width: 1.25em; height: 1.25em; flex: none; stroke: currentColor; }

/* ---------- Botão ---------- */
.mx-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: var(--btn-min-height); padding: var(--btn-pad-y) var(--btn-pad-x);
  border: 2px solid transparent; border-radius: var(--btn-radius);
  font: inherit; font-size: var(--type-web-body-size); line-height: 1.2; font-weight: var(--btn-font-weight);
  text-decoration: none; cursor: pointer; transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  background: var(--btn-primary-bg); color: var(--btn-primary-fg);
}
.mx-btn:hover { background: var(--btn-primary-bg-hover); }
.mx-btn:focus-visible { outline: 3px solid var(--btn-focus-ring); outline-offset: 2px; }
.mx-btn--secondary { background: transparent; color: var(--btn-secondary-fg); border-color: var(--btn-secondary-border); }
.mx-btn--secondary:hover { background: var(--btn-secondary-bg-hover); }
.mx-btn--accent { background: var(--btn-accent-bg); color: var(--btn-accent-fg); }
.mx-btn--accent:hover { background: var(--btn-accent-bg); filter: brightness(1.06); }
.mx-btn--ghost { background: transparent; color: var(--btn-ghost-fg); }
.mx-btn--ghost:hover { background: var(--btn-ghost-bg-hover); }
.mx-btn--sm { min-height: var(--space-7); padding: var(--btn-pad-y-sm) var(--btn-pad-x-sm); font-size: var(--type-web-small-size); }
.mx-btn--lg { padding: var(--btn-pad-y-lg) var(--btn-pad-x-lg); font-size: var(--type-web-h4-size); }
.mx-btn--block { display: flex; width: 100%; }
.mx-btn:disabled, .mx-btn[aria-disabled="true"] { background: var(--btn-disabled-bg); color: var(--btn-disabled-fg); border-color: transparent; cursor: not-allowed; filter: none; }

/* Botão flutuante (ex.: WhatsApp) */
.mx-fab {
  display: inline-grid; place-items: center; width: var(--space-9); height: var(--space-9); border-radius: 50%;
  background: var(--btn-accent-bg); color: var(--btn-accent-fg); box-shadow: var(--shadow-lg); border: none;
}
.mx-fab .mx-icon { width: var(--space-6); height: var(--space-6); }

/* ---------- Link ---------- */
.mx-link { color: var(--link-fg); font-weight: var(--link-font-weight); text-decoration: underline; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
.mx-link:hover { color: var(--link-fg-hover); text-decoration-thickness: 2px; }
.mx-link:focus-visible { outline: 3px solid var(--btn-focus-ring); outline-offset: 2px; border-radius: var(--radius-sm); }
.mx-link--arrow { display: inline-flex; align-items: center; gap: var(--space-1); text-decoration: none; }
.mx-link--arrow:hover { text-decoration: underline; }

/* ---------- Badge / tag ---------- */
.mx-badge {
  display: inline-flex; align-items: center; gap: var(--space-1); padding: var(--badge-pad-y) var(--badge-pad-x);
  border-radius: var(--badge-radius); font-size: var(--type-web-caption-size); line-height: var(--type-web-caption-line);
  font-weight: var(--badge-font-weight); letter-spacing: var(--type-caption-tracking); white-space: nowrap;
  background: var(--badge-neutral-bg); color: var(--badge-neutral-fg);
}
.mx-badge--brand { background: var(--badge-brand-bg); color: var(--badge-brand-fg); }
.mx-badge--accent { background: var(--badge-accent-bg); color: var(--badge-accent-fg); }
.mx-badge--success { background: var(--badge-success-bg); color: var(--badge-success-fg); }
.mx-badge--danger { background: var(--badge-danger-bg); color: var(--badge-danger-fg); }
.mx-badge--outline { background: transparent; box-shadow: inset 0 0 0 1px var(--color-border-strong); color: var(--color-text-muted); }

/* ---------- Card ---------- */
.mx-card {
  display: flex; flex-direction: column; gap: var(--card-gap); padding: var(--card-pad);
  background: var(--card-bg); border: 1px solid var(--card-border); border-radius: var(--card-radius);
  box-shadow: var(--card-shadow); color: var(--color-text);
}
.mx-card--interactive { transition: box-shadow 0.2s ease, transform 0.2s ease; }
.mx-card--interactive:hover { box-shadow: var(--card-shadow-hover); transform: translateY(calc(var(--space-1) * -1)); }
.mx-card__icon { display: grid; place-items: center; width: var(--card-icon-size); height: var(--card-icon-size);
  border-radius: var(--radius-md); background: var(--card-icon-bg); color: var(--card-icon-fg); }
.mx-card__icon .mx-icon { width: var(--space-6); height: var(--space-6); stroke-width: 1.75; }
.mx-card__title { margin: 0; font-size: var(--type-web-h4-size); line-height: var(--type-web-h4-line); font-weight: var(--type-h4-weight); }
.mx-card__text { margin: 0; font-size: var(--type-web-small-size); line-height: var(--type-web-small-line); color: var(--color-text-muted); }
.mx-card__footer { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.mx-card__media { margin: calc(var(--card-pad) * -1) calc(var(--card-pad) * -1) 0; aspect-ratio: 16 / 9; background: var(--card-media-bg);
  border-radius: var(--card-radius) var(--card-radius) 0 0; overflow: hidden; display: grid; place-items: center; color: var(--color-text-subtle); }
.mx-card__media img { width: 100%; height: 100%; object-fit: cover; }

.mx-card__logo { height: var(--space-8); display: flex; align-items: center; color: var(--color-text-subtle); }
.mx-card__logo img { max-height: 100%; width: auto; }

.mx-case__rows { display: grid; gap: var(--space-3); margin: 0; }
.mx-case__rows dt { font-size: var(--type-web-overline-size); line-height: var(--type-web-overline-line); font-weight: var(--type-overline-weight);
  letter-spacing: var(--type-overline-tracking); text-transform: var(--type-overline-case); color: var(--color-text-subtle); }
.mx-case__rows dd { margin: 0; font-size: var(--type-web-small-size); line-height: var(--type-web-small-line); }
.mx-metric { display: flex; align-items: baseline; gap: var(--space-2); }
.mx-metric__value { font-size: var(--type-web-h2-size); line-height: var(--type-web-h2-line); font-weight: var(--font-weight-extrabold); color: var(--color-brand); }
[data-theme="dark"] .mx-metric__value, .theme-dark .mx-metric__value { color: var(--color-accent-text); }

/* ---------- Depoimento ---------- */
.mx-quote { position: relative; }
.mx-quote__mark { color: var(--color-brand-soft); width: var(--space-7); height: var(--space-7); }
.mx-quote__text { margin: 0; font-size: var(--type-web-h4-size); line-height: var(--type-web-h4-line); font-weight: var(--font-weight-medium); }
.mx-quote__author { display: flex; align-items: center; gap: var(--space-3); }
.mx-avatar { width: var(--space-9); height: var(--space-9); border-radius: 50%; background: var(--card-media-bg); display: grid; place-items: center;
  color: var(--color-text-subtle); flex: none; overflow: hidden; }
.mx-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Formulário ---------- */
.mx-form { display: grid; gap: var(--space-5); }
.mx-form__row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-5); }
.mx-field { display: grid; gap: var(--space-2); }
.mx-label { font-size: var(--type-web-small-size); line-height: var(--type-web-small-line); font-weight: var(--font-weight-semibold); color: var(--input-label); }
.mx-label .mx-req { color: var(--input-error); }
.mx-input, .mx-select, .mx-textarea {
  width: 100%; min-height: var(--input-min-height); padding: var(--input-pad-y) var(--input-pad-x);
  font: inherit; font-size: var(--type-web-body-size); color: var(--input-fg); background: var(--input-bg);
  border: 1px solid var(--input-border); border-radius: var(--input-radius); box-sizing: border-box;
}
.mx-textarea { min-height: calc(var(--input-min-height) * 2.5); resize: vertical; }
.mx-input::placeholder, .mx-textarea::placeholder { color: var(--input-placeholder); opacity: 1; }
.mx-input:focus, .mx-select:focus, .mx-textarea:focus { outline: 3px solid var(--input-border-focus); outline-offset: 0; border-color: var(--input-border-focus); }
.mx-help { font-size: var(--type-web-caption-size); line-height: var(--type-web-caption-line); color: var(--input-help); margin: 0; }
.mx-field--error .mx-input, .mx-field--error .mx-select, .mx-field--error .mx-textarea { border-color: var(--input-error); border-width: 2px; }
.mx-field--error .mx-help { color: var(--input-error); font-weight: var(--font-weight-semibold); }
.mx-check { display: flex; gap: var(--space-3); align-items: flex-start; font-size: var(--type-web-small-size); line-height: var(--type-web-small-line); color: var(--color-text-muted); }
.mx-check input { width: var(--space-5); height: var(--space-5); margin: 0; accent-color: var(--color-action); flex: none; }
@media (max-width: 767px) { .mx-form__row { grid-template-columns: 1fr; } }

/* ---------- Header ---------- */
.mx-header { background: var(--header-bg); border-bottom: 1px solid var(--header-border); }
.mx-header__inner { display: flex; align-items: center; justify-content: space-between; gap: var(--space-6); height: var(--header-height); }
.mx-header__logo img { height: var(--header-logo-height); width: auto; display: block; }
.mx-header__nav { display: flex; gap: var(--space-6); list-style: none; margin: 0; padding: 0; }
.mx-header__nav a { color: var(--color-text); text-decoration: none; font-size: var(--type-web-small-size); font-weight: var(--font-weight-semibold); }
.mx-header__nav a:hover, .mx-header__nav a[aria-current="page"] { color: var(--color-brand); }
.mx-header__actions { display: flex; align-items: center; gap: var(--space-3); }
.mx-header__menu { display: none; }
@media (max-width: 767px) {
  .mx-header__inner { height: var(--header-height-mobile); }
  .mx-header__logo img { height: var(--header-logo-height-mobile); }
  .mx-header__nav, .mx-header__actions .mx-btn:not(.mx-header__menu) { display: none; }
  .mx-header__menu { display: inline-flex; }
}

/* ---------- Footer (usar dentro de [data-theme="dark"]) ---------- */
.mx-footer { background: var(--color-bg); color: var(--color-text-muted); padding-block: var(--footer-pad-y) var(--space-6); }
.mx-footer__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: var(--space-7); }
.mx-footer__logo img { height: var(--footer-logo-height); width: auto; display: block; }
.mx-footer__title { margin: 0 0 var(--space-3); font-size: var(--type-web-overline-size); line-height: var(--type-web-overline-line); font-weight: var(--type-overline-weight);
  letter-spacing: var(--type-overline-tracking); text-transform: var(--type-overline-case); color: var(--color-text); }
.mx-footer__list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); font-size: var(--type-web-small-size); line-height: var(--type-web-small-line); }
.mx-footer__list a { color: var(--color-text-muted); text-decoration: none; }
.mx-footer__list a:hover { color: var(--color-link); text-decoration: underline; }
.mx-footer__social { display: flex; gap: var(--space-2); }
.mx-footer__social a { display: grid; place-items: center; width: var(--btn-min-height); height: var(--btn-min-height); border-radius: var(--radius-md);
  color: var(--color-text); background: var(--color-surface-raised); }
.mx-footer__social a:hover { background: var(--color-accent); color: var(--color-on-accent); }
.mx-footer__bottom { margin-top: var(--space-8); padding-top: var(--space-5); border-top: 1px solid var(--color-border); display: flex; justify-content: space-between;
  gap: var(--space-4); font-size: var(--type-web-caption-size); line-height: var(--type-web-caption-line); color: var(--color-text-subtle); }
@media (max-width: 767px) { .mx-footer__grid { grid-template-columns: 1fr 1fr; } .mx-footer__bottom { flex-direction: column; } }

/* ---------- Selo de realização ---------- */
/* Largura livre via --selo-largura, nunca abaixo do mínimo; respiro = 1x do logo (≈ altura do selo horizontal ÷ 3). */
.mx-selo { display: inline-block; }
.mx-selo img { display: block; height: auto; }
.mx-selo--horizontal img { width: max(var(--selo-largura, var(--selo-min-width-horizontal)), var(--selo-min-width-horizontal)); }
.mx-selo--vertical img { width: max(var(--selo-largura, var(--selo-min-width-vertical)), var(--selo-min-width-vertical)); }
