/* ====================================================================
   CORREÇÕES ADICIONAIS PARA RESPONSIVIDADE E SCROLL - Login
   ====================================================================
   Este arquivo contém correções específicas para garantir que a tela
   de login seja totalmente responsiva e o scroll funcione corretamente
   ==================================================================== */

/* GARANTIR SCROLL FUNCIONAL EM TODAS AS TELAS */
html {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    scroll-behavior: smooth;
}

body {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch;
    min-height: 100vh;
    height: auto;
}

/* Container principal responsivo com scroll */
.relative.z-10 {
    min-height: 100vh;
    height: auto;
    overflow-y: visible;
}

/* CORREÇÕES ESPECÍFICAS POR TAMANHO DE TELA */

/* Smartphones pequenos (< 375px) - iPhone SE, Galaxy Fold */
@media (max-width: 374px) {
    .relative.z-10 {
        padding: 1rem 0.5rem !important;
        align-items: flex-start !important;
    }
    
    #login-form {
        padding: 1rem 0.875rem !important;
        margin: 0 auto !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .logo-container {
        width: 3.5rem !important;
        height: 3.5rem !important;
        margin-bottom: 0.5rem !important;
    }
    
    h2 {
        font-size: 1.25rem !important;
        line-height: 1.5 !important;
    }
    
    p {
        font-size: 0.8rem !important;
    }
    
    /* Compactar inputs */
    input {
        padding: 0.625rem 0.75rem !important;
        padding-left: 2.25rem !important;
        font-size: 14px !important;
    }
    
    /* Compactar botões */
    button, a.group {
        padding: 0.625rem 1rem !important;
        font-size: 14px !important;
    }
    
    /* Reduzir espaçamento */
    .space-y-3 > * + *, 
    .space-y-4 > * + *,
    .space-y-5 > * + * {
        margin-top: 0.625rem !important;
    }
}

/* Smartphones médios (375px - 480px) - iPhone 12/13/14 */
@media (min-width: 375px) and (max-width: 480px) {
    .relative.z-10 {
        padding: 1.5rem 0.75rem !important;
    }
    
    #login-form {
        padding: 1.25rem 1rem !important;
        width: 100% !important;
    }
    
    .logo-container {
        width: 4rem !important;
        height: 4rem !important;
    }
    
    /* Prevenir zoom automático no iOS */
    input, select, textarea {
        font-size: 16px !important;
    }
}

/* Smartphones grandes (481px - 640px) - iPhone Plus, Pixel */
@media (min-width: 481px) and (max-width: 640px) {
    .relative.z-10 {
        padding: 2rem 1rem !important;
    }
    
    #login-form {
        padding: 1.5rem 1.25rem !important;
        max-width: 28rem !important;
    }
}

/* Tablets pequenos (641px - 768px) - iPad Mini */
@media (min-width: 641px) and (max-width: 768px) {
    .relative.z-10 {
        padding: 2.5rem 1.5rem !important;
    }
    
    #login-form {
        max-width: 32rem !important;
    }
}

/* Tablets grandes (769px - 1024px) - iPad */
@media (min-width: 769px) and (max-width: 1024px) {
    .relative.z-10 {
        padding: 3rem 2rem !important;
    }
    
    #login-form {
        max-width: 36rem !important;
    }
}

/* LANDSCAPE MODE - Telas curtas em modo paisagem */
@media (max-height: 500px) and (orientation: landscape) {
    html, body {
        overflow-y: auto !important;
    }
    
    .relative.z-10 {
        padding: 1rem 1.5rem !important;
        align-items: flex-start !important;
        justify-content: center !important;
    }
    
    .logo-container {
        width: 3rem !important;
        height: 3rem !important;
        margin-bottom: 0.375rem !important;
    }
    
    h2 {
        font-size: 1.25rem !important;
        margin-bottom: 0.125rem !important;
    }
    
    p {
        font-size: 0.875rem !important;
        margin-bottom: 0.5rem !important;
    }
    
    #login-form {
        padding: 0.75rem 1rem !important;
        margin-top: 0.5rem !important;
    }
    
    .space-y-3 > * + *,
    .space-y-4 > * + *,
    .space-y-5 > * + * {
        margin-top: 0.5rem !important;
    }
    
    /* Compactar inputs em landscape */
    input {
        padding: 0.5rem 1rem !important;
        padding-left: 2.5rem !important;
    }
    
    button {
        padding: 0.625rem 1rem !important;
    }
    
    /* Ocultar alguns balões em landscape */
    .balloon-3, .balloon-4, .balloon-5, .balloon-6 {
        display: none;
    }
}

/* LANDSCAPE MODE - Smartphones */
@media (max-height: 400px) and (orientation: landscape) {
    .relative.z-10 {
        padding: 0.75rem 1rem !important;
    }
    
    .logo-container {
        width: 2.5rem !important;
        height: 2.5rem !important;
    }
    
    h2 {
        font-size: 1.125rem !important;
    }
    
    /* Ocultar todos os balões em telas muito curtas */
    .balloon, .cloud {
        display: none;
    }
}

/* GARANTIR QUE O SCROLL SEMPRE FUNCIONE */
/* Forçar scroll em qualquer situação */
html, body {
    max-width: 100vw;
    position: relative;
}

body::-webkit-scrollbar {
    width: 0px;
    background: transparent;
}

/* Garantir que o fundo fixo não bloqueie o scroll */
#animated-background {
    position: fixed;
    pointer-events: none;
    z-index: 0;
}

/* Garantir que o conteúdo esteja acima e seja scrollável */
.relative.z-10 {
    position: relative;
    z-index: 10;
    pointer-events: auto;
}

/* MELHORIAS DE ACESSIBILIDADE E UX */

/* Touch targets mínimos de 44x44px (WCAG) */
@media (pointer: coarse) {
    button, 
    a,
    input[type="checkbox"],
    input[type="radio"] {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Aumentar área clicável do toggle de senha */
    #toggle-password {
        padding: 0.75rem !important;
    }
}

/* Melhorias para telas de alta resolução */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    img {
        image-rendering: -webkit-optimize-contrast;
    }
}

/* Garantir que modais sejam scrolláveis */
#forgot-password-modal {
    overflow-y: auto !important;
}

/* AJUSTES FINAIS PARA MÁXIMA COMPATIBILIDADE */

/* Resetar qualquer overflow escondido */
* {
    box-sizing: border-box;
}

/* Container flexível */
.min-h-screen {
    min-height: 100vh;
    min-height: -webkit-fill-available;
}

/* Suporte para iOS Safari */
@supports (-webkit-touch-callout: none) {
    .min-h-screen {
        min-height: -webkit-fill-available;
    }
    
    body {
        position: relative;
        overflow-y: auto !important;
    }
}

/* Prevenir problemas de scroll em iOS */
.relative.z-10 {
    -webkit-overflow-scrolling: touch;
}

/* Garantir que inputs sejam visíveis ao focar (mobile) */
@media (max-width: 640px) {
    input:focus {
        scroll-margin-top: 100px;
    }
}



