/* =============================================================================
   Maestro Workflow · CSS Reset / Normalize
   -----------------------------------------------------------------------------
   Conservative reset focado em:
   - box-sizing border-box em tudo
   - margens / paddings zerados nos containers principais
   - typography baseline (Inter)
   - scrollbar refinada
   - focus ring acessível
   - prefers-reduced-motion

   Notas:
   - NÃO removemos list-style de ul/ol globalmente (algumas páginas Account
     dependem de bullets). Se quiser remover, use a classe .list-clean.
   - NÃO mexemos em h1..h6 globalmente (cada página define seus tamanhos);
     apenas garantimos família + line-height tight.
   ============================================================================= */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    scroll-behavior: smooth;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-family: var(--font-family-sans);
    font-size: var(--fs-base);
    font-weight: var(--font-weight-regular);
    line-height: var(--line-height-normal);
    color: var(--text-primary);
    background: var(--page-bg);
    background-image: var(--page-bg-image);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
    margin: 0;
    font-family: var(--font-family-display);
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-tight);
    letter-spacing: -0.01em;
    color: var(--text-primary);
}

p {
    margin: 0;
}

a {
    color: var(--text-link);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--text-link-hover);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

img,
svg,
video,
canvas {
    display: block;
    max-width: 100%;
}

/* Listas: mantemos comportamento padrão; classe .list-clean remove bullets/margins */
.list-clean {
    list-style: none;
    padding: 0;
    margin: 0;
}

button,
input,
select,
textarea {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    color: inherit;
    margin: 0;
}

button {
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
}

button:disabled {
    cursor: not-allowed;
}

/* Remove default appearance dos inputs nativos pra darmos estilo próprio */
input,
textarea,
select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Mantém aparência nativa só para checkbox/radio “normais”.
   .form-switch-input é trilho custom (components.css) — não pode voltar a appearance:auto. */
input[type="checkbox"]:not(.form-switch-input),
input[type="radio"] {
    -webkit-appearance: auto;
    -moz-appearance: auto;
    appearance: auto;
}

textarea {
    resize: vertical;
}

/* Auto-fill mais discreto (sem aquele amarelo padrão do Chrome) */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px var(--bg-surface) inset !important;
    -webkit-text-fill-color: var(--text-primary) !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* Number input: sem spinner por padrão */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
}

input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration {
    -webkit-appearance: none;
}

fieldset {
    border: none;
    padding: 0;
    margin: 0;
    min-width: 0;
}

legend {
    padding: 0;
}

hr {
    border: none;
    border-top: 1px solid var(--border-color-light);
    margin: var(--space-4) 0;
}

table {
    border-collapse: collapse;
    border-spacing: 0;
}

abbr[title] {
    text-decoration: underline dotted;
    cursor: help;
}

address {
    font-style: normal;
}

::selection {
    background-color: var(--color-primary-100);
    color: var(--color-primary-900);
}

:root[data-mw-theme="dark"] ::selection {
    background-color: rgba(37, 99, 235, 0.40);
    color: #f1f5f9;
}

/* Scrollbar refinada */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--border-color-strong) transparent;
}

*::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

*::-webkit-scrollbar-track {
    background: transparent;
}

*::-webkit-scrollbar-thumb {
    background: var(--border-color-strong);
    border-radius: var(--radius-full);
    border: 2px solid transparent;
    background-clip: padding-box;
}

*::-webkit-scrollbar-thumb:hover {
    background: var(--slate-500);
    background-clip: padding-box;
    border: 2px solid transparent;
}

/* Focus visible padrão (acessível). Componentes podem sobrescrever
   com box-shadow custom (.btn:focus-visible etc.) */
:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* Remove outline em quem prefere usar box-shadow custom */
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: none;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
