:root {
    --color-fondo: #fcfaf7;
    --color-texto: #333333;
    --color-acento: #8e7d6d;
    /* Tono tierra suave/elegante */
    --fuente-principal: 'Georgia', serif;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    /* Fondo casi blanco para calma */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.auth-card {
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    text-align: center;
    max-width: 350px;
    width: 90%;
}

.auth-card h2 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.auth-card input {
    width: 100%;
    padding: 12px;
    margin: 10px 0;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-sizing: border-box;
}

.auth-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

button#loginBtn,
button#signUpBtn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
}

#loginBtn {
    background: #2c3e50;
    color: white;
}

.secondary {
    background: #eee;
    color: #666;
}

#forgotPasswordLink {
    color: var(--color-acento);
    font-size: 0.85em;
    text-decoration: none;
    margin-top: 10px;
}

#forgotPasswordLink:hover {
    text-decoration: underline;
}

#resetPasswordContainer {
    display: none;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

#resetPasswordContainer p {
    font-size: 0.9em;
    opacity: 0.8;
    margin-bottom: 10px;
}

#updatePasswordBtn {
    width: 100%;
    padding: 12px;
    background: #27ae60;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    margin-top: 10px;
}

.error-msg {
    color: #e74c3c;
    font-size: 0.8em;
    margin-top: 10px;
}

body {
    background-color: var(--color-fondo);
    color: var(--color-texto);
    font-family: var(--fuente-principal);
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

header {
    padding: 20px 40px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.header-main {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 5px;
}

.app-logo {
    height: 60px;
    width: auto;
    object-fit: contain;
}

header h1 {
    margin: 0;
}

header p {
    margin: 5px 0 0 0;
}

.chat-container {
    width: 95%;
    max-width: 480px;
    /* Ancho forzado para desktop - Look de App móvil */
    height: 600px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin: 0 auto 20px auto;
    /* Centrado horizontal */
    position: relative;
    /* Contexto de posicionamiento para la ayuda */
}

.chat-header {
    padding: 15px 20px;
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    flex-direction: column;
    /* Dos líneas */
    gap: 12px;
    align-items: center;
    font-size: 0.85em;
    color: var(--color-acento);
    font-weight: bold;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.chat-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.header-top-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message {
    max-width: 80%;
    padding: 12px 18px;
    border-radius: 20px;
    font-size: 0.95em;
    line-height: 1.4;
}

.ia {
    align-self: flex-start;
    background: #fdfaf5;
    color: #555;
    border: 1px solid #f0f0f0;
}

.ia.thinking {
    font-style: italic;
    color: #999;
    background: #fafaf8;
    animation: simplePulse 2s infinite ease-in-out;
}

@keyframes simplePulse {
    0% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.6;
    }
}

#msg-bienvenida {
    background: #3E3E3E;
    color: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

#msg-bienvenida h1,
#msg-bienvenida h2,
#msg-bienvenida h3 {
    font-size: 1em;
    font-weight: bold;
    margin: 0 0 0.5em 0;
}

#msg-bienvenida strong {
    color: #fff;
    font-weight: bold;
}

.ia-botiquin {
    background: #fdf2f2 !important;
    border: 1px solid #f9dcdc !important;
    position: relative;
    padding-top: 35px !important;
    /* Espacio para el botón 'Oír ejercicio' */
}

.ia p {
    margin: 0 0 0.5em 0;
}

.ia p:last-child {
    margin-bottom: 0;
}

.user {
    align-self: flex-end;
    background: var(--color-acento);
    color: white;
}

.input-area {
    padding: 15px 20px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
}

input {
    flex: 1;
    border: 1px solid #ddd;
    padding: 10px;
    border-radius: 25px;
    outline: none;
}

#sendBtn {
    border: none;
    background: none;
    cursor: pointer;
    color: var(--color-acento);
    font-size: 1.2em;
}

#micBtn {
    background: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    transition: all 0.3s ease;
}

#micBtn:hover {
    background: #e0e0e0;
}

.header-buttons {
    display: none;
    gap: 15px;
    flex-wrap: nowrap;
    justify-content: space-between;
    padding: 10px 15px;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    /* No scrolling needed now */
    box-shadow: none !important;
}

/* Hide scrollbar but keep functionality */
.header-buttons::-webkit-scrollbar {
    display: none;
}

.icon-nav-btn {
    background: transparent !important;
    border: none !important;
    color: var(--color-texto) !important;
    flex: 0 0 45px;
    /* Slightly larger for better PC view */
    width: 45px;
    height: 45px;
    border-radius: 12px;
    /* Square with rounded corners */
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 8px !important;
    box-shadow: none !important;
    filter: none !important;
    /* Ensure no drop-shadow from images */
}

