

/* --- VARIABLES DE COLOR (IDENTIDAD PALIA) --- */
:root {
    /* Verde Menta (Serenidad) */
    --color-mint: #A8E6CF; 
    /* Azul Pastel (Calma) */
    --color-pastel-blue: #D1E8E2;
    /* Color de acento más fuerte para botones/textos */
    --color-primary: #5D8A82; 
    /* Color de texto oscuro (Gris oscuro, mejor que negro puro) */
    --text-color: #2C3E50;
    /* Blanco */
    --white: #ffffff;
}

/* --- ESTILOS GENERALES --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Lato', sans-serif;
    color: var(--text-color);
    line-height: 1.6;
    background-color: #f9fdfb; /* Fondo muy sutil */
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

a {
    text-decoration: none;
    color: var(--text-color);
}

ul {
    list-style: none;
}

/* --- HEADER / NAVEGACIÓN --- */
.main-header {
    background-color: var(--white);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 90px;
}

.logo {
    display: flex;
    align-items: center;
}

.logo img {
    height: 80px; /* Altura controlada para el menú superior */
    width: auto;  /* El ancho se ajusta solo para no deformarse */
    object-fit: contain;
}

.main-header nav ul {
    display: flex;
    gap: 20px;
    align-items: center;
}

.btn-login {
    background-color: var(--color-primary);
    color: var(--white);
    padding: 8px 15px;
    border-radius: 20px;
    transition: background 0.3s;
}

.btn-login:hover {
    background-color: #4a6e68;
}

/* --- HERO SECTION --- */
.hero {
    background: linear-gradient(to right, var(--color-pastel-blue), var(--color-mint));
    height: 80vh; /* 80% de la altura de la pantalla */
    display: flex;
    align-items: center;
    text-align: center;
}

