:root {
    --primary: #20b2aa; /* Teal/Turquesa que habías pedido */
    --primary-dark: #179b94;
    --bg-main: #f4f7f6; /* Gris muy claro (fondo interior) */
    --bg-card: #ffffff; /* Blanco puro para tarjetas */
    --bg-sidebar: #2b3d4f; /* Navy oscuro para el lateral */
    --text-main: #333333; /* Texto principal oscuro */
    --text-muted: #777777; /* Texto secundario gris */
    --text-sidebar: #d0d7de; /* Texto claro para sidebar */
    --border: #e2e8f0; /* Bordes suaves y limpios */
    --error: #ef4444;
    --success: #10b981;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.screen {
    display: none;
    width: 100%;
    height: 100%;
}

.screen.active {
    display: flex;
}

#landing-screen.active {
    display: block; /* Sobrescribe el flex para no aplastar el diseño */
}

/* BUTTONS */
.btn {
    display: inline-block;
    padding: 12px 20px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    width: 100%;
}
.btn-primary {
    background-color: var(--primary);
    color: white;
}
.btn-primary:hover {
    background-color: var(--primary-dark);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}
.btn-danger {
    background-color: var(--error);
    color: white;
    width: auto;
    padding: 6px 12px;
}
.btn-danger:hover {
    background-color: #c0392b;
}

/* AUTH SCREEN */
#auth-screen {
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, var(--bg-sidebar) 0%, #0f172a 100%);
}

.auth-box {
    background: var(--bg-card);
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    width: 90%;
    max-width: 400px;
    text-align: center;
}

.auth-box h1 { color: var(--primary); margin-bottom: 10px; font-weight: 700; }
.auth-box p { color: var(--text-muted); margin-bottom: 25px; font-size: 0.95rem; }
.auth-box input {
    width: 100%; padding: 12px 15px; margin-bottom: 15px;
    border: 1px solid var(--border); border-radius: 8px; font-size: 1rem;
    transition: border-color 0.3s;
}
.auth-box input:focus { outline: none; border-color: var(--primary); }
.error-msg { color: var(--error); font-size: 0.85rem; margin-top: 10px; min-height: 20px; }
.auth-footer { margin-top: 20px; font-size: 0.85rem; }

/* SIDEBAR */
.sidebar {
    width: 260px;
    background-color: var(--bg-sidebar);
    color: var(--text-sidebar);
    display: flex;
    flex-direction: column;
    padding: 20px 0;
    flex-shrink: 0;
    transition: transform 0.3s ease;
    border-right: 1px solid var(--border);
}

.brand {
    font-size: 1.5rem;
    font-weight: 800;
    color: #20b2aa;
    padding: 0 20px 20px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    margin-bottom: 20px;
}

.nav-links { list-style: none; flex-grow: 1; overflow-y: auto; padding: 0 10px; }
.nav-links li { margin-bottom: 5px; }
.nav-btn {
    width: 100%; text-align: left; background: none; border: none;
    color: var(--text-sidebar); padding: 12px 15px; font-size: 1rem;
    cursor: pointer; transition: all 0.2s; font-family: inherit; display: flex; align-items: center; gap: 10px;
    border-radius: 8px;
}
.nav-btn:hover { background: rgba(255,255,255,0.05); color: #ffffff; }
.nav-btn.active {
    background: var(--primary); color: #ffffff;
    font-weight: 600;
}

.user-controls {
    padding: 20px; border-top: 1px solid rgba(255,255,255,0.05);
    font-size: 0.85rem; display: flex; flex-direction: column; gap: 10px;
}
#user-email { word-break: break-all; color: var(--text-sidebar); opacity: 0.7; }

/* MAIN CONTENT */
.content {
    flex-grow: 1;
    overflow-y: auto;
    padding: 30px;
    background: var(--bg-main);
    position: relative;
}

.panel {
    display: none;
    max-width: 1000px;
    margin: 0 auto;
    animation: fadeIn 0.3s ease-in-out;
}
.panel.active { display: block; }
h2.panel-title { color: var(--text-main); margin-bottom: 25px; font-size: 1.8rem; font-weight: 700; }

/* -------------------------------------
   DISEÑO PREMIUM DARK (Evolucionado)
   ------------------------------------- */
.dw-search-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05); /* Efecto 3D sutil pedido */
    transition: transform 0.2s, box-shadow 0.2s;
}
.dw-search-box:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}
.dw-title { font-size: 18px !important; font-weight: 700; color: var(--text-main); margin: 0 0 10px 0; }
.dw-label { font-size: 13px !important; font-weight: 600; color: var(--text-muted); margin: 0 0 15px 0; display: block; }
.dw-form { display: flex; gap: 10px; flex-wrap: wrap; }
.dw-input {
    flex: 1; min-width: 200px; padding: 15px; border: 1px solid var(--border); background: #ffffff; color: var(--text-main);
    border-radius: 8px; font-size: 16px; outline: none; transition: all 0.3s;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}