.icon-nav-btn img {
    width: 30px;
    height: 30px;
    object-fit: contain;
    filter: none !important;
    /* Explicitly remove any shadow from the image file itself if exists */
}

.icon-nav-btn:hover {
    transform: translateY(-2px);
    background: #fdfaf5 !important;
}

/* Ajustes para móviles */
@media (max-width: 480px) {
    .header-buttons {
        gap: 6px;
        padding: 5px 10px;
    }

    .icon-nav-btn {
        flex: 0 0 36px;
        width: 36px;
        height: 36px;
        padding: 6px !important;
    }

    .icon-nav-btn img {
        width: 24px;
        height: 24px;
    }
}

.logout-btn {
    background: transparent !important;
    border: none !important;
    color: #e74c3c !important;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 0.75em;
    /* Slightly larger */
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    height: 28px;
    display: flex;
    align-items: center;
    white-space: nowrap;
}

.logout-btn:hover {
    background: #e74c3c !important;
    color: white !important;
}

/* Remove old individual button border/color overrides to avoid conflicts */
#bienvenidaBtn,
#botiquinBtn,
#progresoBtn,
#viajeBtn,
#sesionBtn,
#upgradeBtn,
#ajustesBtn {
    border: none;
}

/* Modal Flotante */
.modal {
    position: fixed;
    z-index: 3000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    display: none;
    /* Controlado por JS, movido desde inline para evitar avisos */
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: #fff;
    padding: 35px;
    border-radius: 20px;
    width: 90%;
    max-width: 550px;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    font-family: var(--fuente-principal);
    /* Fuente del Mentor */
}

.close-modal {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 24px;
    cursor: pointer;
    color: #999;
}

.diario-seccion {
    margin-bottom: 25px;
    border-bottom: 1px dotted #ccc;
    padding-bottom: 15px;
}

.diario-seccion:last-child {
    border-bottom: none;
}

.diario-seccion h4 {
    color: var(--color-acento);
    margin: 0 0 10px 0;
    font-size: 1em;
    text-transform: uppercase;
}

.diario-seccion p {
    font-size: 0.95em;
    line-height: 1.5;
    color: #555;
    margin: 0;
}

/* Barra de Progreso Alquimia */
.progress-bar-container {
    width: 100%;
    height: 12px;
    background: #eee;
    border-radius: 10px;
    overflow: hidden;
    margin-top: 10px;
    border: 1px solid #ddd;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #d4af37, #f1c40f);
    /* Gradiente Dorado */
    border-radius: 10px;
    transition: width 1s ease-in-out;
}


/* Selector de Voz */
.voice-selector-container {
    margin-top: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.8em;
    color: #666;
}

#voiceSelect {
    padding: 4px 8px;
    border-radius: 12px;
    border: 1px solid #ddd;
    background: white;
    font-family: var(--fuente-principal);
    outline: none;
    cursor: pointer;
    font-size: 0.9em;
}

/* Botiquín Refactor */
.tts-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    padding: 5px 12px;
    background-color: var(--color-acento);
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 0.75em;
    cursor: pointer;
    font-family: var(--fuente-principal);
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    z-index: 5;
}

.tts-btn:hover {
    transform: scale(1.05);
    background-color: #726255;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}

.hidden-video-block {
    display: none;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}


/* --- MI VIAJE (ROADMAP) STYLES --- */
#viajeBtn {
    border: 1px solid #D8C608;
    /* Match hover color */
    color: #D8C608;
    background: transparent;
}

#viajeBtn:hover {
    background: #D8C608;
    /* User requested gold */
    color: white !important;
    box-shadow: 0 0 10px #D8C608;
}

/* Modulo Progress Bar */
.module-progress {
    width: 100%;
    background: #f0f0f0;
    height: 6px;
    border-radius: 3px;
    margin-bottom: 20px;
    overflow: hidden;
}

.module-progress-bar {
    height: 100%;
    background: var(--color-acento);
    width: 0%;
    transition: width 0.5s ease;
}

.journey-modal {
    display: none;
    /* Controlado por JS */
}

.journey-content {
    background: #fdfaf7;
    max-width: 800px;
    padding: 40px;
}

.journey-header {
    text-align: center;
    margin-bottom: 30px;
}

.journey-header h2 {
    color: var(--color-acento);
    font-size: 2em;
    margin-bottom: 10px;
}