.hero-content h1 {
    font-size: 3rem;
    margin-bottom: 20px;
    color: var(--text-color);
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/*.hero-buttons .btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 5px;
    margin: 0 10px;
    font-weight: bold;
}*/


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

.btn-secondary {
    background-color: var(--white);
    color: var(--text-color);
    border: 1px solid var(--text-color);
}

/* --- SERVICIOS --- */
.services {
    padding: 60px 0;
    background-color: var(--white);
}

.services h2 {
    text-align: center;
    margin-bottom: 40px;
    font-size: 2rem;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.card {
    background: #f4fbf9;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    transition: transform 0.3s;
}

.card:hover {
    transform: translateY(-5px);
}

.card h3 {
    margin-bottom: 15px;
    color: var(--color-primary);
}

/* --- FOOTER --- */
footer {
    background-color: var(--text-color);
    color: var(--white);
    text-align: center;
    padding: 20px 0;
    margin-top: auto;
}

/* --- ESTILOS ESPECÍFICOS DEL LOGIN --- */

/* Fondo especial para la página de login */
.login-page {
    background: linear-gradient(135deg, var(--color-pastel-blue), var(--color-mint));
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.login-container {
    width: 100%;
    padding: 20px;
}

.login-card {
    background-color: var(--white);
    max-width: 400px;
    margin: 0 auto;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    text-align: center;
}

.login-header {
    margin-bottom: 30px;
}

.login-header h2 {
    color: var(--text-color);
    margin-top: 10px;
}

.login-header p {
    font-size: 0.9rem;
    color: #7f8c8d;
}

/* Estilos de los inputs (campos de texto) */
.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #eee;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--color-mint); /* Se ilumina verde al escribir */
}

/* Botón ancho completo */
.btn-block {
    width: 100%;
    margin-top: 10px;
    cursor: pointer;
    border: none;
    font-size: 1rem;
}

.login-footer {
    margin-top: 20px;
    font-size: 0.9rem;
}

.login-footer a {
    color: var(--color-primary);
    font-weight: bold;
}

.forgot-pass {
    color: #95a5a6 !important;
    font-weight: normal !important;
    font-size: 0.85rem;
}

/* --- ESTILOS DEL DASHBOARD --- */

.dashboard-body {
    background-color: #f0f7f4;
    height: 100vh;
    overflow: hidden; /* Evita scroll doble */
}

.dashboard-container {
    display: flex; /* Esto pone el menú al lado del contenido */
    height: 100%;
}

/* Sidebar (Menú Lateral) */
.sidebar {
    width: 260px;
    background-color: var(--white);
    display: flex;
    flex-direction: column;
    border-right: 1px solid #e1e1e1;
    transition: all 0.3s;
}

.sidebar-header {
    padding: 20px;
    text-align: center;
    background-color: var(--white);
    border-bottom: 1px solid #f0f0f0;
}

.sidebar-header h2 {
    display: none;
}

.sidebar-header img {
    max-width: 100%; /* Que ocupe el 80% del ancho de la barra */
    height: auto;
    max-height: 80px; /* Límite de altura para que no sea enorme */
    display: block;
    margin: 0 auto; /* Centrado horizontal */
}

.sidebar-nav {
    flex: 1; /* Ocupa el espacio disponible */
    padding-top: 20px;
}

.sidebar-nav ul li a {
    display: block;
    padding: 15px 25px;
    color: #666;
    transition: all 0.3s;
    font-size: 1rem;
}

.sidebar-nav ul li a:hover, 
.sidebar-nav ul li.active a {
    background-color: var(--color-pastel-blue);
    color: var(--color-primary);
    border-left: 4px solid var(--color-primary);
}

.sidebar-nav ul li a i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid #f0f0f0;
}

.logout-btn {
    color: #e74c3c; /* Rojo suave para salir */
    display: block;
    padding: 10px;
}

/* Contenido Principal */
.main-content {
    flex: 1; /* Ocupa el resto del ancho */
    overflow-y: auto; /* Permite scroll solo aquí */
    padding: 30px;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.user-welcome h1 {
    color: var(--color-primary);
    font-size: 1.8rem;
}

.user-avatar img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid var(--color-mint);
}

/* Tarjetas del Dashboard */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.dash-card {
    background: var(--white);
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.03);
    transition: transform 0.2s;
    border-top: 4px solid transparent;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.dash-card:hover {
    transform: translateY(-3px);
}

/* Colores específicos para cada tarjeta */
.status-card { border-top-color: var(--color-primary); }
.ia-card { border-top-color: #3498db; }
.appointment-card { border-top-color: #e67e22; }

.dash-card h3 {
    margin: 10px 0;
    color: var(--text-color);
}

.card-icon {
    font-size: 2rem;
    color: var(--color-mint);
    margin-bottom: 10px;
}

.btn-sm {
    font-size: 0.9rem;
    padding: 8px 16px;
    margin-top: 10px;
}

/* Actividad Reciente */
.recent-activity {
    background: var(--white);
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.03);
}

.activity-list li {
    padding: 10px 0;
    border-bottom: 1px solid #f9f9f9;
    color: #555;
}

.activity-list li i {
    color: var(--color-primary);
    margin-right: 10px;
}

/* --- ESTILOS DEL CHATBOT --- */

.chat-body {
    background-color: #e5ddd5; /* Color neutro de fondo */
    background: linear-gradient(to bottom, var(--color-pastel-blue), #f0f2f5);
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.chat-header {
    background-color: var(--color-primary);
    color: var(--white);
    padding: 15px;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.back-btn {
    color: var(--white);
    margin-right: 20px;
    font-size: 0.9rem;
}

.bot-info {
    display: flex;
    align-items: center;
}

.bot-avatar {
    width: 40px;
    height: 40px;
    background-color: var(--white);
    color: var(--color-primary);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 10px;
    font-size: 1.2rem;
}

.bot-info h3 { font-size: 1rem; margin: 0; }
.bot-info p { font-size: 0.75rem; opacity: 0.8; margin: 0; }

/* Contenedor de mensajes (Scrollable) */
.chat-container {
    flex: 1;
    padding: 20px;
    overflow-y: auto; /* Permite hacer scroll si hay muchos mensajes */
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Burbujas de mensaje */
.message {
    max-width: 80%;
    display: flex;
}

.message-content {
    padding: 10px 15px;
    border-radius: 10px;
    position: relative;
    font-size: 0.95rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.time {
    display: block;
    font-size: 0.65rem;
    color: #999;
    text-align: right;
    margin-top: 5px;
}

/* Estilos específicos Bot vs Usuario */
.bot-message {
    align-self: flex-start; /* Izquierda */
}

.bot-message .message-content {
    background-color: var(--white);
    border-top-left-radius: 0; /* Pico de la burbuja */
    color: var(--text-color);
}

.user-message {
    align-self: flex-end; /* Derecha */
}

.user-message .message-content {
    background-color: #dcf8c6; /* Verde tipo WhatsApp */
    background-color: var(--color-mint); /* Nuestro verde PALIA */
    border-top-right-radius: 0;
    color: var(--text-color);
}

/* Área de Input Fija abajo */
.chat-input-area {
    background-color: #f0f0f0;
    padding: 10px 20px;
}

.chat-input-area form {
    display: flex;
    gap: 10px;
}

#userInput {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 25px;
    outline: none;
}

.send-btn {
    background-color: var(--color-primary);
    color: var(--white);
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s;
}

.send-btn:hover {
    transform: scale(1.1);
}

/* --- CORRECCIÓN GLOBAL DE BOTONES (ESTILO UNIFICADO) --- */

/* Estilo base para TODOS los botones de la web */
.btn {
    display: inline-block;
    padding: 10px 25px;
    border-radius: 8px; /* Bordes redondeados modernos */
    font-weight: bold;
    text-decoration: none; /* Quita el subrayado de los enlaces */
    text-align: center;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

/* Colores Base */
.btn-primary {
    background-color: var(--color-primary); /* Nuestro verde oscuro */
    color: var(--white);
}

.btn-primary:hover {
    background-color: #4a6e68; /* Un poco más oscuro al pasar el ratón */
    transform: translateY(-2px); /* Pequeño efecto de elevación */
}

.btn-secondary {
    background-color: transparent;
    color: var(--text-color);
    border: 2px solid var(--text-color);
}

.btn-secondary:hover {
    background-color: var(--text-color);
    color: var(--white);
}

/* --- AJUSTE ESPECÍFICO PARA TARJETAS DEL DASHBOARD --- */
.dash-card .btn {
    display: block; /* Hace que el botón ocupe todo el ancho */
    width: 100%;
    margin-top: auto; /* Separación con el texto de arriba */
    padding: 12px;
    font-size: 0.95rem;
}

/* Corrección pequeña para los botones del Hero (para que no se peguen) */
.hero-buttons .btn {
    margin: 0 10px;
}

/* --- ESTILOS DEL REGISTRO DE SÍNTOMAS --- */

.registro-grid {
    display: grid;
    grid-template-columns: 2fr 1fr; /* El formulario es más ancho que el historial */
    gap: 20px;
}

.form-card, .history-card {
    background: var(--white);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.03);
}

.form-label {
    font-weight: bold;
    color: var(--color-primary);
    margin-bottom: 15px;
    display: block;
    font-size: 1.1rem;
}

/* Slider de Dolor */
.range-container {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 15px 0;
}

input[type=range] {
    flex: 1;
    cursor: pointer;
    accent-color: var(--color-primary); /* Color del slider */
}

output {
    font-weight: bold;
    font-size: 1.5rem;
    color: var(--color-primary);
    width: 30px;
    text-align: center;
}

/* Selector de Ánimo (Emojis) */
.mood-selector {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 10px;
}

.mood-option {
    text-align: center;
    cursor: pointer;
    padding: 10px;
    border-radius: 10px;
    border: 2px solid transparent;
    transition: all 0.2s;
    font-size: 1.5rem;
    flex: 1;
}

.mood-option span {
    display: block;
    font-size: 0.8rem;
    margin-top: 5px;
    color: #666;
}

.mood-option:hover {
    background-color: #f0f7f4;
}

/* Clase para cuando un emoji está seleccionado */
.mood-option.selected {
    border-color: var(--color-primary);
    background-color: var(--color-pastel-blue);
    transform: scale(1.05);
}

/* Historial */
.history-list {
    list-style: none;
    margin-top: 20px;
}

.history-item {
    border-left: 4px solid var(--color-primary);
    background-color: #f9f9f9;
    padding: 10px 15px;
    margin-bottom: 10px;
    border-radius: 0 5px 5px 0;
}

.history-date {
    font-size: 0.8rem;
    color: #999;
}

.history-details {
    font-weight: bold;
    color: var(--text-color);
}

/* --- ESTILOS DEL FORO --- */

.forum-filters {
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
}

.filter-btn {
    background: none;
    border: none;
    padding: 8px 16px;
    cursor: pointer;
    border-radius: 20px;
    color: #666;
    font-weight: bold;
    transition: all 0.2s;
}

.filter-btn.active, .filter-btn:hover {
    background-color: var(--color-pastel-blue);
    color: var(--color-primary);
}

/* Área de nuevo post */
.new-post-area {
    margin-bottom: 30px;
    animation: fadeIn 0.3s;
}

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

/* Tarjetas de Publicación */
.forum-feed {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.post-card {
    background: var(--white);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
    border-left: 4px solid var(--color-mint); /* Borde decorativo */
}

.post-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    align-items: center;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: bold;
    color: var(--text-color);
}

.user-avatar-small {
    width: 30px;
    height: 30px;
    background-color: var(--color-pastel-blue);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.8rem;
    color: var(--color-primary);
}

.post-category-badge {
    background-color: #f0f0f0;
    padding: 4px 10px;
    border-radius: 10px;
    font-size: 0.75rem;
    color: #666;
}

.post-content {
    font-size: 1rem;
    color: #444;
    line-height: 1.5;
    margin-bottom: 15px;
}

.post-footer {
    border-top: 1px solid #f9f9f9;
    padding-top: 10px;
    display: flex;
    gap: 20px;
    color: #888;
    font-size: 0.9rem;
}

.post-action {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
}

.post-action:hover {
    color: var(--color-primary);
}

/* --- ESTILOS DE CITAS MÉDICAS --- */

.citas-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

.doctor-card-profile {
    background: var(--white);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.03);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.doctor-photo img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--color-mint);
    margin-bottom: 20px;
}

.specialty {
    color: var(--color-primary);
    font-weight: bold;
    display: block;
    margin-bottom: 10px;
}

.doctor-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    justify-content: center;
}

.widget-card {
    background: var(--white);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.03);
    margin-bottom: 20px;
}

.widget-card h3 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: var(--text-color);
    border-bottom: 2px solid var(--color-pastel-blue);
    padding-bottom: 10px;
}

/* Lista de citas */
.appointment-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.date-box {
    background-color: #f0f7f4;
    padding: 5px 10px;
    border-radius: 8px;
    text-align: center;
    min-width: 60px;
}

.date-box .day { font-size: 0.7rem; display: block; font-weight: bold; color: #888; }
.date-box .time { font-size: 1rem; font-weight: bold; color: var(--color-primary); }

.appt-details { flex: 1; }
.appt-details strong { display: block; font-size: 0.95rem; }
.appt-details span { font-size: 0.8rem; color: #666; }

.status-badge {
    background-color: #e8f5e9;
    color: #2e7d32;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
}

/* --- ESTILOS DE LA VIDEOLLAMADA --- */

.call-body {
    background-color: #202124; /* Fondo oscuro tipo Google Meet */
    margin: 0;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.video-container {
    width: 90%;
    height: 90%;
    position: relative;
    background-color: #000;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.remote-video {
    width: 100%;
    height: 100%;
    position: relative;
}

.remote-video img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Cubre todo el espacio */
    opacity: 0.9;
}

.remote-label {
    position: absolute;
    bottom: 20px;
    left: 20px;
    color: white;
    background-color: rgba(0,0,0,0.5);
    padding: 5px 15px;
    border-radius: 5px;
    font-weight: bold;
}

/* Tu cámara pequeña */
.local-video {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 200px;
    height: 150px;
    background-color: #333;
    border-radius: 10px;
    border: 2px solid rgba(255,255,255,0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.camera-placeholder {
    color: #888;
    text-align: center;
}

/* Barra de controles */
.call-controls {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 20px;
    z-index: 20;
    background-color: rgba(0,0,0,0.6);
    padding: 15px 30px;
    border-radius: 30px;
}

.control-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: white;
    background-color: #3c4043;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s;
}

.control-btn:hover { background-color: #5f6368; }

.control-btn.off {
    background-color: #ea4335; /* Rojo cuando está apagado */
}

.hangup-btn {
    background-color: #ea4335;
    width: 60px; /* Un poco más grande para colgar */
}

.hangup-btn:hover { background-color: #d93025; }

/* --- ADAPTACIÓN RESPONSIVE (MÓVIL) --- */

@media (max-width: 768px) {
    
    /* 1. Cambiamos la dirección del contenedor principal */
    .dashboard-container {
        flex-direction: column; /* Pone el menú y el contenido uno sobre otro */
        height: auto; /* Quitamos la altura fija */
    }

    /* 2. Transformamos la Sidebar en una Barra de Navegación Inferior */
    .sidebar {
        width: 100%; /* Ancho completo */
        height: auto;
        order: 2; /* La mandamos al final (abajo del todo) */
        position: fixed;
        bottom: 0;
        left: 0;
        z-index: 1000;
        border-right: none;
        border-top: 1px solid #e1e1e1;
        flex-direction: row; /* Elementos en horizontal */
        padding: 0;
    }

    .sidebar-header, .sidebar-footer {
        display: none; /* Ocultamos el logo y el botón salir en móvil para ganar espacio */
    }

    .sidebar-nav {
        padding-top: 0;
        width: 100%;
    }

    .sidebar-nav ul {
        display: flex;
        justify-content: space-around; /* Reparte los iconos equitativamente */
    }

    .sidebar-nav ul li a {
        padding: 15px 10px;
        font-size: 0.8rem; /* Texto más pequeño */
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .sidebar-nav ul li a i {
        margin-right: 0;
        margin-bottom: 5px;
        font-size: 1.2rem;
    }

    /* 3. Ajustes del Contenido Principal */
    .main-content {
        padding: 20px;
        padding-bottom: 80px; /* Dejamos espacio para la barra inferior */
        order: 1; /* El contenido va primero */
    }

    /* 4. Ajustes de las Rejillas (Grids) */
    .dashboard-cards, .services-grid, .registro-grid, .citas-grid {
        grid-template-columns: 1fr; /* Una sola columna */
    }

    /* Ajuste para el Login y Hero */
    .login-card {
        margin: 20px; /* Un poco de margen en móviles */
    }

    .hero h1 {
        font-size: 2rem; /* Títulos más pequeños */
    }
}

/* --- CORRECCIÓN DE CHECKBOXES (VOLUNTADES) --- */

/* 1. Creamos una clase para la fila de la casilla + texto */
.checkbox-row {
    display: flex;           /* Pone la caja y el texto en línea */
    align-items: center;     /* ALINEACIÓN VERTICAL: Esto centra el texto con la caja */
    gap: 12px;               /* Espacio controlado entre caja y texto */
    margin-bottom: 15px;
    padding: 5px 0;
}

/* 2. Reseteamos el estilo de los inputs SOLO si son checkboxes */
.form-group input[type="checkbox"] {
    width: 20px;     /* Tamaño fijo y normal para la casilla */
    height: 20px;    /* Altura igual a la anchura */
    margin: 0;       /* Quitamos márgenes extraños */
    cursor: pointer;
    flex-shrink: 0;  /* Evita que la casilla se aplaste si hay mucho texto */
    accent-color: var(--color-primary); /* ¡Bonus! Pinta la casilla de verde al marcarla */
}

/* 3. Ajuste fino para el texto de la etiqueta (label) */
.checkbox-row label {
    margin-bottom: 0; /* Quitamos el margen inferior que tenían los labels generales */
    font-weight: normal; /* Texto normal, no negrita */
    cursor: pointer;
    line-height: 1.4; /* Altura de línea cómoda para leer */
    font-size: 0.95rem;
}

/* --- ESTILOS DE REGISTRO (SIGNUP) --- */

.profile-selector {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    justify-content: center;
}

.profile-option {
    border: 2px solid #eee;
    border-radius: 10px;
    padding: 15px;
    width: 45%;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    color: #888;
}

.profile-option i {
    font-size: 1.5rem;
    display: block;
    margin-bottom: 8px;
    color: #ccc;
    transition: color 0.2s;
}

.profile-option span {
    font-size: 0.9rem;
    font-weight: bold;
}

/* Estado Seleccionado */
.profile-option.selected {
    border-color: var(--color-primary);
    background-color: var(--color-pastel-blue);
    color: var(--color-primary);
    transform: translateY(-3px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.profile-option.selected i {
    color: var(--color-primary);
}

.profile-option:hover {
    border-color: var(--color-mint);
}


/* --- ESTILOS DE PERFIL DE USUARIO --- */

.profile-grid {
    display: grid;
    grid-template-columns: 1fr 2fr; /* Columna estrecha para foto, ancha para datos */
    gap: 30px;
}

/* Tarjeta de Foto */
.profile-photo-card {
    background: var(--white);
    padding: 40px 20px;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.03);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.avatar-large-container {
    position: relative;
    width: 150px;
    height: 150px;
    margin-bottom: 20px;
}

.avatar-large-container img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid var(--color-pastel-blue);
}

.edit-photo-btn {
    position: absolute;
    bottom: 5px;
    right: 5px;
    background-color: var(--color-primary);
    color: var(--white);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    border: 3px solid var(--white);
    transition: transform 0.2s;
}

.edit-photo-btn:hover {
    transform: scale(1.1);
}

.profile-role {
    color: #888;
    margin-top: 5px;
    font-size: 0.9rem;
}

/* Formulario de Perfil */
.profile-form-card {
    background: var(--white);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.03);
}

.profile-form-card h3 {
    margin-bottom: 25px;
    color: var(--text-color);
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-actions {
    text-align: right;
    margin-top: 20px;
}

/* RESPONSIVE para Perfil */
@media (max-width: 768px) {
    .profile-grid {
        grid-template-columns: 1fr; /* Una columna en móvil */
    }
    .form-row {
        grid-template-columns: 1fr; /* Inputs uno debajo de otro */
    }
}


/* --- NOTIFICACIONES TOAST (POP-UP SUAVE) --- */

#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999; /* Para que salga siempre encima de todo */
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background-color: var(--text-color); /* Fondo oscuro elegante */
    color: var(--white);
    min-width: 250px;
    padding: 16px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    border-left: 5px solid var(--color-mint); /* Detalle verde PALIA */
    
    /* Animación de entrada */
    animation: slideIn 0.5s ease forwards, fadeOut 0.5s ease 3s forwards;
    opacity: 0; /* Empieza invisible */
}

.toast i {
    color: var(--color-mint);
    font-size: 1.2rem;
}

/* Animación para entrar deslizándose */
@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Animación para desaparecer a los 3 segundos */
@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; transform: translateY(-10px); }
}

/* --- CENTRADO DEL LOGO EN LOGIN Y REGISTRO --- */
.login-header .logo {
    justify-content: center; /* Centra la imagen horizontalmente */
    margin-bottom: 15px;     /* Separa un poco el logo del texto */
    width: 100%;             /* Asegura que ocupe todo el ancho para poder centrar */
}


/* --- ESTILOS DE GESTIÓN DE MEDICACIÓN --- */

.med-list-section {
    background-color: transparent; /* Se integra en el fondo */
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.medication-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Tarjeta de Medicina */
.med-card {
    background: var(--white);
    padding: 15px 20px;
    border-radius: 12px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-left: 5px solid #e67e22; /* Naranja = Pendiente */
    transition: all 0.3s ease;
}

.med-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.med-icon {
    width: 45px;
    height: 45px;
    background-color: #fff3e0;
    color: #e67e22;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
}

.med-info h4 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-color);
}

.med-info span {
    font-size: 0.85rem;
    color: #666;
}

.med-time {
    font-weight: bold;
    color: var(--color-primary);
    background-color: #f0f7f4;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.9rem;
}

/* Botón de Check (Tomar) */
.check-med-btn {
    background: none;
    border: 2px solid #e1e1e1;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    color: #ccc;
    transition: all 0.2s;
    font-size: 1.2rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.check-med-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

/* --- ESTADO: TOMADA (COMPLETADA) --- */
.med-card.taken {
    background-color: #f9f9f9;
    border-left-color: var(--color-mint); /* Verde = Completado */
    opacity: 0.8;
}

.med-card.taken .med-icon {
    background-color: #e8f5e9;
    color: var(--color-mint);
}

.med-card.taken h4 {
    text-decoration: line-through;
    color: #999;
}

.med-card.taken .check-med-btn {
    background-color: var(--color-mint);
    border-color: var(--color-mint);
    color: white;
}


/* --- HERRAMIENTAS DE ACCESIBILIDAD --- */

/* 1. Botón Flotante de Accesibilidad (Aparece a la izquierda abajo) */
#access-btn {
    position: fixed;
    bottom: 20px;
    right: 20px; /* A la izquierda para no chocar con notificaciones */
    width: 50px;
    height: 50px;
    background-color: #0056b3; /* Azul fuerte para que se vea bien */
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    z-index: 2000;
    border: 3px solid white;
    transition: transform 0.3s;
}

#access-btn:hover { transform: scale(1.1); }

/* 2. Panel de Opciones (Oculto por defecto) */
#access-panel {
    position: fixed;
    bottom: 80px;
    right: 20px;
    background-color: white;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    z-index: 2000;
    width: 200px;
    display: none; /* Oculto */
    border: 2px solid #0056b3;
}

#access-panel.show { display: block; animation: popIn 0.3s; }

.access-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-weight: bold;
    color: #333;
}

.access-option button {
    padding: 5px 10px;
    cursor: pointer;
    border: 1px solid #ccc;
    border-radius: 5px;
    background: #f0f0f0;
}

/* 3. CLASE MÁGICA: MODO ALTO CONTRASTE */
/* Cuando el body tiene esta clase, reescribimos los colores de TODA la web */
body.high-contrast {
    /* Fondo Negro Puro */
    --white: #000000;
    /* Texto Amarillo Intenso (Mejor contraste sobre negro) */
    --text-color: #FFFF00; 
    /* Colores primarios a Cian o Magenta (alta visibilidad) */
    --color-primary: #00FFFF; 
    --color-mint: #333333; 
    --color-pastel-blue: #1a1a1a;
    
    background-color: #000000 !important;
    color: #FFFF00 !important;
}

/* Ajustes específicos para Alto Contraste */
body.high-contrast .sidebar, 
body.high-contrast .dash-card, 
body.high-contrast .nav-container,
body.high-contrast header,
body.high-contrast .form-card,
body.high-contrast input,
body.high-contrast textarea {
    background-color: #000000 !important;
    border: 2px solid #FFFF00 !important; /* Bordes amarillos para distinguir cajas */
    color: #FFFF00 !important;
}

body.high-contrast a {
    color: #00FFFF !important;
    text-decoration: underline;
}

body.high-contrast button {
    background-color: #000000 !important;
    color: #FFFF00 !important;
    border: 2px solid #FFFF00 !important;
    font-weight: bold;
}

@keyframes popIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}


/* --- MODO OSCURO (DARK MODE) --- */

body.dark-mode {
    /* Redefinimos las variables para colores oscuros */
    --white: #1e1e1e;           /* Gris oscuro para tarjetas */
    --text-color: #e0e0e0;      /* Blanco suave para texto */
    --color-pastel-blue: #2c3e50; /* Azul oscuro para fondos secundarios */
    --color-mint: #27ae60;      /* Verde un poco más intenso para que se vea bien sobre negro */
    
    background-color: #121212;  /* Fondo casi negro para la web */
    color: var(--text-color);
}

/* Ajustes específicos para que el Modo Oscuro se vea bien */
body.dark-mode .sidebar {
    background-color: #1e1e1e;
    border-right: 1px solid #333;
}

body.dark-mode .main-header {
    background-color: #1e1e1e;
    border-bottom: 1px solid #333;
}

body.dark-mode .dash-card, 
body.dark-mode .form-card,
body.dark-mode .doctor-card-profile,
body.dark-mode .widget-card,
body.dark-mode .post-card,
body.dark-mode .med-card,
body.dark-mode .profile-photo-card,
body.dark-mode .profile-form-card,
body.dark-mode .login-card {
    background-color: #1e1e1e;
    box-shadow: none;       /* Las sombras no se ven bien en negro */
    border: 1px solid #333; /* Usamos bordes sutiles en su lugar */
}

body.dark-mode input, 
body.dark-mode textarea, 
body.dark-mode select {
    background-color: #2d2d2d;
    border-color: #444;
    color: white;
}

body.dark-mode .sidebar-nav ul li a:hover,
body.dark-mode .sidebar-nav ul li.active a {
    background-color: #333;
}

/* Ajuste para el chat */
body.dark-mode .chat-body {
    background: #0d0d0d;
}
body.dark-mode .bot-message .message-content {
    background-color: #2d2d2d;
    color: white;
}


/* --- BOTÓN DE EMERGENCIA (SOS) --- */

#sos-btn {
    position: fixed;
    /* LO SUBIMOS: Antes 20px, ahora 110px para librar el botón Salir y el Chat */
    bottom: 110px; 
    left: 20px;
    
    /* LO HACEMOS MÁS PEQUEÑO: Antes 60px, ahora 50px */
    width: 50px; 
    height: 50px;
    
    background-color: #e74c3c;
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    
    /* Ajustamos el tamaño de la letra también */
    font-size: 1.1rem; 
    font-weight: bold;
    
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.4);
    z-index: 2000;
    border: 3px solid white;
    
    /* Animación de latido (ajustada para el nuevo tamaño) */
    animation: heartbeat 2s infinite;
}