.dw-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1); }
.dw-btn {
    padding: 15px 25px; background: var(--primary); color: white;
    border: none; border-radius: 8px; font-size: 16px; font-weight: bold;
    cursor: pointer; transition: background 0.3s; white-space: nowrap;
}
.dw-btn:hover { background: var(--primary-dark); }
.dw-btn:disabled { background: #ccc; cursor: not-allowed; }

.dw-loading { display: none; text-align: center; padding: 15px; color: #666; font-weight: bold; }

@keyframes pulse-text {
    0% { opacity: 0.6; transform: scale(0.99); }
    50% { opacity: 1; transform: scale(1); color: var(--primary); }
    100% { opacity: 0.6; transform: scale(0.99); }
}
.spinner-animation {
    animation: pulse-text 1.5s infinite ease-in-out;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px dashed #cbd5e1;
}

.dw-result-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 5px solid var(--primary);
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05); /* Efecto 3D sutil */
}

.dw-error { display: none; padding: 15px; background: rgba(239, 68, 68, 0.1); color: #fca5a5; border: 1px solid var(--error); border-radius: 8px; margin-bottom: 20px; font-weight: 600; text-align: center; }

/* MAPA */
#dw-map { height: 500px; width: 100%; border-radius: 8px; border: 1px solid #ddd; z-index: 1; display: none; background-color: #d4e6f1; }
.leaflet-popup-content-wrapper { border-radius: 12px; box-shadow: 0 4px 20px rgba(0,0,0,0.15); }
.leaflet-popup-content { text-align: center; width: 280px !important; margin: 15px !important; }

/* RESULTADOS (CLADOGRAMAS, TAXONOMÍA) */
.ascii-box { background: #f8fafc; color: #334155; padding: 20px; border-radius: 8px; border: 1px solid var(--border); overflow-x: auto; font-family: monospace; font-size: 0.9rem; line-height: 1.4; display: none; margin-top:20px; }
.result-card { background: var(--bg-card); padding: 20px; border-radius: 12px; border: 1px solid var(--border); display: none; margin-top: 20px; box-shadow: 0 4px 12px rgba(0,0,0,0.03); }
.result-card h3 { margin-bottom: 10px; color: var(--text-main); }
.result-card p { margin-bottom: 10px; line-height: 1.6; }

/* BIO ESCÁNER */
.upload-zone { border: 2px dashed var(--border); border-radius: 12px; padding: 40px 20px; text-align: center; cursor: pointer; transition: all 0.2s; background: #f8fafc; margin-bottom:15px; }
.upload-zone:hover { border-color: var(--primary); background: #eff6ff; }
.upload-zone p { color: var(--text-muted); font-size: 15px; font-weight: bold; margin-top: 10px; }

#escaner-preview {
    max-width: 100%;
    max-height: 400px;
    object-fit: contain;
    border-radius: 8px;
    margin: 0 auto;
    display: none;
}

/* ESTILOS PREMIUM CURIOSFERA ORIGINALES (Adaptados a Dark) */
/* ------------------------------------- */
.mnp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    padding: 20px 0;
}
.mnp-tarjeta {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px;
    padding: 26px; cursor: pointer; transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex; flex-direction: column; justify-content: space-between;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.02);
}
.mnp-tarjeta:hover {
    transform: translateY(-5px); box-shadow: 0 20px 25px -5px rgba(0,0,0,0.08); border-color: var(--primary);
}
.mnp-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.mnp-fecha { font-size: 0.75rem; font-weight: 700; color: #2563eb; background: #eff6ff; padding: 6px 12px; border-radius: 20px; text-transform: uppercase; letter-spacing: 0.05em; }
.mnp-categoria { font-size: 0.75rem; font-weight: 600; color: var(--text-muted); background: #f8fafc; padding: 6px 12px; border-radius: 20px; border: 1px solid var(--border); }
.mnp-titulo { font-size: 1.2rem; font-weight: 700; color: var(--text-main); margin: 0 0 10px 0; line-height: 1.4; }
.mnp-extracto { font-size: 0.9rem; color: var(--text-muted); line-height: 1.6; margin-bottom: 24px; }
.mnp-extracto p { margin: 0; }
.mnp-btn-card { font-size: 0.85rem; font-weight: 700; color: #2563eb; background: none; border: none; padding: 0; cursor: pointer; text-align: left; }

/* CAJÓN LATERAL CURIOSFERA */
#mnp-cajon {
    position: fixed; top: 0; right: -600px; width: 550px; max-width: 100%; height: 100vh;
    background: #f8fafc; box-shadow: -20px 0 25px -5px rgba(0,0,0,0.1);
    transition: right 0.35s cubic-bezier(0.16, 1, 0.3, 1); z-index: 99999;
    padding: 40px 24px; box-sizing: border-box; overflow-y: auto;
}
#mnp-cajon.abierto { right: 0; }
#mnp-cerrar {
    background: #ffffff; border: 1px solid var(--border); padding: 10px 18px; border-radius: 20px;
    cursor: pointer; font-weight: 700; color: var(--text-main); margin-bottom: 25px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05); transition: all 0.2s;
}
#mnp-cerrar:hover { background: #f1f5f9; }
.mnp-contenido-completo {
    background: #ffffff; border: 1px solid var(--border); border-radius: 12px; padding: 35px 30px;
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.04); color: var(--text-main); line-height: 1.8; font-size: 17px;
}
.mnp-contenido-completo p { margin-bottom: 20px; }
.mnp-contenido-completo img { max-width: 100%; height: auto; border-radius: 8px; margin: 15px 0; }

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