/* Roadmap Container */
.roadmap-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    /* Reduced gap */
    padding: 12px;
    /* Reduced padding */
    width: 100%;
    max-width: 800px;
    /* Slightly narrower to avoid edges */
    margin: 0 auto;
    box-sizing: border-box;
}

.roadmap-svg-layer {
    display: none;
}

/* Remove old layer */

.roadmap-node {
    display: flex;
    align-items: center;
    gap: 10px;
    /* Reduced gap */
    background: white;
    padding: 12px 15px;
    /* Reduced padding */
    border-radius: 12px;
    border: 2px solid #eee;
    width: 100%;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    box-sizing: border-box;
}

/* Module 5 special: last node spans 2 columns on desktop */
.roadmap-node:nth-child(5) {
    grid-column: span 2;
    max-width: 440px;
    justify-self: center;
}

@media (max-width: 600px) {
    .roadmap-container {
        grid-template-columns: 1fr;
    }

    .roadmap-node:nth-child(5) {
        grid-column: span 1;
    }
}

.roadmap-node.unlocked.completed {
    border-color: #27ae60;
    background: #f0fff4;
}

.roadmap-node.unlocked.completed:hover {
    box-shadow: 0 10px 25px rgba(39, 174, 96, 0.2);
}

.roadmap-node.completed .node-status {
    color: #27ae60;
}

.roadmap-node.locked {
    opacity: 0.6;
    filter: grayscale(1);
    cursor: not-allowed;
    background: #f9f9f9;
}

.roadmap-node.unlocked:hover {
    transform: scale(1.05);
    border-color: var(--color-acento);
    box-shadow: 0 10px 25px rgba(142, 125, 109, 0.2);
}

.roadmap-node .node-icon {
    font-size: 1.5em;
    /* Smaller icon */
    background: #f4ece6;
    width: 40px;
    /* Smaller container */
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    flex-shrink: 0;
}

.roadmap-node .node-info h3 {
    margin: 0;
    color: #4a3b32;
    font-size: 0.9em;
    /* Slightly smaller text */
}

.roadmap-node .node-info p {
    margin: 3px 0 0 0;
    font-size: 0.8em;
    color: #888;
}

.roadmap-line {
    display: none;
    /* Removed old straight line logic */
}

/* --- ESTILOS DE BITÁCORA (MEMORIA DEL VIAJE) --- */
.bitacora-view {
    text-align: left;
    padding: 5px;
    animation: fadeInUp 0.5s ease;
}

.bitacora-header {
    text-align: center;
    margin-bottom: 30px;
    border-bottom: 1px solid #eee;
    padding-bottom: 20px;
}

.bitacora-icon {
    font-size: 3.5em;
    display: block;
    margin-bottom: 15px;
}

.bitacora-header h2 {
    color: var(--color-acento);
    font-size: 1.8em;
    margin-bottom: 8px;
}

.bitacora-header p {
    color: #888;
    font-size: 0.95em;
    font-style: italic;
}

.bitacora-body {
    max-height: 450px;
    overflow-y: auto;
    padding-right: 10px;
    margin-bottom: 25px;
}

.bitacora-entry {
    background: #fdfaf7;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    border-left: 5px solid var(--color-acento);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.bitacora-entry h4 {
    margin: 0 0 15px 0;
    color: var(--color-acento);
    font-size: 1.1em;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.entry-item {
    margin-bottom: 15px;
}

.entry-label {
    font-size: 0.75em;
    text-transform: uppercase;
    color: #aaa;
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.entry-text {
    font-size: 1.05em;
    line-height: 1.6;
    color: #444;
    white-space: pre-wrap;
    /* Mantiene saltos de línea cruciales para las cartas */
    font-family: 'Cambria', 'Georgia', serif;
}

.entry-date {
    font-size: 0.8em;
    color: #ccc;
    text-align: right;
    margin-top: 10px;
    font-style: italic;
}

.bitacora-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.journey-btn.secondary {
    background: #f5f5f5;
    color: #666;
    border: 1px solid #ddd;
}

.journey-btn.danger {
    background: #fff5f5;
    color: #e74c3c;
    border: 1px solid #feb2b2;
}

.journey-btn.danger:hover {
    background: #e74c3c;
    color: white;
}

/* Modulo de Coaching (Preguntas) */
.module-modal {
    display: none;
    z-index: 3050;
    /* Por encima del mapa */
}

.module-content {
    max-width: 600px;
    background: white;
    text-align: center;
    position: relative;
    /* Para posicionar el botón de ayuda */
}

/* --- HELP BUTTON & TOOLTIP (JOURNEY) --- */
.help-modulo-btn {
    position: absolute;
    top: 15px;
    left: 15px;
    /* Movido a la izquierda para evitar choques con la X */
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #f4ece6;
    /* Color suave para no competir con la X */
    color: var(--color-acento);
    border: 1px solid #ddd;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    font-size: 1.1em;
    z-index: 10;
    transition: all 0.3s ease;
}

.help-modulo-btn:hover {
    background: var(--color-acento);
    color: white;
    transform: scale(1.1);
}

#mainHelpBtn {
    display: none;
    /* Hidden by default, shown via JS after auth */
    position: static;
    width: 24px;
    height: 24px;
    font-size: 0.9em;
}

.help-tooltip {
    position: absolute;
    top: 55px;
    right: 15px;
    left: 15px;
    background: rgba(255, 255, 255, 0.98);
    border: 2px solid var(--color-acento);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    z-index: 1002;
    display: none;
    text-align: left;
    animation: fadeInDown 0.3s ease;
    max-height: 400px;
    overflow-y: auto;
    text-transform: none;
    /* Evita heredar el uppercase de la cabecera */
    font-weight: normal;
}

.help-tooltip * {
    font-weight: inherit;
}

.help-tooltip strong,
.help-tooltip b {
    font-weight: bold;
}

#mainHelpTooltip {
    top: 80px;
}

