/* ============================================================
   BLUEBERRY DIAGNOSTICS — PORTAL MYHEALTH
   Hoja de estilos unificada y completa para el portal privado
   ============================================================ */

/* ==========================================
1. RESET Y CONFIGURACIÓN BASE
========================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    padding-top: 70px !important;
    background-color: #f8fafc;
    color: #333333;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Desactiva la altura completa y pega la tarjeta arriba en páginas de acceso */
body.auth-page {
    padding-top: 10px !important;
    min-height: auto !important;
    display: block !important;
}

a {
    text-decoration: none !important;
}

/* ==========================================
2. CABECERA FIJA (ESTILOS COPIADOS EXACTOS DE WWW)
========================================== */
header.fixed-menu,
.fixed-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 70px;
    background-color: #ffffff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: flex;
    justify-content: center;
}

header.fixed-menu .content-container,
.fixed-menu .content-container {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    height: 100% !important;
    width: 100% !important;
    max-width: 1200px !important;
    padding: 0 40px !important;
    margin: 0 auto !important;
}

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

.logo img {
    height: 45px;
    width: auto;
    display: block;
}

.nav-menu {
    display: flex !important;
    align-items: center !important;
    height: 100% !important;
}

.nav-menu ul {
    display: flex !important;
    align-items: center !important;
    height: 70px !important;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-menu ul li {
    margin-left: 30px;
    display: flex !important;
    align-items: center !important;
    height: 100%;
    font-size: 1.2rem !important;
}

.nav-menu ul li a {
    text-decoration: none !important;
    color: #555555 !important;
    font-size: 1.2rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.2px;
    transition: color 0.3s ease;
    display: inline-block;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
}

.nav-menu ul li a:hover {
    color: #436da7 !important;
}

/* Selector de Idioma */
header.fixed-menu .nav-menu ul li.lang-selector-item,
.fixed-menu .nav-menu ul li.lang-selector-item {
    white-space: nowrap !important;
    display: inline-block !important; 
    vertical-align: top !important;    
    margin-top: 2px !important;        
    margin-left: 20px !important;      
    padding: 0 !important;              
    height: auto !important;
    line-height: 1 !important;          
    position: relative !important;
    top: 0 !important;                  
    color: rgba(0, 0, 0, 0.6) !important; 
}

header.fixed-menu .nav-menu ul li.lang-selector-item a,
.fixed-menu .nav-menu ul li.lang-selector-item a,
header.fixed-menu .nav-menu ul li.lang-selector-item span,
.fixed-menu .nav-menu ul li.lang-selector-item span {
    font-size: 16px !important;        
    font-family: inherit !important;   
    letter-spacing: inherit !important;
    display: inline !important;
}

header.fixed-menu .nav-menu ul li.lang-selector-item .lang-active,
.fixed-menu .nav-menu ul li.lang-selector-item .lang-active {
    font-weight: bold !important;
    color: #dddddd !important;
}

/* ==========================================
3. MENÚ MÓVIL (RESPONSIVE 768PX)
========================================== */
@media screen and (max-width: 768px) {
    header.fixed-menu .content-container,
    .fixed-menu .content-container {
        padding: 0 20px !important;
    }

    .menu-toggle {
        display: flex !important;
    }

    header.fixed-menu .nav-menu,
    .fixed-menu .nav-menu {
        display: none !important; 
        position: absolute !important;
        top: 70px !important;
        right: 20px !important;
        width: 280px !important;
        background: #ffffff !important;
        padding: 15px 0 !important;
        border-radius: 12px !important;
        border: 1px solid rgba(0, 0, 0, 0.08) !important;
        box-shadow: 0 15px 35px rgba(0, 0, 0, 0.12) !important;
        z-index: 1005 !important;
        flex-direction: column !important; 
        height: auto !important;
    }

    header.fixed-menu .nav-menu.active,
    header.fixed-menu .nav-menu.open,
    .fixed-menu .nav-menu.active {
        display: flex !important;
    }

    header.fixed-menu .nav-menu ul,
    .fixed-menu .nav-menu ul {
        flex-direction: column !important;
        height: auto !important;
        width: 100% !important;
    }

    header.fixed-menu .nav-menu ul li,
    .fixed-menu .nav-menu ul li {
        width: 100% !important;
        margin: 0 !important;
        height: auto !important;
        display: block !important;
    }

    header.fixed-menu .nav-menu ul li a,
    .fixed-menu .nav-menu ul li a {
        display: block !important;
        text-align: left !important;
        width: 100% !important;
        padding: 10px 25px !important;
    }

    header.fixed-menu .nav-menu ul li.lang-selector-item,
    .fixed-menu .nav-menu ul li.lang-selector-item {
        display: block !important;
        width: 100% !important;
        padding: 10px 25px !important;
        margin-left: 0 !important;
    }

    .menu-toggle.active span:nth-child(1) {
        transform: translateY(9px) rotate(45deg) !important;
    }
    .menu-toggle.active span:nth-child(2) {
        opacity: 0 !important;
    }
    .menu-toggle.active span:nth-child(3) {
        transform: translateY(-10px) rotate(-45deg) !important;
    }
}

/* ==========================================
4. BOTÓN DE LOGOUT
========================================== */
.btn-logout,
a.btn-logout {
    background-color: #ef4444 !important;
    color: #ffffff !important;
    text-decoration: none !important;
    padding: 0 14px !important;
    height: 36px !important;
    border-radius: 6px !important;
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    transition: background-color 0.2s ease, opacity 0.2s ease !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}

.btn-logout span,
a.btn-logout span {
    font-size: 0.85rem !important;
    color: #ffffff !important;
    line-height: 1 !important;
    text-decoration: none !important;
}

.btn-logout:hover,
a.btn-logout:hover {
    background-color: #dc2626 !important;
    color: #ffffff !important;
    opacity: 1 !important;
}

.btn-logout:hover span,
a.btn-logout:hover span {
    color: #ffffff !important;
}

/* ==========================================
5. AUTENTICACIÓN (LOGIN, REGISTRO, FORGOT PASSWORD, GRACIAS)
========================================== */
.lang-switch {
    align-self: flex-end;
    margin-bottom: 10px;
    font-size: 0.85rem;
    font-weight: 600;
}

.lang-switch a {
    color: #64748b !important;
    text-decoration: none !important;
    padding: 2px 6px;
    border-radius: 4px;
    transition: color 0.2s, background-color 0.2s;
}

.lang-switch a.active {
    color: #436da7 !important;
    background-color: #e2e8f0;
}

.login-logo,
.thankyou-logo {
    margin-bottom: 20px;
    text-align: center;
}

.login-logo img,
.thankyou-logo img {
    height: 55px !important;
    width: auto !important;
    display: block;
    margin: 0 auto;
}

.login-wrapper {
    width: 100%;
    max-width: 440px;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 15px auto 40px auto !important;
}

.login-wrapper.wide,
.login-wrapper.register-wrapper {
    max-width: 520px;
}

.thankyou-wrapper {
    width: 100%;
    max-width: 480px;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 15px auto 40px auto !important;
}

.login-card, 
.thankyou-card {
    width: 100%;
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 35px 40px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    box-sizing: border-box;
}

.thankyou-card {
    text-align: center;
}

.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.form-col {
    flex: 1;
}

input.login-input,
select.login-input,
.login-input {
    width: 100%;
    padding: 13px 16px;
    font-size: 1rem;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
    background-color: #f8fafc;
    font-family: inherit;
}

input.login-input:focus,
select.login-input:focus,
.login-input:focus {
    border-color: #436da7;
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(67, 109, 167, 0.15);
}

button.btn-login,
a.btn-login,
.btn-login {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #436da7;
    color: #ffffff !important;
    border: none;
    padding: 0 20px;
    height: 48px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    width: 100%;
    cursor: pointer;
    transition: background-color 0.2s ease, opacity 0.2s ease;
    text-decoration: none;
    box-sizing: border-box;
    font-family: inherit;
}

button.btn-login:hover,
a.btn-login:hover,
.btn-login:hover {
    opacity: 0.92;
    background-color: #031f40;
}

.alert-box {
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 0.9rem;
    margin-bottom: 25px;
    text-align: left;
    line-height: 1.5;
}

.alert-error {
    background-color: #fef2f2;
    border: 1px solid #fca5a5;
    color: #991b1b;
}

.alert-success {
    background-color: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.success-icon {
    width: 64px;
    height: 64px;
    background-color: #dcfce7;
    color: #166534;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    margin: 0 auto 20px auto;
}

/* ==========================================
6. DASHBOARD / CONTENIDO PRIVADO
========================================== */
.main-content,
.main-content-portal {
    flex: 1;
    padding: 40px 20px 60px;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 20px;
    width: 100%;
    margin-top: 20px;
}

.dashboard-card-square {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    aspect-ratio: 1 / 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 15px;
    text-decoration: none !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.dashboard-card-square:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08);
    border-color: #436da7;
}

.dashboard-card-square img {
    max-width: 60%;
    max-height: 60%;
    object-fit: contain;
    margin-bottom: 10px;
}

.dashboard-card-square span {
    font-size: 0.9rem;
    font-weight: 600;
    color: #031f40;
    text-align: center;
    line-height: 1.2;
}

@media (max-width: 600px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

/* ==========================================
7. FOOTER SYSTEM (ESPACIADO EXACTO A WWW)
========================================== */
.footer {
    background-color: #1a1a1a !important;
    color: #b3b3b3 !important;
    padding: 60px 20px 100px 20px !important;
    width: 100% !important;
    margin-top: auto !important;
    font-size: 0.95rem !important;
}

.footer .footer-container {
    max-width: 1200px !important;
    width: 100% !important;
    margin: 0 auto !important;
    padding: 0 40px 40px 40px !important;
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: space-between !important;
    gap: 40px !important;
    border-bottom: 1px solid #333333 !important;
}

.footer .footer-column {
    flex: 1 !important;
    min-width: 250px !important;
    text-align: left !important;
}

.footer .footer-column h3,
.footer .footer-column h4 {
    color: #ffffff !important;
    margin-bottom: 22px !important;
    font-weight: normal !important;
    font-size: 1.5rem !important;
}

.footer .footer-column p {
    font-size: 0.95rem !important;
    line-height: 1.6 !important;
    margin-bottom: 20px !important;
    text-align: left !important;
    color: #b3b3b3 !important;
}

.footer .footer-column ul {
    list-style: none !important;
    padding-left: 0 !important;
    margin: 0 !important;
}

.footer .footer-column ul li {
    margin-bottom: 18px !important;
    text-align: left !important;
    font-size: 0.95rem !important;
    line-height: 1.6 !important;
    list-style: none !important;
}

.footer .footer-column ul li a {
    color: #b3b3b3 !important;
    text-decoration: none !important;
    font-size: 0.95rem !important;
    line-height: 1.6 !important;
    display: inline-block !important;
    transition: color 0.3s ease !important;
}

.footer .footer-column ul li a:hover {
    color: #436da7 !important;
}

.footer .footer-logo {
    margin-bottom: 20px !important;
    display: block !important;
    text-align: left !important;
}

.footer .footer-logo img {
    height: 55px !important;
    width: auto !important;
    display: block !important;
    margin: 0 !important;
}

.footer .footer-bottom {
    max-width: 1200px !important;
    width: 100% !important;
    margin: 20px auto 0 auto !important;
    padding: 0 40px !important;
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    box-sizing: border-box !important;
}

.footer .footer-bottom p {
    font-size: 0.85rem !important;
    color: #b3b3b3 !important;
    margin: 0 !important;
    line-height: 1 !important;
    text-align: left !important;
}

/* ==========================================
8. PÁGINA DE PERFIL Y BOTONES DE ACCIÓN
========================================== */
.profile-form {
    width: 100%;
}

.profile-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.profile-grid-3 {
    display: grid;
    grid-template-columns: 2fr 1fr 2fr;
    gap: 24px;
    margin-bottom: 35px;
}

.profile-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-top: 30px;
}

.btn-secondary-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 220px;
    height: 48px;
    background-color: #ffffff;
    color: #436da7 !important;
    border-radius: 6px;
    text-decoration: none !important;
    font-weight: 600;
    font-size: 0.95rem;
    border: 1px solid #436da7;
    box-sizing: border-box;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.btn-secondary-action:hover {
    background-color: #f1f5f9;
    color: #031f40 !important;
}

.profile-actions .btn-login {
    width: 220px !important;
    margin-top: 0 !important;
}

/* ==========================================
9. ADAPTACIÓN RESPONSIVE
========================================== */
@media screen and (max-width: 768px) {
    .footer {
        padding: 40px 15px 100px 15px !important;
    }

    .footer .footer-container {
        padding: 0 0px 30px 0px !important;
        flex-direction: column !important;
        gap: 30px !important;
    }

    .footer .footer-column {
        width: 100% !important;
        text-align: left !important;
    }

    .footer .footer-bottom {
        padding: 0 !important;
        margin: 20px 0 0 0 !important;
    }

    .profile-grid-2,
    .profile-grid-3 {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .profile-actions {
        flex-direction: column-reverse;
        gap: 12px;
    }

    .btn-secondary-action,
    .profile-actions .btn-login {
        width: 100% !important;
    }
}

@media (max-width: 576px) {
    .login-card, 
    .thankyou-card {
        padding: 25px 20px;
    }
    .form-row {
        flex-direction: column;
        gap: 20px;
    }
}