/* =========================================
   RESET
   ========================================= */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* =========================================
   ANIMAÇÃO DE FUNDO
   ========================================= */
@keyframes bgcolor {
    0% { background: #795e48; }
    12% { background: #bc9754; }
    24% { background: #ded888; }
    36% { background: #eeede7; }
    48% { background: #dcc7ad; }
    60% { background: #ddc6db; }
    72% { background: #545c64; }
    84% { background: #494540; }
    100% { background: #795e48; }
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #795e48;
    animation: bgcolor 20s ease infinite;
    
    /* Centraliza o Cartão na Tela */
    display: flex;
    align-items: center; 
    justify-content: center; 
    
    /* Trava a altura na tela visível */
    height: 100vh; 
    width: 100%;
    
    /* Impede rolagem na página inteira */
    overflow: hidden;
    
    /* Respiro menor para aproveitar mais a tela */
    padding: 15px;
    
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

/* =========================================
   CONTAINER (CARTÃO)
   ========================================= */
.container {
    width: 100%;
    /* MUDANÇA: Travei em 850px. Isso garante que a proporção fique bonita igual no PC */
    max-width: 850px; 
    
    background-color: #ffffff; 
    color: #333333; 
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    
    /* Padding ajustado */
    padding: 25px;
    text-align: center;
    
    height: auto;
    /* AJUSTE: Reduzi para 90vh para garantir margem no topo e em baixo */
    max-height: 90vh; 
    overflow-y: auto;
    
    display: flex;
    flex-direction: column;
    justify-content: center;
    
    /* Centraliza itens horizontalmente */
    align-items: center; 
}

h1 {
    font-size: clamp(20px, 3.5vw, 26px);
    color: #2c3e50;
    margin-bottom: 20px; 
    font-weight: 600;
}

/* =========================================
   INPUTS E BOTÕES DE AÇÃO
   ========================================= */
input[type="text"], 
input[type="tel"], 
textarea {
    width: 100%;
    padding: 12px; 
    margin: 8px 0;
    border-radius: 12px;
    border: 2px solid #eee;
    background-color: #f8f9fa;
    font-size: 18px;
    outline: none;
    -webkit-appearance: none;
}

input:focus, textarea:focus {
    border-color: #27ae60;
    background-color: #fff;
}

textarea { height: 90px; resize: none; }

button.btn {
    background-color: #27ae60;
    color: white;
    font-weight: 600;
    padding: 15px;
    font-size: 20px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    width: 100%;
    max-width: 350px;
    margin-top: 15px; 
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.4);
}

/* =========================================
   GRID SYSTEM (ALINHAMENTO PERFEITO)
   ========================================= */

/* Para as Carinhas (Rating) */
.rating {
    display: grid;
    /* 5 Colunas IDÊNTICAS */
    grid-template-columns: repeat(5, 1fr); 
    gap: 4px; 
    width: 100%;
    margin-bottom: 15px;
    align-items: center;
    justify-items: center;
}

.btn-img {
    border: none;
    background: transparent;
    cursor: pointer;
    width: 100%; 
    padding: 0;
    
    /* Garante quadrado perfeito */
    aspect-ratio: 1 / 1; 
    
    display: flex;
    align-items: center;
    justify-content: center;
    
    /* Garante que o zoom não invada o vizinho */
    overflow: visible; 
}

.btn-img img {
    width: 100%;
    height: 100%;
    
    /* Ocupa 100% da célula */
    object-fit: contain;
    border-radius: 50%;
    filter: drop-shadow(0px 4px 8px rgba(0,0,0,0.1));
    transition: transform 0.2s;
    
    /* --- O TRUQUE DO ZOOM --- */
    /* Aumenta a imagem em 40% para "comer" a borda transparente */
    transform: scale(1.4); 
}

/* Efeito ao clicar (diminui um pouco o zoom) */
.btn-img:active img { transform: scale(1.3); }

/* Para o NPS (0 a 10) */
.nps-container {
    display: flex;
    flex-wrap: nowrap; /* Linha única obrigatória */
    justify-content: center; 
    gap: 4px; 
    margin-top: 15px;
    width: 100%;
}

.btn-nps {
    flex: 1; 
    min-width: 30px; 
    max-width: none; 
    height: 55px;
    
    border: none;
    border-radius: 12px;
    font-size: 20px;
    font-weight: bold;
    color: white;
    cursor: pointer;
    
    display: flex;
    align-items: center;
    justify-content: center;
    
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.1s;
    margin: 0; 
}

.btn-nps:active { transform: translateY(2px); }

.nps-ruim { background-color: #e74c3c; }    
.nps-neutro { background-color: #f1c40f; color: #444; } 
.nps-bom { background-color: #2ecc71; }     

/* =========================================
   RESPONSIVIDADE E PROTEÇÃO PARA TECLADO
   ========================================= */

/* Celulares pequenos */
@media (max-width: 600px) {
    body { padding: 5px; }
    .container { padding: 15px 5px; }
    h1 { font-size: 18px; }
    
    /* Ajuste fino para celular se precisar */
    .btn-img img { transform: scale(1.35); } 
    
    .rating { gap: 4px; }
    .nps-container { gap: 2px; }
    .btn-nps { height: 45px; font-size: 16px; border-radius: 6px; }
}

/* MODO PAISAGEM / ALTURA PEQUENA
   Ativa se a altura for MENOR que 450px.
   Geralmente tablets na horizontal ativam isso se tiverem barras de sistema.
*/
@media (max-height: 450px) {
    body { 
        align-items: center; /* Mantém centralizado */
        overflow-y: hidden; /* Evita scroll na página toda */
    }
    .container {
        /* Garante que o container use o espaço mas não corte */
        height: auto;
        max-height: 98vh; /* Aproveita o máximo possível da altura */
        padding: 10px;
    }
    
    /* CORREÇÃO: Força o título a aparecer, mas menor */
    h1 { 
        display: block !important; 
        font-size: 18px; 
        margin-bottom: 5px;
    } 
    
    .rating { width: 90%; margin: 0 auto 5px auto; }
    
    /* Reduz um pouco o zoom para caber */
    .btn-img img { transform: scale(1.2); }
    
    .btn-nps { height: 40px; font-size: 14px; }
    
    input, textarea { padding: 8px; margin: 5px 0; }
    button.btn { margin-top: 5px; padding: 10px; font-size: 18px; }
}