/* LANDING PAGE REDESIGN */
.landing-layout {
    overflow-y: auto; 
    background-color: #020617; /* Slate muy oscuro */
    width: 100%;
    color: #f8fafc;
    background-image: radial-gradient(circle at 50% -20%, #1e293b 0%, #020617 70%);
}

.landing-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 5%;
    background-color: rgba(2, 6, 23, 0.85);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.landing-logo {
    font-size: 1.6rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.5px;
}

.landing-nav a {
    text-decoration: none;
    color: #94a3b8;
    font-weight: 500;
    margin: 0 18px;
    transition: color 0.3s;
    font-size: 0.95rem;
}

.landing-nav a:hover {
    color: #10b981;
}

.landing-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.landing-mobile-toggle {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.8rem;
    cursor: pointer;
}

.btn-text {
    background: none;
    border: none;
    font-weight: 600;
    color: #cbd5e1;
    cursor: pointer;
    font-size: 0.95rem;
    transition: color 0.3s;
}

.btn-text:hover {
    color: #ffffff;
}

.btn-nav-register {
    padding: 10px 24px;
    border-radius: 30px;
    font-size: 0.95rem;
    text-decoration: none;
    background: #10b981;
    color: #020617;
    font-weight: 700;
    transition: transform 0.2s, box-shadow 0.2s;
}
.btn-nav-register:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
    background: #059669;
    color: #fff;
}

.landing-main {
    padding: 0 5%;
}

