:root {
    --verde-titi: #22c55e;
    --azul-oscuro: #0f172a;
    --amarillo-titi: #fde047;
    --blanco: #ffffff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

/* --- ESTILOS MÓVIL (Por defecto) --- */

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: var(--azul-oscuro);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo-titi { color: var(--verde-titi); font-weight: 700; font-size: 1.4rem; }

.btn-nav {
    background: var(--verde-titi);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.9rem;
}

.hero {
    background: #62c471;
    padding: 40px 20px;
    text-align: center;
}

.hero-container {
    display: flex;
    flex-direction: column; /* Apilado vertical en móvil */
    gap: 30px;
}

.hero-content h1 {
    font-size: 1.8rem;
    color: white;
    line-height: 1.2;
}

.hero-content p {
    color: white;
    margin: 15px 0;
    font-size: 1rem;
    opacity: 0.9;
}

.btn-main {
    display: block;
    background: var(--amarillo-titi);
    color: var(--azul-oscuro);
    padding: 18px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
}

.hero-image img {
    width: 100%;
    border-radius: 20px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.premios-grid {
    display: flex;
    flex-direction: column; /* Uno debajo del otro */
    padding: 20px;
    gap: 20px;
}

.card {
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* Alinea los botones al fondo si el texto varía */
    height: 100%;
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    border: 2px solid #afaeae;
    position: relative;
}

.tag {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--azul-oscuro);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.7rem;
}

.card img {
    width: 100%;            /* Ocupa todo el ancho de la tarjeta */
    aspect-ratio: 1 / 1;    /* Hace que la imagen sea un cuadrado perfecto (como en Instagram) */
    object-fit: cover;      /* Recorta la imagen para llenar el cuadro sin deformarse */
    object-position: center; /* Centra el recorte en el medio */
    display: block;
    border-bottom: 1px solid #eee; /* Opcional: una línea sutil para separar la imagen del texto */
}

.btn-card {
    display: block;
    background: var(--verde-titi);
    color: white;
    text-align: center;
    padding: 12px;
    text-decoration: none;
    border-radius: 8px;
    margin-top: 10px;
}

/* --- AJUSTES PARA ESCRITORIO (PC) --- */
@media (min-width: 768px) {
    .hero-container {
        flex-direction: row;
        align-items: center;
        max-width: 1100px;
        margin: 0 auto;
        text-align: left;
        gap: 50px;
    }

    .hero-content { flex: 1; }
    .hero-image { flex: 1; }

    /* Usamos Grid para asegurar uniformidad total */
    .premios-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr); /* 3 columnas iguales */
        gap: 30px;
        max-width: 1100px;
        margin: 40px auto;
        align-items: start;
    }

    .card {
        height: 100%; /* Todas las tarjetas miden lo mismo de alto */
        display: flex;
        flex-direction: column;
    }

    .card img {
        width: 100%;
        aspect-ratio: 1 / 1; /* Mantiene el cuadrado perfecto */
        object-fit: cover;
    }

    .card-info {
        flex-grow: 1; /* Empuja el botón hacia abajo para que todos queden alineados */
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        padding: 20px;
    }

    .hero-content h1 { font-size: 3rem; }
    .btn-main { display: inline-block; padding: 15px 40px; }
}

/* --- ESTILOS DE PASOS (Móvil primero) --- */
.pasos {
    padding: 60px 20px;
    background-color: #f8fafc;
    text-align: center;
}

.section-title {
    text-align: center;
    font-size: 1.8rem;
    margin: 20px;
    color: var(--azul-oscuro);
}

.pasos-grid {
    display: flex;
    flex-direction: column; /* Apilados en móvil */
    gap: 40px;
}

.paso-item {
    padding: 10px;
}

.circulo {
    width: 70px;
    height: 70px;
    border: 3px solid var(--verde-titi);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--verde-titi);
    background: white;
}

.paso-item h3 {
    margin-bottom: 10px;
    font-size: 1.2rem;
    color: var(--azul-oscuro);
}

.paso-item p {
    font-size: 0.95rem;
    color: #64748b;
    line-height: 1.5;
}

/* --- AJUSTES PARA ESCRITORIO --- */
@media (min-width: 768px) {
    .pasos-grid {
        flex-direction: row; /* En línea en pantallas grandes */
        max-width: 1100px;
        margin: 0 auto;
        justify-content: space-around;
    }

    .paso-item {
        flex: 1;
    }
}

/* --- footer --- */
footer {
    text-align: center;
    padding: 40px;
    background-color: #0f172a;
    color: white;
    font-size: 14px;
}