#sos-btn:hover {
    transform: scale(1.1);
    animation: none; /* Parar latido al pasar ratón */
}

@keyframes heartbeat {
    0% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(231, 76, 60, 0); }
    100% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0); }
}

/* Modal de Pantalla Completa para Emergencia */
.sos-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(192, 57, 43, 0.95); /* Fondo rojo oscuro semitransparente */
    z-index: 3000; /* Encima de TODO */
    display: none; /* Oculto por defecto */
    justify-content: center;
    align-items: center;
    flex-direction: column;
    backdrop-filter: blur(5px);
}

.sos-modal-overlay.show {
    display: flex;
    animation: fadeIn 0.3s;
}

.sos-content {
    background: white;
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    max-width: 90%;
    width: 400px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.sos-title {
    color: #c0392b;
    font-size: 1.8rem;
    margin-bottom: 20px;
    font-weight: bold;
}

.sos-btn-large {
    display: block;
    width: 100%;
    padding: 15px;
    margin: 10px 0;
    border: none;
    border-radius: 10px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.2s;
}

.btn-112 {
    background-color: #c0392b;
    color: white;
    font-size: 1.5rem;
}

.btn-contact {
    background-color: #27ae60; /* Verde esperanza */
    color: white;
}

.btn-cancel-sos {
    background-color: #95a5a6;
    color: white;
    margin-top: 20px;
    font-size: 1rem;
}

.sos-btn-large:hover { transform: scale(1.02); }

/* AJUSTE RESPONSIVE: En móvil, subimos los botones para que no tapen el menú de abajo */
@media (max-width: 768px) {
    /* En móvil lo subimos un poco más porque la barra de abajo ocupa espacio */
    #sos-btn { bottom: 130px; left: 15px; }
    
    /* El de accesibilidad también lo subimos para que queden simétricos si quieres */
    #access-btn { bottom: 130px; right: 15px; }
    #access-panel { bottom: 190px; }
}


/* --- ESTILOS PÁGINA 404 --- */
.error-page-body {
    background-color: #f0f7f4;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.error-container {
    background: var(--white);
    padding: 50px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    max-width: 500px;
    width: 90%;
}

.error-icon {
    font-size: 5rem;
    color: var(--color-primary);
    margin-bottom: 20px;
    position: relative;
    display: inline-block;
}

.error-code {
    position: absolute;
    bottom: -10px;
    right: -20px;
    background-color: var(--color-mint);
    color: var(--text-color);
    font-size: 1.5rem;
    font-weight: bold;
    padding: 5px 15px;
    border-radius: 10px;
    transform: rotate(-10deg);
}

.error-container h1 {
    color: var(--text-color);
    margin-bottom: 15px;
}

.error-container p {
    color: #666;
    margin-bottom: 10px;
}

.error-actions {
    margin-top: 30px;
    display: flex;
    gap: 15px;
    justify-content: center;
}


/* --- ESTILOS LEGALES --- */
.legal-content h1 { color: var(--color-primary); margin-bottom: 10px; }
.legal-content h2 { color: var(--text-color); margin-top: 30px; margin-bottom: 15px; }
.legal-content h3 { color: #666; font-size: 1.1rem; margin-top: 20px; }
.legal-content p, .legal-content li { line-height: 1.8; color: #555; margin-bottom: 10px; }
.legal-content hr { border: 0; border-top: 1px solid #eee; margin: 30px 0; }
.last-update { font-size: 0.9rem; color: #999; font-style: italic; }

/* Ajuste modo oscuro para legales */
body.dark-mode .legal-content p, 
body.dark-mode .legal-content li,
body.dark-mode .legal-content h3 { color: #ccc; }