/* Mobile-first — complemento ao Tailwind */

:root {
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
    --safe-right: env(safe-area-inset-right, 0px);
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    padding-left: var(--safe-left);
    padding-right: var(--safe-right);
}

/* Evita zoom automático no iOS em inputs */
@media (max-width: 767px) {
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="tel"],
    input[type="url"],
    input[type="search"],
    input[type="date"],
    input[type="time"],
    input[type="datetime-local"],
    select,
    textarea {
        font-size: 16px !important;
    }
}

form input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
form select,
form textarea {
    max-width: 100%;
}

.touch-target {
    min-height: 44px;
    min-width: 44px;
}

@media (max-width: 639px) {
    .table-scroll {
        overflow-x: visible;
    }

    table.responsive-table {
        display: block;
        width: 100%;
    }

    table.responsive-table thead {
        display: none;
    }

    table.responsive-table tbody {
        display: block;
    }

    table.responsive-table tbody tr {
        display: block;
        margin-bottom: 0.75rem;
        border: 1px solid #e2e8f0;
        border-radius: 0.75rem;
        background: #fff;
        box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
        overflow: hidden;
    }

    table.responsive-table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 0.75rem;
        padding: 0.65rem 1rem;
        border: none;
        text-align: right !important;
    }

    table.responsive-table tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: 0.75rem;
        color: #64748b;
        text-align: left;
        flex: 1;
    }

    table.responsive-table tbody td[colspan] {
        display: block;
        text-align: center !important;
    }

    table.responsive-table tbody td[colspan]::before {
        display: none;
    }

    table.responsive-table tbody td.hidden {
        display: none !important;
    }
}

@media (min-width: 640px) {
    .table-scroll {
        -webkit-overflow-scrolling: touch;
    }
}

.page-title {
    font-size: 1.375rem;
    line-height: 1.25;
    font-weight: 700;
}

@media (min-width: 640px) {
    .page-title {
        font-size: 1.5rem;
    }
}

#pwa-install-banner {
    padding-bottom: calc(0.75rem + var(--safe-bottom));
}

@media (max-width: 767px) {
    body.has-pwa-banner main {
        padding-bottom: 5.5rem;
    }
}

@media (max-width: 639px) {
    .modal-panel-mobile {
        margin: 0;
        max-height: 100dvh;
        border-radius: 0;
    }
}

/* Requisitos e erros de validação de senha */
.senha-requisitos,
.senha-requisitos ul,
.senha-requisitos li,
.senha-erros,
.senha-erros li {
    color: #dc2626;
    font-size: 0.75rem;
    line-height: 1.4;
}

.senha-requisitos ul,
.senha-erros {
    margin-top: 0.25rem;
    padding-left: 0;
    list-style: none;
}

.senha-requisitos li + li,
.senha-erros li + li {
    margin-top: 0.125rem;
}
