/* ================================================
   AZUL CORPORATIVO PREMIUM - Ponto Style
   Sistema de Controle de Ponto - Tela de Funcionários
   ================================================ */

@import url('colors.css');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.ponto-body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 25%, #60a5fa 50%, #93c5fd 75%, #dbeafe 100%);
    min-height: 100dvh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    overflow: hidden;
    padding: 10px;
}

.ponto-container {
    width: 100%;
    max-width: 420px;
    flex: 1;
    min-height: 0;
    max-height: 100%;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 20px;
    box-shadow: 0 16px 48px rgba(30, 58, 138, 0.22);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: slideIn 0.5s ease-out;
}

.ponto-toolbar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 20;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    background: #ffffff;
    color: #475569;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.9rem;
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.btn-icon:hover {
    background: #eff6ff;
    border-color: #93c5fd;
    color: #1e3a8a;
}

.btn-icon.fullscreen-active {
    background: var(--btn-primary-bg);
    border-color: var(--primary-dark);
    color: #ffffff;
}

.ponto-main {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 6px 20px 16px;
    scroll-padding-bottom: 16px;
}

.ponto-stack {
    width: 100%;
    max-width: 340px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.ponto-marca {
    width: 100%;
    margin-bottom: 4px;
}

.ponto-marca-icone {
    display: block;
    font-size: clamp(1.25rem, 4vw, 1.75rem);
    color: var(--primary-color);
    margin: 0 auto 6px;
}

.ponto-marca-titulo {
    font-size: clamp(1.2rem, 4.5vw, 1.55rem);
    font-weight: 700;
    color: #0f172a;
    line-height: 1.2;
    margin-bottom: 4px;
}

.ponto-marca-data {
    font-size: clamp(0.78rem, 2.5vw, 0.88rem);
    color: #64748b;
    line-height: 1.35;
    margin-bottom: 6px;
}

.ponto-relogio {
    font-size: clamp(1.65rem, 7vw, 2.25rem);
    font-weight: 700;
    color: #1d4ed8;
    font-family: 'Courier New', Consolas, monospace;
    letter-spacing: 0.06em;
    line-height: 1;
    margin-bottom: 10px;
}

.ponto-logo-empresa {
    display: block;
    max-width: min(200px, 70vw);
    max-height: clamp(36px, 8vh, 48px);
    width: auto;
    height: auto;
    object-fit: contain;
    margin: 0 auto 10px;
}

.ponto-divider {
    width: 100%;
    height: 1px;
    background: #e2e8f0;
    margin-bottom: 12px;
}

.ponto-login {
    width: 100%;
}

.ponto-login-titulo {
    font-size: 1rem;
    font-weight: 700;
    color: #1e3a8a;
    margin-bottom: 14px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.ponto-login-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 8px;
}

.ponto-login-input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    font-size: 1.2rem;
    text-align: center;
    color: #0f172a;
    background: #f8fafc;
    margin-bottom: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.ponto-login-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
    background: #ffffff;
}

.btn-login-continuar {
    font-size: 1rem;
    padding: 14px 20px;
    margin-bottom: 0;
}

.ponto-login-hint {
    margin-top: 12px;
    font-size: 0.82rem;
    line-height: 1.45;
    color: #64748b;
}

.ponto-sessao {
    width: 100%;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Legado: mantido para telas logadas e compatibilidade */
.btn-fullscreen {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    background: #ffffff;
    color: var(--primary-color);
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.2rem;
    width: 38px;
    height: 38px;
}

.logo-icon {
    font-size: 2rem;
    color: var(--primary-color);
}

.digital-time {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1d4ed8;
    font-family: 'Courier New', Consolas, monospace;
    text-align: center;
    width: 100%;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: var(--shadow-blue);
}

.input-group {
    margin-bottom: 15px;
    width: 100%;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    color: #334155;
    font-weight: 600;
    font-size: 0.9rem;
}

.input-group input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #cbd5e1;
    background: #fff;
    border-radius: 10px;
    font-size: 1.05rem;
    text-align: center;
}

/* Área do funcionário */
.funcionario-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: #f0f6ff;
    border: 1px solid #dbeafe;
    border-radius: 10px;
    margin-bottom: 10px;
    box-shadow: 0 1px 4px rgba(37,99,235,0.08);
}

.funcionario-avatar i {
    font-size: clamp(1.75rem, 6vw, 2.25rem);
    color: #0053ee;
}

.funcionario-dados {
    flex: 1;
    min-width: 0;
}