/* --- ESTILOS DE AUTENTICACIÓN - Pagina de Registro/Login --- */
.bg-auth {
    background-color: #0f172a; /* Fondo oscuro para que la tarjeta resalte */
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.auth-container {
    width: 100%;
    max-width: 400px;
}

.auth-header {
    text-align: center;
    margin-bottom: 20px;
}

.auth-card {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.auth-tabs {
    display: flex;
    margin-bottom: 30px;
    border-bottom: 2px solid #f1f5f9;
}

.tab-btn {
    flex: 1;
    padding: 12px;
    border: none;
    background: none;
    font-weight: 600;
    color: #94a3b8;
    cursor: pointer;
    font-size: 1rem;
    transition: 0.3s;
}

.tab-btn.active {
    color: var(--verde-titi);
    border-bottom: 3px solid var(--verde-titi);
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: #475569;
}

.input-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 1rem;
}

.btn-submit {
    width: 100%;
    padding: 15px;
    background-color: var(--azul-oscuro);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    margin-top: 10px;
}

.btn-register {
    background-color: var(--verde-titi);
}

.d-none { display: none; }



/* ------ CSS de la Dashboard-------------------------------------------------------------- */

.bg-light { background-color: #f1f5f9; }

.user-header {
    background-color: var(--azul-oscuro);
    color: white;
    padding: 30px 20px 60px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 0 0 30px 30px;
}

.welcome { font-size: 0.9rem; opacity: 0.8; }
.user-name { font-size: 1.4rem; }

.level-badge {
    
    display: inline-block;
}

.dashboard-content {
    margin-top: -30px;
    padding: 0 20px 100px; /* Espacio abajo para el menú */
}

.ticket-card {
    background: white;
    border-radius: 20px;
    padding: 20px;
    display: flex;
    align-items: center;
    box-shadow: 0 10px 15px rgba(0,0,0,0.05);
    margin-bottom: 25px;
}

.ticket-icon { font-size: 2.5rem; margin-right: 15px; }

.ticket-balance .label { font-size: 0.8rem; color: #64748b; }
.ticket-balance .amount { font-size: 1.8rem; color: var(--azul-oscuro); }

.btn-earn {
    margin-left: auto;
    background: var(--amarillo-titi);
    color: var(--azul-oscuro);
    padding: 10px 15px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.85rem;
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

.action-card {
    background: white;
    padding: 15px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.03);
}

.action-card .icon { font-size: 1.5rem; display: block; margin-bottom: 5px; }
.action-card p { font-size: 0.75rem; font-weight: 600; color: #475569; }

/* Menú Inferior Fijo */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    display: flex;
    justify-content: space-around;
    padding: 12px 0;
    border-top: 1px solid #e2e8f0;
    box-shadow: 0 -5px 10px rgba(0,0,0,0.05);
}

.nav-item {
    text-decoration: none;
    color: #94a3b8;
    font-size: 1.2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.nav-item span { 
    font-size: 0.65rem; 
    margin-top: 2px; 
    font-family: 'Poppins', sans-serif;
}
.nav-item.active { 
    color: var(--verde-titi); 
}

/*------ CSS del perfil -------------------------------------------------------------- */

.profile-container { padding: 20px; max-width: 500px; margin: 0 auto; }
.profile-header { display: flex; align-items: center; gap: 15px; margin-bottom: 20px; }
.profile-section { background: white; padding: 20px; border-radius: 15px; margin-bottom: 20px; box-shadow: 0 4px 6px rgba(0,0,0,0.05); }
.profile-section.highlight { border: 2px dashed var(--verde-titi); }
.badge-win { background: var(--verde-titi); color: white; padding: 2px 8px; border-radius: 10px; font-size: 0.7rem; margin-left: 10px; }
.input-disabled { background: #f1f5f9; cursor: not-allowed; }
.input-locked { background: #fff1f1; border-color: #fca5a5; color: #991b1b; }
.alert-lock { background: #fef2f2; border-left: 4px solid #ef4444; padding: 10px; font-size: 0.8rem; margin-top: 10px; }
.helper-text { font-size: 0.75rem; color: #64748b; margin-bottom: 10px; }

/*------ CSS de Tareas -------------------------------------------------------------- */

.tasks-container h3 {
    font-size: 1.1rem;
    color: var(--azul-oscuro);
    margin-bottom: 15px;
    padding-left: 5px;
}

.task-card {
    background: white;
    padding: 15px 20px;
    border-radius: 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.03);
    margin-bottom: 12px;
    border-left: 5px solid var(--amarillo-titi);
}

.task-card.special {
    border-left: 5px solid var(--verde-titi);
}

.task-info h4 {
    font-size: 0.95rem;
    color: var(--azul-oscuro);
    margin: 0;
}

.task-info p {
    font-size: 0.8rem;
    color: #64748b;
    margin: 2px 0 0;
}

.btn-task-go, .btn-task-claim {
    background: var(--azul-oscuro);
    color: white;
    border: none;
    padding: 8px 18px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
}

.ticket-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 15px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ticket-badge .count {
    font-weight: bold;
    font-size: 1.1rem;
}

/* Tareas con Formularios */
.task-card.profile-task {
    flex-direction: column;
    align-items: flex-start;
    padding: 18px;
}

.task-form-full {
    width: 100%;
}

.task-header-inline {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 12px;
}

.reward-tag {
    font-size: 0.75rem;
    background: #fef9c3;
    color: #854d0e;
    padding: 4px 8px;
    border-radius: 8px;
    font-weight: 700;
}

.input-action-group {
    display: flex;
    gap: 10px;
    width: 100%;
}

.input-action-group input {
    flex: 1;
    padding: 10px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.9rem;
}

.input-action-group button {
    background: var(--verde-titi);
    color: white;
    border: none;
    padding: 0 15px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
}

/* Estilo para Ingreso Diario Completado */
.task-card.completed {
    opacity: 0.7;
    background: #f8fafc;
    border-left: 5px solid #cbd5e1;
}

.status-icon {
    font-size: 1.2rem;
}

.btn-claim {
    background: var(--amarillo-titi);
    color: var(--azul-oscuro);
    border: none;
    padding: 8px 15px;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
}