/* ============================================
   DIETA KETO - ESTILO BASE MOBILE-FIRST
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    height: 100%;
    overflow-x: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    background: linear-gradient(180deg, #f0fdf4 0%, #ecfdf5 100%);
    color: #1f2937;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

/* ============================================
   TELA DE LOGIN
   ============================================ */

.tela-login {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.container-login {
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.logo-area {
    text-align: center;
    margin-bottom: 48px;
}

.logo-emoji {
    font-size: 72px;
    margin-bottom: 8px;
    animation: flutuar 3s ease-in-out infinite;
}

@keyframes flutuar {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.logo-area h1 {
    font-size: 32px;
    font-weight: 700;
    color: #047857;
    margin-bottom: 6px;
}

.subtitulo {
    color: #6b7280;
    font-size: 16px;
}

/* Seletor de usuários */
.seletor-usuarios {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    width: 100%;
}

.card-usuario {
    background: #10b981;
    border-radius: 24px;
    padding: 32px 16px;
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    min-height: 180px;
    justify-content: center;
}

.card-usuario:active {
    transform: scale(0.96);
    box-shadow: 0 2px 10px rgba(0,0,0,0.12);
}

.card-usuario .avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(255,255,255,0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    font-weight: 600;
}

.nome-usuario {
    font-size: 18px;
    font-weight: 600;
}

/* ============================================
   TELA DE PIN
   ============================================ */

.tela-pin {
    width: 100%;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.voltar {
    position: absolute;
    top: 24px;
    left: 24px;
    color: #6b7280;
    font-size: 16px;
    padding: 8px 12px;
}

.avatar-grande {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: #10b981;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 40px;
    font-weight: 600;
    margin-bottom: 8px;
}

.tela-pin h2 {
    font-size: 24px;
    color: #1f2937;
    font-weight: 600;
}

.instrucao {
    color: #6b7280;
    font-size: 15px;
    text-align: center;
}

.pin-display {
    display: flex;
    gap: 16px;
    margin: 16px 0 8px 0;
}

.pin-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid #d1d5db;
    background: transparent;
    transition: all 0.2s;
}

.pin-dot.preenchido {
    background: #10b981;
    border-color: #10b981;
    transform: scale(1.1);
}

.erro {
    color: #dc2626;
    font-size: 14px;
    min-height: 20px;
    text-align: center;
    font-weight: 500;
}

/* Teclado numérico */
.teclado {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    width: 100%;
    max-width: 320px;
    margin-top: 8px;
}

.teclado button {
    background: white;
    border-radius: 16px;
    padding: 20px;
    font-size: 26px;
    font-weight: 500;
    color: #1f2937;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    transition: all 0.15s;
}

.teclado button:active {
    background: #f3f4f6;
    transform: scale(0.95);
}

.teclado button.vazio {
    background: transparent;
    box-shadow: none;
    pointer-events: none;
}

.teclado button.apagar {
    font-size: 22px;
    color: #6b7280;
}

/* ============================================
   LAYOUT BASE (telas internas - usado depois)
   ============================================ */

.app-container {
    max-width: 480px;
    margin: 0 auto;
    padding: 16px;
    padding-bottom: 100px;
}

.header-app {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
}

.titulo-pagina {
    font-size: 22px;
    font-weight: 700;
    color: #1f2937;
}

.card {
    background: white;
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}

.btn-primario {
    background: #10b981;
    color: white;
    padding: 16px 24px;
    border-radius: 16px;
    font-size: 17px;
    font-weight: 600;
    width: 100%;
    transition: all 0.2s;
}

.btn-primario:active {
    background: #059669;
    transform: scale(0.98);
}

.btn-secundario {
    background: white;
    color: #10b981;
    padding: 16px 24px;
    border: 2px solid #10b981;
    border-radius: 16px;
    font-size: 17px;
    font-weight: 600;
    width: 100%;
}

/* Bottom navigation (telas internas) */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-around;
    padding: 8px 0 calc(8px + env(safe-area-inset-bottom)) 0;
    z-index: 100;
}

.bottom-nav a {
    flex: 1;
    text-align: center;
    color: #9ca3af;
    text-decoration: none;
    font-size: 11px;
    padding: 8px 4px;
}

.bottom-nav a.ativo {
    color: #10b981;
}

.bottom-nav a .icone {
    display: block;
    font-size: 24px;
    margin-bottom: 2px;
}
