/* 
 * CSS Frontend Timbratura
 */

:root {
    --tpf-primary: #3b82f6;
    --tpf-success: #22c55e;
    --tpf-warning: #f59e0b;
    --tpf-danger: #ef4444;
    --tpf-bg: #f8fafc;
    --tpf-card: #ffffff;
    --tpf-text: #1f2937;
    --tpf-text-light: #6b7280;
}

.tp-timbratura-container {
    font-family: 'Inter', system-ui, sans-serif;
    max-width: 800px;
    margin: 40px auto;
    background: var(--tpf-card);
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    padding: 40px;
    text-align: center;
    color: var(--tpf-text);
}

.tp-logo {
    max-height: 80px;
    margin-bottom: 20px;
}

.tp-clock-display {
    font-size: 64px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 8px;
    font-variant-numeric: tabular-nums;
    letter-spacing: -2px;
}

.tp-date-display {
    font-size: 20px;
    color: var(--tpf-text-light);
    margin-bottom: 40px;
    text-transform: capitalize;
}

.tp-instruction {
    font-size: 24px;
    font-weight: 500;
    margin-bottom: 10px;
    color: var(--tpf-primary);
}

/* Feedback Box */
.tp-feedback {
    display: none;
    /* Flex when active */
    align-items: center;
    justify-content: center;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 40px;
    animation: tp-slide-up 0.3s ease-out forwards;
    background: var(--tpf-bg);
}

.tp-feedback--scanning {
    background: #e0f2fe;
    color: #0369a1;
}

.tp-feedback--success {
    background: #dcfce7;
    color: #166534;
}

.tp-feedback--late {
    background: #ffedd5;
    color: #9a3412;
    border: 2px solid #f97316;
}

.tp-feedback--error {
    background: #fee2e2;
    color: #991b1b;
}

.tp-feedback--warning {
    background: #fef3c7;
    color: #92400e;
}

.tp-feedback__photo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 20px;
    border: 3px solid white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.tp-feedback__avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 700;
    margin-right: 20px;
}

.tp-feedback__body {
    text-align: left;
}

.tp-feedback__icon {
    font-size: 24px;
    margin-bottom: 4px;
}

.tp-feedback__name {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
}

.tp-feedback__dept {
    font-size: 14px;
    opacity: 0.8;
    margin-bottom: 8px;
}

.tp-feedback__message {
    font-size: 18px;
    font-weight: 500;
}

.tp-feedback__debug {
    font-size: 12px;
    opacity: 0.6;
    margin-top: 8px;
    font-family: monospace;
}

/* Status Bar */
.tp-reader-status {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    background: var(--tpf-bg);
}

.tp-reader-status--ready {
    color: var(--tpf-success);
}

.tp-reader-status--scanning {
    color: var(--tpf-primary);
}

.tp-reader-status--error {
    color: var(--tpf-danger);
}

/* Animazioni */
@keyframes tp-slide-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fallback Manuale (Debug/Simulatore) */
.tp-manual-form {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px dashed #ccc;
}

.tp-manual-form input {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.tp-manual-form button {
    padding: 8px 16px;
    background: var(--tpf-primary);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

/* Responsive */
@media (max-width: 600px) {
    .tp-timbratura-container {
        margin: 10px;
        padding: 20px;
    }

    .tp-clock-display {
        font-size: 48px;
    }

    .tp-feedback {
        flex-direction: column;
        text-align: center;
    }

    .tp-feedback__photo,
    .tp-feedback__avatar {
        margin: 0 0 16px 0;
    }

    .tp-feedback__body {
        text-align: center;
    }
}