.help-tooltip.active {
    display: block;
}

.help-tooltip h5 {
    margin: 0 0 10px 0;
    color: var(--color-acento);
    font-size: 1.1em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.help-tooltip p {
    margin: 0;
    color: #444;
    font-size: 0.95em;
    line-height: 1.6;
}

/* Estructura de items en la ayuda */
.help-item {
    display: grid;
    grid-template-columns: 55px 1fr;
    gap: 15px;
    align-items: start;
    margin-bottom: 20px;
    border-bottom: 1px dotted #f0f0f0;
    padding-bottom: 10px;
}

.help-item:last-child {
    border-bottom: none;
}

.help-desc {
    font-size: 0.95em;
    line-height: 1.5;
    color: #444;
}

.help-btn-tag {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f4ece6;
    width: 55px;
    height: 55px;
    border-radius: 12px;
    border: 1px solid #ddd;
}

.help-btn-tag img {
    width: 40px !important;
    height: 40px !important;
    object-fit: contain;
}

/* Tags especiales para botones de texto en la ayuda */
.logout-tag,
.text-tag,
.mic-tag {
    font-size: 0.6em;
    font-weight: bold;
    color: #e74c3c;
}

.text-tag {
    color: var(--color-acento);
    font-size: 0.7em;
}

.mic-tag {
    font-size: 1.2em;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 600px) {
    .help-modulo-btn {
        left: 12px;
        top: 12px;
        width: 26px;
        height: 26px;
        font-size: 1em;
    }

    .help-tooltip {
        top: 50px;
        padding: 15px;
    }
}

.question-slide {
    animation: fadeIn 0.5s ease;
}

.question-slide h4 {
    color: var(--color-acento);
    text-transform: uppercase;
    font-size: 0.85em;
    letter-spacing: 1px;
    margin-bottom: 20px;
}

.question-slide h3 {
    font-size: 1.4em;
    color: #333;
    margin-bottom: 30px;
    line-height: 1.4;
}

.question-slide input,
.question-slide textarea {
    width: 100%;
    box-sizing: border-box;
    /* Fixes width calculation including padding */
    padding: 15px;
    font-size: 1.1em;
    border: 2px solid #eee;
    border-radius: 10px;
    font-family: var(--fuente-principal);
    transition: border-color 0.3s;
}

.question-slide textarea {
    height: 150px;
    resize: vertical;
}

/* Journey button styling (for intro/module screens) */
.journey-btn {
    background: var(--color-acento);
    color: white;
    border: none;
    border-radius: 25px;
    /* Pill shape */
    padding: 12px 30px;
    font-size: 1.1em;
    font-weight: bold;
    font-family: var(--fuente-principal);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(142, 125, 109, 0.3);
}

.journey-btn:hover {
    background: #b8935f;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(142, 125, 109, 0.4);
}

.question-slide input:focus,
.question-slide textarea:focus {
    border-color: var(--color-acento);
    outline: none;
}

.module-navigation {
    margin-top: 30px;
    display: flex;
    justify-content: space-between;
    gap: 15px;
}

.nav-btn {
    padding: 10px 25px;
    border-radius: 25px;
    border: none;
    cursor: pointer;
    font-weight: bold;
    font-family: var(--fuente-principal);
    transition: all 0.3s;
}

#prevQBtn {
    background: #f0f0f0;
    color: #555;
}

