body {
    margin: 0;
    font-family: 'Segoe UI', sans-serif;
    background-color: #F4F0FA;
    color: #333;
}

.auth-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100dvh; /* Altura real dinámica del viewport */
    padding: 20px;
    box-sizing: border-box;
    background-color: #f5f0fa;
}

.auth-box {
    background-color: white;
    padding: 30px 20px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    max-width: 400px;
    width: 100%;
    transition: transform 0.3s ease;
}

.auth-box input {
    width: 90%;
    padding: 12px;
    margin-bottom: 12px;
    border-radius: 8px;
    border: 1px solid #d9bdf0;
    font-size: 16px;
}

.auth-box button {
    width: 48%;
    padding: 12px;
    border: none;
    background-color: #a259ff;
    color: white;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 10px;
}

.auth-box button:hover {
    background-color: #8c40d6;
}

.auth-box .button-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.slogan {
    font-size: 14px;
    color: #666;
    min-height: 1.2em;
    height: 1.4em;
    overflow: hidden;
    white-space: nowrap;
    border-right: 2px solid #a259ff;
    animation: blink 0.7s step-end infinite;
    margin-bottom: 20px;
    text-align: center;
}

@keyframes blink {
    50% {
        border-color: transparent;
    }
}


.logo {
    font-size: 3em;
    font-weight: bold;
    color: #8A63D2;
    margin-bottom: 5px;
}