.funcionario-dados h3 {
    color: #1e3a8a;
    margin-bottom: 2px;
    font-size: clamp(0.88rem, 3.2vw, 1rem);
    line-height: 1.25;
    word-break: break-word;
}

.funcionario-dados p {
    color: #7f8c8d;
    font-size: clamp(0.75rem, 2.5vw, 0.85rem);
}

/* Status do ponto */
.ponto-status {
    text-align: center;
    margin-bottom: 8px;
    padding: 8px 10px;
    background: var(--btn-primary-bg);
    color: white;
    border: 1px solid var(--primary-dark);
    border-radius: 8px;
}

.status-label {
    display: block;
    font-size: clamp(0.75rem, 2.5vw, 0.85rem);
    opacity: 0.9;
    margin-bottom: 3px;
}

.status-tipo {
    font-size: clamp(1rem, 4vw, 1.15rem);
    font-weight: bold;
}

/* Botões */
.btn-primary, .btn-registro, .btn-success, .btn-warning, .btn-secondary, .btn-logout {
    padding: 10px 20px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.btn-primary {
    background: linear-gradient(to bottom, #fafafa 0%, #e8e8e8 100%);
    color: #333;
    border-color: #ccc;
}

.btn-primary:hover {
    background: linear-gradient(to bottom, #f0f0f0 0%, #d8d8d8 100%);
    border-color: #999;
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.15);
}

.btn-registro {
    background: var(--btn-primary-bg);
    color: white;
    font-size: clamp(0.95rem, 3.5vw, 1.1rem);
    padding: 12px 18px;
    width: 100%;
    justify-content: center;
    margin-bottom: 0;
    border-color: var(--primary-dark);
}

.btn-registro:hover {
    background: var(--btn-primary-hover);
}

.btn-registro:active {
    transform: translateY(0);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}

#registro-action-botoes {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
    margin-bottom: 8px;
}

#registro-action-botoes .btn-registro {
    margin-bottom: 0;
}

