/* ── Box model & base ── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    scroll-behavior: smooth;
    tab-size: 4;
}

body {
    min-height: 100dvh;
    line-height: 1.5;
}


/* ── Tipografia ── */
h1, h2, h3, h4, h5, h6 {
    font-size: inherit;
    font-weight: inherit;
    text-wrap: balance;
}

p, li, figcaption, blockquote {
    text-wrap: pretty;
}

a {
    color: inherit;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

b, strong {
    font-weight: 700;
}

small {
    font-size: 80%;
}

sub, sup {
    font-size: 75%;
    line-height: 0;
    position: relative;
    vertical-align: baseline;
}

sub { bottom: -0.25em; }
sup { top: -0.5em; }

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


/* ── Listas ── */
ol, ul, menu {
    list-style: none;
}


/* ── Media ── */
img, picture, video, canvas, svg {
    display: block;
    max-width: 100%;
    height: auto;
}

img {
    border-style: none;
    font-style: italic;           /* alt text styling */
    vertical-align: middle;
}

svg {
    overflow: visible;
}

iframe {
    border: 0;
}


/* ── Tabelas ── */
table {
    border-collapse: collapse;
    border-spacing: 0;
    text-indent: 0;
}

th {
    text-align: left;
    font-weight: inherit;
}


/* ── Forms — reset completo ── */
button,
input,
select,
textarea,
optgroup {
    font: inherit;
    color: inherit;
    letter-spacing: inherit;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    outline: none;
}

button,
[type="button"],
[type="reset"],
[type="submit"] {
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

button:disabled,
[type="button"]:disabled,
[type="reset"]:disabled,
[type="submit"]:disabled {
    cursor: not-allowed;
}

input,
textarea {
    -webkit-appearance: none;
    appearance: none;
    border-radius: 0;
}

textarea {
    resize: vertical;
    overflow: auto;
}

select {
    -webkit-appearance: none;
    appearance: none;
    border-radius: 0;
}

[type="search"] {
    -webkit-appearance: textfield;
    outline-offset: -2px;
}

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

[type="number"]::-webkit-inner-spin-button,
[type="number"]::-webkit-outer-spin-button {
    height: auto;
}

::-webkit-file-upload-button {
    -webkit-appearance: button;
    font: inherit;
}

::placeholder {
    color: inherit;
    opacity: 0.5;
}

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

legend {
    padding: 0;
    display: table;
    max-width: 100%;
    white-space: normal;
}

progress {
    vertical-align: baseline;
}

[hidden] {
    display: none !important;
}

/* Remove autofill background amarelo no Chrome */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
select:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 1000px transparent inset;
    transition: background-color 5000s ease-in-out 0s;
}


/* ── iOS / Safari quirks ── */

/* Remove o zoom forçado em inputs no iPhone (fonte < 16px) */
@supports (-webkit-touch-callout: none) {
    input, select, textarea {
        font-size: 16px;
    }
}

/* Remove o delay de 300ms no tap */
a, button, input, select, textarea,
[role="button"] {
    touch-action: manipulation;
}

/* Remove o highlight azul/cinza do tap no iOS */
* {
    -webkit-tap-highlight-color: transparent;
}

/* Previne que Safari faça auto-zoom em landscape */
@media screen and (orientation: landscape) {
    html {
        -webkit-text-size-adjust: 100%;
    }
}

/* Safe area pra iPhone com notch */
body {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

/* Previne overflow horizontal no mobile */
html, body {
    overflow-x: hidden;
}

/* Scroll suave no iOS */
* {
    -webkit-overflow-scrolling: touch;
}


/* ── Focus & acessibilidade ── */

/* Remove outline padrão, aplica só via teclado */
:focus {
    outline: none;
}

:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* Respeita preferência de redução de animação */
@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;
    }
}


/* ── Print básico ── */
@media print {
    * {
        background: transparent !important;
        color: #000 !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }

    a, a:visited { text-decoration: underline; }
    a[href]::after { content: " (" attr(href) ")"; }

    img { page-break-inside: avoid; }
    p, h2, h3 { orphans: 3; widows: 3; }
    h2, h3 { page-break-after: avoid; }
}