#nextQBtn {
    background: var(--color-acento);
    color: white;
}

.finish-btn {
    background: #27ae60 !important;
    color: white !important;
}

#finishModuleBtn {
    display: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Transition/Loading screen styles */
.loading-alchemy {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.alchemy-circle {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 2px solid var(--color-acento);
    border-radius: 50%;
    border-top-color: transparent;
    animation: rotate-alchemy 2s linear infinite;
    opacity: 0.5;
}

.alchemy-circle::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    border: 2px solid var(--color-acento);
    border-radius: 50%;
    border-bottom-color: transparent;
    animation: rotate-alchemy 3s linear reverse infinite;
    opacity: 0.3;
}

.alchemy-icon {
    font-size: 3em;
    animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes rotate-alchemy {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes pulseGlow {

    0%,
    100% {
        transform: scale(1);
        filter: drop-shadow(0 0 5px rgba(216, 198, 8, 0.4));
    }

    50% {
        transform: scale(1.1);
        filter: drop-shadow(0 0 15px rgba(216, 198, 8, 0.8));
    }
}

.transition-screen h3 {
    animation: fadeInUp 0.8s ease both;
}

.transition-screen p {
    animation: fadeInUp 0.8s ease 0.3s both;
}

/* --- MODULE 3 ROLE CARDS --- */
.role-cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
    padding: 10px;
}

.role-card {
    background: white;
    border: 2px solid #eee;
    border-radius: 15px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.role-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: var(--color-acento);
    box-shadow: 0 15px 30px rgba(142, 125, 109, 0.2);
}

.role-card-icon {
    font-size: 2.5em;
    margin-bottom: 12px;
}

.role-card h3 {
    font-size: 1.1em;
    color: #4a3b32;
    margin: 0 0 10px 0;
}

.role-card-lema {
    font-size: 0.85em;
    color: #666;
    font-style: italic;
    line-height: 1.4;
    margin: 0 0 15px 0;
}

.role-card-impacto {
    font-size: 0.75em;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-top: 1px solid #f0f0f0;
    padding-top: 10px;
    width: 100%;
}

/* --- MODULO 4: EL ALTAR DE LAS PALABRAS --- */
.pergamino-container {
    background: #fdf5e6;
    border: 2px solid #d2b48c;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05), inset 0 0 40px rgba(139, 69, 19, 0.08);
    position: relative;
    overflow: hidden;
    margin-top: 10px;
}

.pergamino-input {
    width: 100%;
    min-height: 250px;
    background: transparent;
    border: none;
    font-family: 'Cambria', 'Georgia', serif;
    font-size: 1.15em;
    line-height: 1.8;
    color: #4a3728;
    resize: none;
    outline: none;
    transition: all 1.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.ritual-closure-ui {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 10px;
    text-align: center;
}

.ritual-vibration {
    font-size: 5em;
    margin: 20px 0;
    filter: drop-shadow(0 0 5px var(--color-acento));
    animation: pulse-vibration 2s infinite ease-in-out;
}

.sellar-btn {
    background: linear-gradient(135deg, #be9c7d, #8b4513);
    color: white;
    border: none;
    padding: 16px 45px;
    font-size: 1.1em;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(139, 69, 19, 0.3);
    transition: all 0.4s;
    letter-spacing: 1px;
    margin-top: 20px;
}

.sellar-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(139, 69, 19, 0.5);
    background: linear-gradient(135deg, #d2b48c, #a0522d);
}

.transmuting {
    filter: blur(30px) brightness(5) saturate(0);
    opacity: 0;
    transform: scale(1.2);
    pointer-events: none;
    transition: all 2s cubic-bezier(0.4, 0, 0.2, 1);
}

.ritual-flash {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle, #fff 0%, rgba(255, 255, 255, 0) 80%);
    opacity: 0;
    pointer-events: none;
    z-index: 100;
    transition: opacity 0.5s ease-in;
}

.ritual-flash.active {
    opacity: 1;
}

@keyframes pulse-vibration {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }

    50% {
        transform: scale(1.1);
        opacity: 1;
        filter: drop-shadow(0 0 25px var(--color-acento));
    }

    100% {
        transform: scale(1);
        opacity: 0.8;
    }
}

.question-slide {
    transition: all 0.5s ease-out;
}

/* --- MODULO 5: ALQUIMIA FINAL --- */
.transmuter-grid {
    display: grid;
    grid-template-columns: 1fr 40px 1fr;
    gap: 20px;
    align-items: center;
    margin-top: 15px;
}

.belief-box {
    padding: 15px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
}

.belief-box.limiting {
    background: #fff5f5;
    border: 1px dashed #feb2b2;
}

.belief-box.empowering {
    background: #f0fff4;
    border: 1px solid #9ae6b4;
}

.belief-box label {
    font-size: 0.85em;
    font-weight: 600;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.belief-box.limiting label {
    color: #c53030;
}

.belief-box.empowering label {
    color: #2f855a;
}

.belief-box textarea {
    background: transparent;
    border: none;
    resize: none;
    min-height: 120px;
    font-size: 1em;
    color: #333;
    outline: none;
}

.transmuter-arrow {
    text-align: center;
    font-size: 1.5em;
    color: var(--color-primario);
    opacity: 0.6;
}

.purpose-acts {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.purpose-act {
    background: white;
    padding: 15px;
    border-radius: 10px;
    border: 1px solid #eee;
}

.purpose-act h5 {
    margin: 0 0 8px 0;
    color: var(--color-acento);
}

.guide-note {
    font-size: 0.8em;
    color: #999;
    margin-bottom: 5px;
}

.action-plan-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.plan-section {
    background: #f8fbff;
    padding: 15px;
    border-radius: 12px;
    border: 1px solid #e1e7f0;
}

.plan-section h5 {
    margin: 0 0 10px 0;
    color: #2b6cb0;
}

.plan-section textarea {
    width: 100%;
    background: transparent;
    border: none;
    min-height: 150px;
    font-size: 1.05em;
    resize: none;
    outline: none;
}

@media (max-width: 768px) {

    .transmuter-grid,
    .action-plan-grid {
        grid-template-columns: 1fr;
    }

    .transmuter-arrow {
        transform: rotate(90deg);
        margin: 10px 0;
    }
}

/* --- DIPLOMA DE ALQUIMISTA --- */
.diploma-container {
    background: #fff;
    padding: 40px;
    border: 15px solid #d4af37;
    /* Dorado */
    outline: 5px solid #8b4513;
    /* Cuero/Marrón */
    outline-offset: -10px;
    text-align: center;
    position: relative;
    max-width: 600px;
    margin: 20px auto;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
    font-family: 'Playfair Display', 'Georgia', serif;
}

.diploma-header {
    font-size: 0.9em;
    letter-spacing: 3px;
    color: #8b4513;
    text-transform: uppercase;
    margin-bottom: 20px;
}

.diploma-title {
    font-size: 2.2em;
    color: var(--color-primario);
    margin: 15px 0;
}

.diploma-text {
    font-size: 1.1em;
    line-height: 1.6;
    color: #444;
}

.diploma-vision {
    display: inline-block;
    margin-top: 30px;
    padding: 25px;
    background: #fdfaf0;
    border-top: 1px solid #d4af37;
    border-bottom: 1px solid #d4af37;
    font-style: italic;
    font-size: 1.3em;
    color: #a0522d;
    max-width: 90%;
    word-wrap: break-word;
}

.diploma-footer {
    margin-top: 40px;
    font-size: 0.9em;
    color: #777;
    display: flex;
    justify-content: space-around;
}

.diploma-shine {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.4) 50%, rgba(255, 255, 255, 0) 100%);
    transform: rotate(30deg);
    animation: shine-diploma 5s infinite;
    pointer-events: none;
}

@keyframes shine-diploma {
    0% {
        transform: scale(1) rotate(30deg) translateX(-100%);
    }

    20% {
        transform: scale(1) rotate(30deg) translateX(100%);
    }

    100% {
        transform: scale(1) rotate(30deg) translateX(100%);
    }
}

/* Botones en el chat */
.audio-btn,
.chat-logout-btn {
    display: block;
    margin-top: 10px;
    padding: 8px 15px;
    border: 1px solid var(--color-acento);
    background: transparent;
    color: var(--color-acento);
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85em;
    transition: all 0.3s ease;
    width: fit-content;
}

.audio-btn:hover,
.chat-logout-btn:hover {
    background: var(--color-acento);
    color: white;
}

.chat-logout-btn {
    background: var(--color-acento);
    color: white;
    font-weight: bold;
    border: none;
    box-shadow: 0 4px 10px rgba(142, 125, 109, 0.3);
}

.chat-logout-btn:hover {
    background: #7a6b5d;
    transform: translateY(-2px);
}

/* --- ESTILOS MEJORAR PLAN (PREMIUM) --- */
.upgrade-btn {
    display: none;
    /* Se activa vía JS en main.js */
    background: linear-gradient(135deg, #d4af37, #b8860b);
    color: white !important;
    font-weight: bold !important;
    border: none !important;
    box-shadow: 0 4px 12px rgba(184, 134, 11, 0.3);
    border-radius: 20px;
}

.upgrade-btn:hover {
    background: linear-gradient(135deg, #e5c158, #d4af37);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(184, 134, 11, 0.5);
}

.premium-btn {
    display: none;
    background: linear-gradient(135deg, #1a73e8, #0d47a1);
    color: white !important;
    font-weight: bold !important;
    border: none !important;
    box-shadow: 0 4px 12px rgba(13, 71, 161, 0.3);
    border-radius: 20px;
}

.premium-btn:hover {
    background: linear-gradient(135deg, #4285f4, #1a73e8);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(13, 71, 161, 0.5);
}

.upgrade-modal-content {
    max-width: 700px;
    background: #fff;
    border-radius: 20px;
    padding: 30px;
    text-align: center;
}

.upgrade-options {
    display: flex;
    gap: 20px;
    margin-top: 30px;
    justify-content: center;
}

.upgrade-card {
    flex: 1;
    border: 2px solid #f4ece6;
    border-radius: 15px;
    padding: 25px;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 300px;
}

.upgrade-card:hover {
    border-color: #d4af37;
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.upgrade-card h3 {
    color: #4a3b32;
    margin-bottom: 15px;
    font-size: 1.25em;
}

.upgrade-card p {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 25px;
    flex-grow: 1;
}

.upgrade-card.pro {
    background: #fffaf0;
}

.upgrade-card.premium {
    background: #faf8f6;
    border-color: #d4af37;
    position: relative;
}

.upgrade-card.premium::after {
    content: 'Recomendado';
    position: absolute;
    top: -12px;
    background: #d4af37;
    color: white;
    font-size: 0.7em;
    padding: 2px 10px;
    border-radius: 10px;
    text-transform: uppercase;
    font-weight: bold;
}

.btn-upgrade {
    background: var(--color-acento);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
}

.btn-upgrade:hover {
    background: #4a3b32;
    transform: scale(1.05);
}

@media (max-width: 600px) {
    .upgrade-options {
        flex-direction: column;
        align-items: center;
    }

    .upgrade-card {
        width: 100%;
    }

    /* Ajuste global de modales para móviles */
    .modal-content {
        padding: 15px !important;
        /* Slightly less padding */
        width: 98% !important;
        /* Maximize width */
    }

    .session-group {
        padding: 12px !important;
        /* Avoid internal overflow */
        margin-top: 15px !important;
    }

    .booking-options {
        flex-direction: column !important;
        gap: 8px !important;
    }

    .btn-booking {
        width: 100% !important;
        font-size: 0.85em !important;
    }
}

/* --- ESTILOS MODAL SESIÓN --- */
.sesion-modal-content {
    max-width: 600px;
}

.session-quota-info {
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid #1a73e8;
}

.quota-badge {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.quota-label {
    font-weight: 600;
    color: #555;
}

.quota-value {
    font-size: 1.2em;
    font-weight: bold;
    color: #1a73e8;
}

.session-group {
    margin-top: 25px;
    padding: 20px;
    border: 1px solid #eee;
    border-radius: 12px;
}

.session-group.extra {
    background: #fffdf5;
    border-color: #ffe082;
}

.session-group h3 {
    margin-bottom: 5px;
    font-size: 1.1em;
}

.session-desc {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 20px;
}

.booking-options {
    display: flex;
    gap: 15px;
}

.btn-booking {
    flex: 1;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #1a73e8;
    background: white;
    color: #1a73e8;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-booking:hover:not(:disabled) {
    background: #1a73e8;
    color: white;
}

.btn-booking:disabled {
    border-color: #ccc;
    color: #999;
    cursor: not-allowed;
}

.btn-extra {
    border-color: #d4af37;
    color: #b8860b;
}

.btn-extra:hover {
    background: #d4af37 !important;
    color: white !important;
}

#ajustesBtn {
    border: 1px solid #7f8c8d;
    color: #7f8c8d;
}

#ajustesBtn:hover {
    background: #7f8c8d;
    color: white;
}

/* --- SETTINGS MODAL STYLES --- */
.settings-modal-content {
    max-width: 500px;
}

.settings-section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.settings-section:last-of-type {
    border-bottom: none;
}

.settings-section h3 {
    color: var(--color-acento);
    font-size: 1.1em;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.profile-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fdfaf7;
    padding: 15px 25px;
    border-radius: 12px;
    border: 1px solid #f0f0f0;
    margin-bottom: 25px;
}

.info-value {
    color: var(--color-acento);
    font-size: 1.1em;
    font-family: var(--fuente-principal);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: bold;
}

/* Slider Customization */
.slider-group {
    margin-bottom: 25px;
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    font-size: 0.8em;
    color: #666;
    margin-bottom: 8px;
    font-weight: bold;
}

.slider-labels span:nth-child(2) {
    width: 100%;
    text-align: center;
    color: var(--color-acento);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.75em;
    order: -1;
    margin-bottom: 5px;
}

.settings-section input[type="range"] {
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: #ddd;
    border-radius: 5px;
    outline: none;
    margin: 10px 0;
}

.settings-section input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: var(--color-acento);
    cursor: pointer;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* Preferences Styling */
.setting-item {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.setting-item label {
    font-size: 0.8em;
    font-weight: bold;
    color: var(--color-acento);
}

.setting-item select,
.setting-item textarea {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: var(--fuente-principal);
    font-size: 0.8em;
}

.setting-item textarea {
    height: 80px;
    resize: none;
}

/* Actions */
.settings-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: auto auto;
    gap: 10px;
    margin-top: 25px;
    width: 100%;
}

.save-btn,
.danger-btn,
.preferences-btn {
    min-height: 60px;
    /* Uniform height to handle multiple lines */
    padding: 8px 5px;
    font-size: 0.8em;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s;
    box-sizing: border-box;
}

.save-btn {
    background: var(--color-acento);
    color: white;
    border: none;
}

.save-btn:hover {
    background: #726255;
    transform: translateY(-2px);
}

.danger-btn {
    background: #fff;
    color: #e74c3c;
    border: 1px solid #e74c3c;
}

.danger-btn:hover {
    background: #e74c3c;
    color: white;
}

.danger-zone {
    display: contents;
}

.danger-hint {
    grid-column: 1 / span 3;
    grid-row: 2;
    /* Force second row */
    font-size: 0.75em;
    color: #888;
    margin-top: 10px;
    line-height: 1.4;
    text-align: center;
    padding: 12px;
    background: #fffcf0;
    border-radius: 12px;
    border: 1px dashed #ffe082;
}

.preferences-btn {
    background: #fdfaf7;
    color: var(--color-acento);
    border: 1px solid var(--color-acento);
    text-decoration: none;
}

.preferences-btn:hover {
    background: var(--color-acento);
    color: white;
}

@media (max-width: 600px) {
    .settings-actions {
        flex-direction: column-reverse;
    }

    .profile-info {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
}

/* Footer de la App */
.app-footer {
    padding: 20px 0;
    text-align: center;
    width: 100%;
    color: #999;
    font-size: 0.75em;
    font-family: var(--fuente-principal);
}

.app-footer p {
    margin: 0;
}

/* Estilos para el Modal Legal */
.legal-modal-content {
    max-width: 600px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.legal-intro {
    font-style: italic;
    color: #666;
    margin-bottom: 10px;
}

.legal-scroll-area {
    background: #f9f9f9;
    border: 1px solid #eee;
    padding: 15px;
    border-radius: 12px;
    max-height: 200px;
    overflow-y: auto;
    font-size: 0.9em;
    line-height: 1.6;
}

.legal-section h3 {
    font-size: 1em;
    margin: 15px 0 8px;
    color: var(--color-primario);
}

.legal-section p {
    margin-bottom: 15px;
}

.legal-checks {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 10px 0;
    text-align: left;
    /* Asegura alineación a la izquierda */
    align-items: flex-start;
    /* Evita que se estiren o centren */
}

.check-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 0.9em;
    color: #444;
    text-align: left;
    margin-left: 0;
    padding-left: 0;
}

.check-item input {
    margin-top: 4px;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    /* Evita que el check se encoja si el texto es largo */
}

.legal-actions {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

.cancel-btn {
    flex: 1;
    background: #f5f5f5;
    color: #666;
    border: 1px solid #ddd;
    padding: 12px;
    border-radius: 25px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.cancel-btn:hover {
    background: #eee;
}

#confirmLegalBtn:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.7;
}

.privacy-notice-box {
    background: #fff4e5;
    border-left: 4px solid var(--color-acento);
    padding: 12px 15px;
    margin: 20px 0;
    border-radius: 4px;
    font-size: 0.95em;
    line-height: 1.4;
    color: #444;
}