:root {
    --primary-color: #2e7d32;
    --secondary-color: #81c784;
    --accent-color: #64ffda;
    --bg-color: #f1f8e9;
    --card-bg: rgba(255, 255, 255, 0.85);
    --text-primary: #1b5e20;
    --text-secondary: #4caf50;
    --danger-color: #e53935;
    --warning-color: #ffb300;
    --success-color: #43a047;
    --glass-blur: blur(10px);
    --shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', 'Inter', -apple-system, sans-serif;
}

body {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    color: var(--text-primary);
}

#app {
    width: 100%;
    max-width: 500px;
    background: var(--bg-color);
    min-height: 100vh;
    position: relative;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.05);
}

.screen {
    display: none;
    flex-direction: column;
    align-items: center;
    padding: 1.2rem;
    min-height: 90vh;
    animation: fadeIn 0.4s ease-out;
}

.screen.active {
    display: flex;
}

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

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

.logo-container img {
    width: 100px;
    height: 100px;
    margin-bottom: 1rem;
}

h1,
h2 {
    text-align: center;
    margin-bottom: 1rem;
}

.input-text {
    width: 100%;
    padding: 1rem;
    border-radius: 12px;
    border: 2px solid #ddd;
    margin-bottom: 1rem;
    font-size: 1rem;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 1.2rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.btn-primary:active {
    transform: scale(0.98);
}

.password-wrapper {
    position: relative;
    width: 100%;
    margin-bottom: 0.8rem;
}

.password-wrapper .input-text {
    padding-right: 48px;
    /* Space for the icon */
    margin-bottom: 0 !important;
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    background: none;
    border: none;
    padding: 8px;
    font-size: 1.1rem;
    line-height: 1;
    color: #555;
    z-index: 5;
    display: flex;
    align-items: center;
}

.toggle-password:hover {
    color: var(--primary-color);
}

.btn-use-photo {
    background: #66bb6a !important;
    /* Lighter green */
    color: white !important;
    border-radius: 50px;
    padding: 0.8rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 700;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    border: none;
    transition: all 0.2s;
}

.btn-use-photo:hover {
    background: #4caf50 !important;
    transform: translateY(-2px);
}

.btn-link {
    background: none;
    border: none;
    color: var(--text-secondary);
    text-decoration: underline;
    cursor: pointer;
    margin-top: 1rem;
}

.result-card {
    background: var(--card-bg);
    backdrop-filter: var(--glass-blur);
    padding: 1.5rem;
    border-radius: 25px;
    width: 100%;
    box-shadow: var(--shadow);
}

.status-badge {
    padding: 0.5rem 1rem;
    border-radius: 10px;
    font-weight: bold;
    font-size: 0.9rem;
}

.status-RECICLAVEL {
    background: #e8f5e9;
    color: var(--success-color);
}

.status-NAO_RECICLAVEL {
    background: #ffebee;
    color: var(--danger-color);
}

.btn-gold {
    background: linear-gradient(135deg, #FFD700 0%, #FFB900 100%);
    color: #4b3a00 !important;
    font-weight: 800;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
    border: none;
    border-radius: 50px;
    padding: 0.8rem 2rem;
    transition: transform 0.2s, box-shadow 0.2s;
    font-size: 0.9rem;
    display: block;
    margin: 0 auto;
}

.btn-gold:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.5);
}

.btn-pwa {
    background: white;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    font-weight: 700;
    margin-top: 1rem;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
    width: 100%;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    cursor: pointer;
}

.btn-pwa:active {
    transform: scale(0.98);
}

.why-text {
    margin: 1.5rem 0;
    line-height: 1.5;
}

.ranking-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.8rem 1.2rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
    border-left: 4px solid #eee;
}

.ranking-item.top-1 {
    border-left-color: #ffd700;
    background: linear-gradient(90deg, #fff 0%, #fffde7 100%);
}

.ranking-item.top-2 {
    border-left-color: #c0c0c0;
}

.ranking-item.top-3 {
    border-left-color: #cd7f32;
}

#medal-icon {
    animation: medal-bounce 2s infinite ease-in-out;
    display: inline-block;
}

@keyframes medal-bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}

.instructions-list {
    margin-bottom: 2rem;
    text-align: left;
    padding-left: 1.2rem;
}

.instructions-list li {
    margin-bottom: 0.8rem;
}

.status-DEPENDE {
    background: #fff8e1;
    color: var(--warning-color);
}

.history-item {
    background: white;
    padding: 1rem;
    border-radius: 15px;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Specific to dashboard */
#scansChart {
    width: 100% !important;
    height: 200px !important;
}

/* Camera container */
#camera-container {
    width: 100%;
    height: 60vh;
    background: #000;
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 1rem;
}

#video,
#preview-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.camera-controls {
    display: flex;
    gap: 1rem;
    width: 100%;
}

.btn-icon {
    flex: 1;
    padding: 1rem;
    border-radius: 15px;
    border: 1px solid var(--primary-color);
    background: white;
    cursor: pointer;
}

.btn-icon.capture {
    background: var(--primary-color);
    color: white;
}