/* HERO SECTION */
.hero-section {
    text-align: center;
    padding: 120px 0 100px 0;
    max-width: 950px;
    margin: 0 auto;
    animation: fadeIn 0.8s ease-out;
}

.hero-pill {
    display: inline-block;
    background-color: rgba(16, 185, 129, 0.1);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.2);
    padding: 8px 20px;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 30px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.hero-title {
    font-size: 4.8rem;
    font-weight: 800;
    line-height: 1.1;
    color: var(--text-main);
    margin-bottom: 30px;
    letter-spacing: -0.04em;
}

.gradient-text {
    background: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 45px;
    max-width: 750px;
    margin-left: auto;
    margin-right: auto;
}

.btn-large {
    font-size: 1.1rem;
    padding: 16px 40px;
    border-radius: 30px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s;
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-main);
    border: 1px solid var(--border);
}
.btn-secondary:hover {
    background: var(--bg-main);
}

#btn-hero-start {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #020617;
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.2);
}
#btn-hero-start:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 35px rgba(16, 185, 129, 0.4);
    color: #fff;
}

/* LANDING SECTIONS */
.landing-section {
    padding: 100px 0;
    border-top: 1px solid var(--border);
}

.landing-section h2 {
    font-size: 2.8rem;
    text-align: center;
    color: var(--text-main);
    margin-bottom: 40px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.bg-light {
    background-color: var(--bg-main);
    margin: 0 -5%;
    padding: 100px 5%;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.landing-footer {
    text-align: center;
    padding: 40px;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    margin-top: 60px;
    font-size: 0.9rem;
}

/* RESPONSIVENESS (MÓVIL) */
.mobile-header { 
    display: none; background: #ffffff; border-bottom: 1px solid var(--border); 
    padding: 15px 20px; width: 100%; align-items: center; justify-content: space-between; 
}
.mobile-brand { font-size: 1.3rem; font-weight: 800; color: var(--text-main); }
.mobile-nav-toggle { background: none; color: var(--text-main); border: none; font-size: 1.5rem; cursor: pointer; padding: 0; }

@media (max-width: 768px) {
    body { flex-direction: column; }
    #dashboard-screen { flex-direction: column; }
    .mobile-header { display: flex; }
    .sidebar { position: fixed; left: -100%; top: 56px; height: calc(100vh - 56px); z-index: 1000; width: 280px; transition: left 0.3s; box-shadow: 5px 0 15px rgba(0,0,0,0.05); }
    .sidebar.open { left: 0; }
    .content { padding: 15px; width: 100%; }
    .dw-form { flex-direction: column; }
    .dw-btn { width: 100%; }
    #mnp-cajon { width: 100%; padding: 20px 15px; }
    .mnp-grid { grid-template-columns: 1fr; }
    .mnp-contenido-completo { padding: 20px 15px; }
    
    /* Landing móvil */
    .landing-mobile-toggle { display: block; }
    .landing-nav {
        display: none;
        position: absolute;
        top: 70px; left: 0; width: 100%;
        background: rgba(2, 6, 23, 0.95);
        backdrop-filter: blur(10px);
        flex-direction: column;
        padding: 20px 0;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    .landing-nav.open { display: flex; }
    .landing-nav a { margin: 15px 0; text-align: center; font-size: 1.1rem; }
    .landing-actions { display: none; }
    
    .hero-title { font-size: 2.5rem; }
    .hero-subtitle { font-size: 1rem; }
}

/* --- MEJORAS DE CURIOSFERA --- */
/* Dar más aire a las cajas de texto para que no estén apelotonadas */
.mnp-contenido-completo div { 
    margin-bottom: 25px !important; 
    line-height: 1.8 !important; 
}

/* El último bloque (DOI/Créditos) más discreto y con línea difuminada */
.mnp-contenido-completo div:last-child {
    margin-top: 45px !important;
    padding-top: 20px !important;
    border-top: 1px solid rgba(0, 0, 0, 0.1) !important;
    font-size: 0.85rem !important;
    color: var(--text-muted) !important;
}