.auth-buttons {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.auth-buttons button,
.logout {
    flex: 1;
    padding: 12px;
    background-color: #8A63D2;
    border: none;
    color: white;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s;
}

.auth-buttons button:hover,
.logout:hover {
    background-color: #6d49b3;
}

.logout {
    margin-top: 10px;
    background-color: #C4A8E3;
}

.mensaje {
    margin-top: 15px;
    color: #8A63D2;
    font-weight: bold;
    text-align: center;
}


/*@media (max-height: 480px) {*/
/*    .auth-container {*/
/*        justify-content: flex-start;*/
/*        padding-top: 10px;*/
/*    }*/
/*}*/

@media (max-width: 480px) {
    .auth-box {
        max-width: 85%;
        padding: 24px 16px;
    }

    .auth-box input {
        font-size: 16px;
        padding: 10px;
    }

    .auth-box button {
        font-size: 14px;
        padding: 10px;
    }

    .slogan {
        font-size: 12px;
        text-align: center;
        padding: 0 10px;
    }

    h1 {
        font-size: 24px;
    }
}



/*Dashboard*/
:root {
    --color-lila: #A78BFA;
    --color-lila-dark: #7C3AED;
    --color-lila-light: #EDE9FE;
    --color-fondo: #FAFAFA;
    --color-texto: #2E2E2E;
    --color-hover: #f0ebff;
}

.dashboard {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.brand h1 {
    font-size: 2rem;
    color: var(--color-lila-dark);
    margin: 0;
}

.brand {
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
    width: 100%;
}


/*.slogan {*/
/*    font-size: 0.95rem;*/
/*    color: #7e7e7e;*/
/*    margin-top: 0.3rem;*/
/*    max-width: 100%;*/
/*    word-wrap: break-word;*/
/*}*/

.user-info {
    text-align: right;
    font-size: 0.85rem;
    color: #666;
}

.user-email {
    display: block;
    margin-bottom: 0.3rem;
    font-weight: 500;
}

.logout-btn {
    background: transparent;
    border: 1px solid var(--color-lila-dark);
    color: var(--color-lila-dark);
    padding: 0.25rem 0.6rem;
    border-radius: 5px;
    font-size: 0.75rem;
    cursor: pointer;
}

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

.dashboard-main h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.dashboard-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.card {
    background: white;
    border-radius: 10px;
    padding: 1.2rem;
    text-align: center;
    font-size: 1rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 14px rgba(0,0,0,0.08);
}

.dashboard-footer {
    margin-top: 3rem;
    text-align: center;
    font-size: 0.85rem;
    color: #666;
    padding-top: 1.5rem;
    border-top: 1px solid #e3e3e3;
}

.dashboard-footer .logout-btn {
    margin-top: 0.5rem;
}



/*GRUPOS*/
/* Botones */
.boton-principal2 {
    background-color: var(--color-lila);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.6rem 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease;
}
.boton-principal2:hover {
    background-color: #9d5dd4;
}

.boton-secundario {
    background-color: #f1f1f1;
    color: #333;
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 0.4rem 0.9rem;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}
.boton-secundario:hover {
    background-color: #e0e0e0;
}

.boton-terciario {
    background-color: #ffe28a;
    color: #5b4400;
    border: none;
    border-radius: 6px;
    padding: 0.4rem 0.9rem;
    font-size: 0.85rem;
    cursor: pointer;
}
.boton-alerta {
    background-color: #ff6961;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 0.4rem 0.9rem;
    font-size: 0.85rem;
    cursor: pointer;
}

/* Encabezado */
.grupo-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

/* Grid de grupos */
.grupos-grid {
    display: grid;
    gap: 1.2rem;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

/* Tarjeta elegante */
.grupo-card.elegante {
    background-color: white;
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s ease;
}
.grupo-card.elegante:hover {
    transform: translateY(-4px);
}

.grupo-contenido h3 {
    margin: 0 0 0.4rem;
    font-size: 1.2rem;
    color: #333;
}
.grupo-contenido p {
    margin: 0;
    font-size: 0.9rem;
    color: #666;
}

.grupo-opciones {
    display: flex;
    justify-content: flex-start;
    gap: 0.5rem;
    margin-top: 1rem;
}

.mensaje-vacio {
    font-style: italic;
    color: #999;
}



/*Agregar grupo*/

.formulario-grupo {
    max-width: 500px;
    margin: 0 auto;
    background: #fff;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.07);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.formulario-grupo h2 {
    margin-top: 0;
    color: var(--color-lila);
    text-align: center;
}

.subtexto {
    text-align: center;
    font-size: 0.9rem;
    color: #888;
    margin-top: -0.5rem;
}

.formulario-grupo label {
    font-weight: bold;
    font-size: 0.9rem;
    color: #444;
}

.formulario-grupo input,
.formulario-grupo textarea {
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 0.6rem;
    font-size: 1rem;
    width: 100%;
    resize: vertical;
}

.formulario-grupo textarea {
    min-height: 100px;
}

.mensaje-grupo {
    margin-top: 0.5rem;
    text-align: center;
    font-weight: bold;
    font-size: 0.9rem;
}

.mensaje-grupo.exito {
    color: green;
}

.mensaje-grupo.error {
    color: red;
}



/*CUENTA*/

.cuenta-container {
    max-width: 600px;
    margin: auto;
    padding: 1.5rem;
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.cuenta-formulario input {
    display: block;
    width: 100%;
    margin: 0.5rem 0;
    padding: 0.6rem;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 0.6rem;
}

.cuenta-miembros {
    margin: 1rem 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.cuenta-miembros label {
    background: #f4f4f4;
    padding: 0.4rem 0.8rem;
    border-radius: 0.6rem;
    cursor: pointer;
    font-size: 0.95rem;
}

.boton-principal, .boton-guardar {
    display: block;
    width: 100%;
    padding: 0.8rem;
    margin: 1rem 0;
    font-size: 1.1rem;
    border: none;
    border-radius: 0.6rem;
    background: #9b59b6;
    color: white;
    cursor: pointer;
}

.cuenta-items-lista {
    list-style: none;
    padding: 0;
}

.cuenta-items-lista li {
    background: #f9f9f9;
    margin: 0.5rem 0;
    padding: 0.6rem;
    border-radius: 0.6rem;
}

.cuenta-tabla-resumen {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.cuenta-tabla-resumen th, .cuenta-tabla-resumen td {
    border: 1px solid #ccc;
    padding: 0.6rem;
    text-align: left;
}


.eliminar-btn {
    margin-left: 10px;
    background: transparent;
    border: none;
    color: red;
    font-size: 1.2em;
    cursor: pointer;
}
.eliminar-btn:hover {
    transform: scale(1.2);
}


/*HISTORIAL DE LA CUENTA*/

.titulo-historial {
    text-align: center;
    color: #5e4b8b;
    margin-bottom: 2rem;
}

.historial-lista {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 700px;
    margin: auto;
}

.historial-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 0 12px rgba(0, 0, 0, 0.06);
    padding: 1.5rem;
    border-left: 5px solid #a18cd1;
}

.historial-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    color: #4a3f69;
    margin-bottom: 0.75rem;
}

.historial-bloque {
    margin-top: 1rem;
}

.historial-lista-items,
.historial-resumen {
    padding-left: 1.2rem;
    margin: 0.5rem 0;
}

.historial-total {
    font-weight: bold;
    margin-top: 1rem;
    color: #4a3f69;
    font-size: 1.1rem;
    text-align: right;
}
