/* Reset e Variáveis */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-color: #F8F8F8;
    --card-bg: #FFFFFF;
    --primary-blue: #4285F4;
    --dark-blue: #3366CC;
    --text-dark: #333333;
    --text-medium: #888888;
    --text-light: #AAAAAA;
    --border-color: #DDDDDD;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-subtle: 0 1px 3px rgba(0, 0, 0, 0.08);
    --yellow-badge: #FFCC00;
    --green-pill: #6CCF5C;
    --toast-bg: #333333;
    --metric-bg: #F5F8FA;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-dark);
    min-height: 100vh;
}

/* Screen Management */
.screen {
    display: none;
    min-height: 100vh;
    padding: 20px;
}

.screen.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

#progressScreen {
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding-top: 40px;
    padding-bottom: 40px;
}

#progressScreen.active {
    display: flex;
}

/* Tela de Login */
.login-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 48px 40px;
    width: 100%;
    max-width: 480px;
    box-shadow: var(--shadow-subtle);
    text-align: center;
}

.logo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 32px;
}

.logo-image {
    width: auto;
    height: 52px;
    margin-bottom: 8px;
    display: block;
}

.logo-text {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1px;
    color: var(--text-dark);
    text-transform: uppercase;
}

.login-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.login-subtitle {
    font-size: 16px;
    color: var(--text-medium);
    margin-bottom: 32px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.email-input,
.search-input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    background: var(--card-bg);
    color: var(--text-dark);
    transition: border-color 0.2s;
}

.email-input:focus,
.search-input:focus {
    outline: none;
    border-color: var(--primary-blue);
}

.email-input::placeholder,
.search-input::placeholder {
    color: var(--text-light);
}

.continue-button {
    width: 100%;
    padding: 14px;
    background: var(--primary-blue);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.continue-button:hover:not(:disabled) {
    background: var(--dark-blue);
}

.continue-button:active:not(:disabled) {
    transform: scale(0.98);
}

.continue-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.button-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Tela de Progresso */
.progress-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.progress-header {
    text-align: center;
    margin-bottom: 32px;
}

.progress-header .logo-container {
    margin-bottom: 24px;
}

.progress-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--dark-blue);
    margin-bottom: 8px;
}

.progress-subtitle {
    font-size: 18px;
    color: var(--text-medium);
}

/* Busca e Filtro */
.search-filter-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    margin-bottom: 40px;
}

.search-input {
    max-width: 600px;
    width: 100%;
}

.filter-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-dark);
    font-size: 14px;
    cursor: pointer;
}

.filter-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-blue);
}

/* Grid de Cards */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    padding-bottom: 40px;
}

.student-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 32px;
    box-shadow: var(--shadow-subtle);
    position: relative;
    transition: transform 0.2s, box-shadow 0.2s;
}

.student-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

/* Avatar e Badge */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--dark-blue);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    flex-shrink: 0;
}

.rank-badge {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-dark);
}

.rank-badge.first {
    background: var(--yellow-badge);
}

.rank-badge.other {
    background: #E0E0E0;
}

/* Informações do Colaborador */
.student-info {
    margin-bottom: 20px;
}

.student-name {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 12px;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-medium);
}

.contact-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* Métricas */
.metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.metric-box {
    background: var(--metric-bg);
    border-radius: 8px;
    padding: 16px;
}

.points-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.points-label {
    font-size: 14px;
    color: var(--text-medium);
}

.last-access-box {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.access-date {
    font-size: 18px;
    font-weight: 700;
    color: var(--dark-blue);
    display: flex;
    align-items: center;
    gap: 8px;
}

.time-pill {
    background: var(--green-pill);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.access-label {
    font-size: 14px;
    color: var(--text-medium);
}

.days-without {
    font-size: 14px;
    color: var(--text-medium);
}

/* Toast Notification */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--toast-bg);
    color: white;
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    transform: translateX(100%);
    transition: opacity 0.3s, transform 0.3s;
    z-index: 1000;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

/* Responsividade */
@media (max-width: 768px) {
    .login-card {
        padding: 32px 24px;
    }

    .progress-title {
        font-size: 24px;
    }

    .cards-grid {
        grid-template-columns: 1fr;
    }

    .metrics {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .screen {
        padding: 16px;
    }

    .login-title {
        font-size: 24px;
    }

    .progress-title {
        font-size: 20px;
    }

    .toast {
        right: 16px;
        left: 16px;
        transform: translateY(-100%);
    }

    .toast.show {
        transform: translateY(0);
    }
}
