:root {
    --cor-fundo: #FFFFFF;
    --cor-fundo-app: #FFFFFF;
    --cor-fundo-secundario: #F0F0F0;
    --cor-texto-principal: #000000;
    --cor-texto-secundario: #888888;
    --cor-amarelo: #fbba00;
    --cor-borda: #E0E0E0;
    --cor-entrada: #03A9F4;
    --cor-saida: #F44336;
    --cor-sucesso: #4CAF50;
    --font-principal: 'Poppins', sans-serif;
}

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

body.ponto-body {
    font-family: var(--font-principal);
    background-color: #EAEAEA;
    color: var(--cor-texto-principal);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 15px;
    overflow: hidden; 
}

.birthday-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at bottom, #1b2735 0%, #090a0f 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    overflow: hidden;
}
.birthday-card {
    background: rgba(255, 255, 255, 0.95);
    padding: 2rem;
    border-radius: 20px;
    text-align: center;
    max-width: 90%;
    width: 380px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    animation: popInCard 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    transform: scale(0.8);
    opacity: 0;
}
@keyframes popInCard { to { transform: scale(1); opacity: 1; } }

.birthday-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: #ff4757;
    margin-bottom: 0.5rem;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}
.birthday-message { font-size: 1.5rem; color: #5352ed; font-weight: 600; margin-bottom: 1.5rem; }
.birthday-wish { font-size: 1rem; color: #34495e; margin-top: 1.5rem; }

.cake { position: relative; width: 200px; height: 180px; margin: 0 auto; }
.plate { width: 200px; height: 10px; background: #ccc; border-radius: 50%; position: absolute; bottom: 0; left: 0; }
.layer { width: 170px; height: 50px; position: absolute; left: 15px; background: #f0932b; }
.layer-bottom { bottom: 10px; }
.layer-middle { bottom: 60px; }
.layer-top { bottom: 110px; }
.icing { width: 170px; height: 25px; background: #ffffff; position: absolute; left: 15px; bottom: 160px; border-radius: 50% / 15px; }
.drip { width: 15px; height: 30px; background: #ffffff; border-radius: 0 0 50% 50%; position: absolute; top: 5px; }
.drip1 { left: 30px; } .drip2 { left: 80px; height: 20px; } .drip3 { left: 130px; }
.candle { width: 12px; height: 40px; background: #7ed6df; position: absolute; top: -35px; left: 94px; }
.flame { width: 10px; height: 20px; background: #ffbe76; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; position: absolute; top: -18px; left: 1px; animation: flameWiggle 0.5s infinite; }
@keyframes flameWiggle { 50% { transform: scale(1.1) skewX(5deg); } }

.birthday-overlay::before, .birthday-overlay::after {
    content: '';
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}
.birthday-overlay::before {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 10"><circle cx="5" cy="5" r="3" fill="%23FFD700"/></svg>'),
                      url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 10"><rect width="8" height="8" x="1" y="1" fill="%23ff4757" transform="rotate(45 5 5)"/></svg>'),
                      url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 10"><polygon points="5,0 10,10 0,10" fill="%235352ed"/></svg>');
    background-size: 15px, 12px, 18px;
    animation: confetti-fall 13s linear infinite;
}
@keyframes confetti-fall {
    from { transform: translateY(-100vh) rotate(0deg); }
    to { transform: translateY(100vh) rotate(1080deg); }
}

#app-container, #authModal {
    width: 100%; max-width: 420px; height: 100vh;
    max-height: 720px;
    background-color: var(--cor-fundo-app);
    border-radius: 20px; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    display: flex; flex-direction: column; overflow: hidden; position: relative;
    border: 1px solid var(--cor-borda);
}
.tela-ativa { display: flex; flex-direction: column; flex-grow: 1; animation: fadeIn 0.4s ease-in-out; }
.tela-inativa { display: none; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.ponto-header { display: flex; justify-content: space-between; align-items: center; padding: 20px; flex-shrink: 0; border-bottom: 1px solid var(--cor-borda); }
.header-logo { height: 35px; }
.menu-hamburger { background: none; border: none; cursor: pointer; display: flex; flex-direction: column; gap: 5px; padding: 5px; }
.menu-hamburger span { display: block; width: 28px; height: 3px; background-color: var(--cor-texto-principal); border-radius: 3px; }

.ponto-main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    text-align: center;
}

#container-login .ponto-main { justify-content: space-around; }
.data-atual { font-size: 1.1rem; color: var(--cor-texto-secundario); font-weight: 400; }
.relogio-principal { font-weight: 700; color: var(--cor-texto-principal); letter-spacing: 2px; }
#relogio-login { font-size: clamp(2.2rem, 10vw, 3rem); }
.campo-senha-visual { background-color: var(--cor-fundo-secundario); width: 100%; padding: 20px; border-radius: 12px; min-height: 80px; display: flex; flex-direction: column; justify-content: center; align-items: center; margin-bottom: 20px; }
.senha-placeholder { font-size: 1.5rem; color: var(--cor-texto-secundario); font-weight: 500; }
.senha-dots { display: none; gap: 15px; }
.senha-dots .dot { width: 18px; height: 18px; background-color: var(--cor-amarelo); border-radius: 50%; animation: popIn 0.2s ease-out; }
@keyframes popIn { from { transform: scale(0.5); } to { transform: scale(1); } }
.keypad-moderno { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; width: 100%; }
.keypad-moderno button { background-color: var(--cor-fundo-secundario); border: none; color: var(--cor-texto-principal); font-size: 2.2rem; font-weight: 500; padding: clamp(15px, 4vw, 20px) 0; border-radius: 50px; cursor: pointer; transition: background-color 0.2s ease, transform 0.1s ease; display: flex; justify-content: center; align-items: center; }
.keypad-moderno button:active { transform: scale(0.95); background-color: #DCDCDC; }
.keypad-moderno .funcao { background: none; }
.keypad-icon { width: 32px; height: 32px; fill: var(--cor-amarelo); }
.keypad-moderno .confirmar { background-color: var(--cor-amarelo); }
.keypad-moderno .confirmar .keypad-icon { fill: var(--cor-texto-principal); }
.error-message { color: var(--cor-saida); min-height: 20px; font-weight: 500; margin-top: 10px; }

.saudacao-colaborador { margin-top: 10px; }
.saudacao-colaborador h2 { font-size: 1.5rem; font-weight: 300; color: var(--cor-texto-secundario); }
.saudacao-colaborador p { font-size: 2rem; font-weight: 700; color: var(--cor-amarelo); line-height: 1.2; }
.relogio-container { margin-top: 5px; }
#relogio-principal-ativo { font-size: clamp(2rem, 8vw, 2.5rem); letter-spacing: 2px; color: var(--cor-texto-principal); font-weight: 700;}
.botoes-ponto-container { flex-grow: 1; display: flex; width: 100%; justify-content: center; align-items: center; }
.btn-ponto { width: 170px; height: 170px; border-radius: 50%; border-width: 6px; border-style: solid; font-size: 1.5rem; font-weight: 700; text-transform: uppercase; cursor: pointer; transition: all 0.3s ease; animation: pulse 2s infinite ease-in-out; display: flex; justify-content: center; align-items: center; text-align: center; line-height: 1.1; padding: 10px; }
.btn-ponto.entrada { border-color: var(--cor-entrada); color: var(--cor-entrada); background-color: transparent; }
.btn-ponto.entrada:hover { background-color: var(--cor-entrada); color: var(--cor-fundo); transform: scale(1.05); }
.btn-ponto.saida { border-color: var(--cor-saida); color: var(--cor-saida); background-color: transparent; }
.btn-ponto.saida:hover { background-color: var(--cor-saida); color: var(--cor-fundo); transform: scale(1.05); }
.btn-ponto:disabled { border-color: #BBB; color: #BBB; cursor: not-allowed; animation: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(251, 186, 0, 0.4); } 70% { box-shadow: 0 0 0 20px rgba(251, 186, 0, 0); } 100% { box-shadow: 0 0 0 0 rgba(251, 186, 0, 0); } }

.informacoes-rodape { display: flex; flex-direction: column; align-items: center; gap: 5px; margin-bottom: 10px; }
.last-action-info { font-size: 1rem; font-weight: 500; min-height: 20px; }
.last-action-info.entrada { color: var(--cor-entrada); }
.last-action-info.saida { color: var(--cor-saida); }
.info-horas-trabalhadas { font-size: 1.1rem; color: var(--cor-texto-secundario); }
.info-horas-trabalhadas strong { font-weight: 700; color: var(--cor-texto-principal); }

.menu-modal-container { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.4); backdrop-filter: blur(5px); z-index: 100; }
.menu-modal-content { background-color: #333; position: absolute; top: 0; right: -100%; width: 80%; max-width: 300px; height: 100%; padding: 20px; box-shadow: -5px 0 20px rgba(0,0,0,0.3); transition: right 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94); }
.menu-modal-container.tela-ativa .menu-modal-content { right: 0; }
.menu-modal-content h3 { color: var(--cor-amarelo); font-size: 1.8rem; margin-bottom: 30px; }
.menu-modal-content ul { list-style: none; }
.menu-modal-content ul li button { background: none; border: none; color: white; font-family: var(--font-principal); font-size: 1.2rem; font-weight: 500; padding: 15px 0; width: 100%; text-align: left; cursor: pointer; transition: color 0.2s; }
.menu-modal-content ul li button:hover { color: var(--cor-amarelo); }
.btn-fechar-modal { position: absolute; top: 15px; right: 15px; background: none; border: none; color: white; font-size: 2.5rem; cursor: pointer; }
#offline-count { display: inline-block; background-color: var(--cor-saida); color: white; font-size: 0.8rem; padding: 2px 8px; border-radius: 10px; margin-left: 8px; font-weight: bold; }
.sync-toast-modal { margin-top: 20px; color: var(--cor-sucesso); font-weight: 500; }

#authModal { text-align: center; }
.auth-content-wrapper { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 20px; width: 100%;}
#authModal .ponto-logo { max-width: 90px; margin-bottom: 20px; }
#authModal h2 { color: var(--cor-texto-principal); margin-bottom: 10px; }
#authModal p { color: var(--cor-texto-secundario); max-width: 90%; margin-left: auto; margin-right: auto; }
#authTokenInput, #authConfirmBtn { width: 90%; max-width: 350px; padding: 14px; font-family: var(--font-principal); border-radius: 8px; box-sizing: border-box; font-size: 1rem; margin-top: 20px; border: 1px solid var(--cor-borda); }
#authTokenInput { background-color: var(--cor-fundo-secundario); color: var(--cor-texto-principal); text-align: center; }
#authConfirmBtn { background-color: var(--cor-amarelo); color: var(--cor-texto-principal); font-weight: 700; cursor: pointer; border: none; transition: background-color 0.2s; margin-top: 10px; }
#authConfirmBtn:hover { background-color: #fdd247; }
#authErrorMessage { color: var(--cor-saida); margin-top: 10px; }

.loading-spinner { border: 4px solid rgba(0, 0, 0, 0.1); border-left-color: var(--cor-amarelo); border-radius: 50%; width: 40px; height: 40px; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
#initial-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: #F0F0F0;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    text-align: center;
}

.loading-content-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 30px;
    width: 90%;
    max-width: 420px;
    background-color: var(--cor-fundo-app);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.loading-content-wrapper .ponto-logo {
    max-width: 150px; 
    margin-bottom: 25px; 
}

#initial-loading-message {
    color: var(--cor-texto-secundario);
    font-size: 1.1rem;
    min-height: 40px;
}

.progress-bar-container {
    width: 100%;
    height: 10px;
    background-color: var(--cor-fundo-secundario);
    border-radius: 5px;
    margin-top: 15px;
    overflow: hidden;
}

#progress-bar {
    width: 0%;
    height: 100%;
    background-color: var(--cor-amarelo);
    border-radius: 5px;
    transition: width 0.2s ease-in-out, background-color 0.3s ease;
}

#authModal .auth-content-wrapper {
    display: none; 
}
.contingency-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10001; 
}

.contingency-modal-content {
    background-color: var(--cor-fundo-app);
    padding: 25px;
    border-radius: 15px;
    text-align: center;
    width: 90%;
    max-width: 380px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
    animation: popInCard 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.contingency-modal-content h3 {
    color: var(--cor-amarelo);
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.contingency-modal-content p {
    color: var(--cor-texto-principal);
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 10px;
}

.contingency-modal-content .contingency-warning {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--cor-saida);
    background-color: rgba(244, 67, 54, 0.1);
    padding: 10px;
    border-radius: 8px;
    margin-top: 10px;
    margin-bottom: 20px;
}

#contingency-confirm-btn {
    width: 100%;
    padding: 14px;
    font-family: var(--font-principal);
    border-radius: 8px;
    font-size: 1rem;
    border: none;
    background-color: var(--cor-amarelo);
    color: var(--cor-texto-principal);
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s ease;
}

#contingency-confirm-btn:hover {
    background-color: #fdd247;
}

#contingency-confirm-btn:active {
    transform: scale(0.98);
}

.auth-success-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10002; 
}

.auth-success-modal-content {
    background-color: var(--cor-fundo-app);
    padding: 25px;
    border-radius: 15px;
    text-align: center;
    width: 90%;
    max-width: 380px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
    animation: popInCard 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.auth-success-modal-content h3 {
    color: var(--cor-sucesso);
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.auth-success-modal-content p {
    color: var(--cor-texto-principal);
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 20px;
}

#auth-success-btn {
    width: 100%;
    padding: 14px;
    font-family: var(--font-principal);
    border-radius: 8px;
    font-size: 1rem;
    border: none;
    background-color: var(--cor-amarelo);
    color: var(--cor-texto-principal);
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s ease;
}

#auth-success-btn:hover {
    background-color: #fdd247;
}

#auth-success-btn:active {
    transform: scale(0.98);
}