.btn-registro-alt {
    background: #fff !important;
    color: var(--primary-dark, #1e3a8a) !important;
    border: 2px solid var(--primary-dark, #1e3a8a) !important;
}

.btn-registro-alt:hover {
    background: #eff6ff !important;
}

.btn-success {
    background: var(--btn-success-bg);
    color: white;
    border-color: var(--secondary-green-hover);
}

.btn-success:hover {
    background: var(--btn-success-hover);
}

.btn-warning {
    background: linear-gradient(180deg, #f0ad4e 0%, #ec971f 100%);
    color: white;
    border-color: #d58512;
}

.btn-warning:hover {
    background: linear-gradient(180deg, #f5ba6a 0%, #f0ad4e 100%);
}

.btn-secondary {
    background: linear-gradient(to bottom, #fafafa 0%, #e8e8e8 100%);
    color: #333;
    border-color: #ccc;
}

.btn-secondary:hover {
    background: linear-gradient(to bottom, #f0f0f0 0%, #d8d8d8 100%);
    border-color: #999;
}

.btn-logout {
    background: linear-gradient(180deg, #d9534f 0%, #c9302c 100%);
    color: white;
    padding: 8px 12px;
    border-color: #ac2925;
}

.btn-logout:hover {
    background: linear-gradient(180deg, #e06560 0%, #d9534f 100%);
}

.btn-primary:hover, .btn-registro:hover, .btn-success:hover, 
.btn-warning:hover, .btn-secondary:hover, .btn-logout:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

.btn-success:active, .btn-warning:active, .btn-secondary:active, .btn-logout:active {
    transform: translateY(0);
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.15);
}

/* Histórico */
.historico-dia {
    width: 100%;
    margin-top: 8px;
    padding: 10px 12px 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}

.historico-dia h4 {
    color: #1e3a8a;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.82rem;
    font-weight: 600;
}

.historico-dia h4 i {
    font-size: 0.78rem;
}

.historico-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
    max-height: none;
    overflow: visible;
    padding: 0;
}

.registro-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    margin-bottom: 0;
}

.registro-tipo {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    font-size: 0.78rem;
    color: #334155;
}

.registro-tipo i {
    font-size: 0.72rem;
    color: #64748b;
    width: 14px;
    text-align: center;
}

.registro-hora {
    color: #64748b;
    font-size: 0.76rem;
    font-family: 'Courier New', Consolas, monospace;
    letter-spacing: 0.02em;
}

.no-registros {
    text-align: center;
    color: #7f8c8d;
    font-style: italic;
    padding: 12px;
    font-size: 0.78rem;
}

/* Seção de foto */
.foto-section, .foto-preview {
    text-align: center;
    padding: 20px;
    background: #f8faff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    margin-top: 20px;
}

.camera-container, .preview-container {
    margin: 20px 0;
}

.camera-controls, .preview-controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 15px;
}

/* Mensagens */
.messages-area {
    margin-top: 20px;
}

.message {
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    animation: fadeIn 0.3s ease-in;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.message.info {
    background: #d1ecf1;
    color: #0c5460;
    border-left: 4px solid #17a2b8;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Footer */
.ponto-footer {
    background: #f8fafc;
    color: #64748b;
    padding: 8px 12px;
    border-top: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.footer-info {
    margin: 0;
    text-align: center;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

/* Responsivo */
@media (max-width: 768px) {
    .ponto-body {
        padding: 0;
    }

    .offline-banner {
        max-width: none;
    }

    .ponto-container {
        max-width: none;
        width: 100%;
        height: 100dvh;
        max-height: 100dvh;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    .ponto-main {
        padding: 6px 14px 14px;
    }

    .btn-icon-text span {
        display: none;
    }

    .btn-icon-text {
        min-width: 34px;
        padding: 0;
    }

    .camera-controls, .preview-controls {
        flex-direction: column;
        align-items: center;
    }
}

/* Telas baixas (celular horizontal, notebooks pequenos) */
@media (max-height: 740px) {
    .ponto-toolbar {
        padding: 6px 10px;
    }

    .btn-icon {
        min-width: 34px;
        height: 34px;
        font-size: 0.85rem;
    }

    .ponto-marca-icone {
        display: none;
    }

    .ponto-marca-titulo {
        margin-bottom: 2px;
    }

    .ponto-marca-data {
        margin-bottom: 4px;
    }

    .ponto-relogio {
        margin-bottom: 6px;
    }

    .ponto-logo-empresa {
        max-height: 32px;
        margin-bottom: 6px;
    }

    .ponto-divider {
        margin-bottom: 8px;
    }

    .funcionario-info {
        padding: 8px 10px;
        margin-bottom: 8px;
    }

    .ponto-status {
        padding: 6px 8px;
        margin-bottom: 6px;
    }

    .historico-dia {
        padding: 8px 10px 6px;
    }

    .ponto-footer {
        padding: 6px 10px;
    }
}

/* ── PWA Offline UI ── */
.offline-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f59e0b;
    color: white;
    padding: 8px 12px;
    font-size: 0.82rem;
    font-weight: 500;
    flex-shrink: 0;
    width: 100%;
    max-width: 420px;
    z-index: 30;
}

.offline-banner i {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.btn-sync {
    margin-left: 8px;
    background: rgba(255, 255, 255, 0.25);
    border: none;
    color: white;
    border-radius: 6px;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.2s;
}

.btn-sync:hover {
    background: rgba(255, 255, 255, 0.4);
}

.btn-sync.syncing i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.badge-pendentes {
    display: inline-block;
    background: #f59e0b;
    color: white;
    border-radius: 12px;
    padding: 2px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 6px;
}

.registro-item--offline {
    opacity: 0.8;
    border-left: 3px solid #f59e0b !important;
    background: #fffbeb !important;
}

.badge-offline {
    font-size: 0.72em;
    color: #f59e0b;
    font-weight: 600;
    margin-left: 4px;
}

/* ── Botão em estado de carregamento ──────────────────────────────────────── */
.btn-registro--loading {
    opacity: 0.7;
    cursor: not-allowed;
    pointer-events: none;
}

/* ── Card de confirmação de registro ──────────────────────────────────────── */
.registro-sucesso-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    background: #f0fdf4;
    border: 2px solid #22c55e;
    border-radius: 12px;
    padding: 18px 20px;
    margin-bottom: 12px;
    text-align: center;
    animation: sucesso-aparecer 0.3s ease-out;
}

@keyframes sucesso-aparecer {
    from { opacity: 0; transform: scale(0.95); }
    to   { opacity: 1; transform: scale(1); }
}

.registro-sucesso-card .sucesso-icone i {
    font-size: 2.2rem;
    color: #16a34a;
}

.registro-sucesso-card .sucesso-tipo {
    font-size: 1.15rem;
    font-weight: 700;
    color: #15803d;
    letter-spacing: 0.03em;
}

.registro-sucesso-card .sucesso-hora {
    font-size: 1.6rem;
    font-weight: 800;
    color: #166534;
    font-variant-numeric: tabular-nums;
}

.registro-sucesso-card .sucesso-comprovante {
    font-size: 0.82rem;
    color: #4b7c5f;
}