/* --- VARIABLES DE DISEÑO (SISTEMA DE TEMAS CORREGIDO) --- */
:root {
    --bg-principal: #16120e;
    --bg-tarjeta: #221a12;
    --texto-principal: #ffd700;
    --texto-secundario: #dfcdb6;
    --borde: rgba(255, 215, 0, 0.25);
    --accent: #ffd700;
}

/* Tema Claro Premium (Seda & Oro) */
[data-theme="light"] {
    --bg-principal: #f5f0e6;
    --bg-tarjeta: #ffffff;
    --texto-principal: #8b6508;
    --texto-secundario: #614603;
    --borde: rgba(139, 101, 8, 0.2);
    --accent: #8b6508;
}

/* Tema Oscuro Carbono */
[data-theme="dark"] {
    --bg-principal: #121212;
    --bg-tarjeta: #1e1e1e;
    --texto-principal: #ffffff;
    --texto-secundario: #a0a0a0;
    --borde: rgba(255, 255, 255, 0.15);
    --accent: #ffffff;
}

/* Tema Pastel Cálido */
[data-theme="warm"] {
    --bg-principal: #fbf0db;
    --bg-tarjeta: #fefaf0;
    --texto-principal: #4a3b32;
    --texto-secundario: #7a685c;
    --borde: #e8d8c8;
    --accent: #d97736;
}

/* Tema Cyberpunk Matrix */
[data-theme="cyber"] {
    --bg-principal: #0a0f0d;
    --bg-tarjeta: #121b18;
    --texto-principal: #39ff14;
    --texto-secundario: #00ffff;
    --borde: #1f3a30;
    --accent: #00ffff;
}

/* NUEVO TEMA EXTRA: Oro & Diamante Imperial */
[data-theme="gold-diamond"] {
    --bg-principal: #0d0a07;
    --bg-tarjeta: #1a1510;
    --texto-principal: #ffd700;
    --texto-secundario: #fff8dc;
    --borde: #ffd700;
    --accent: #fff8dc;
}

/* --- ESTILOS GENERALES Y FONDO --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: radial-gradient(circle at center, #1a130b 0%, #030201 100%);
    color: var(--texto-principal);
    transition: background 0.3s, color 0.3s;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    overflow-x: hidden;
    position: relative;
}

/* Capa Dinámica: Cambia el fondo cuando se inicia sesión según el tema */
body.app-activa {
    background: var(--bg-principal) !important;
}

/* --- DESTELLOS DE DIAMANTES VECTORIALES (NUNCA SE DISTORSIONAN) --- */
.diamante-destello {
    position: absolute;
    width: 20px;
    height: 20px;
    background: #ffffff;
    clip-path: polygon(50% 0%, 65% 35%, 100% 50%, 65% 65%, 50% 100%, 35% 65%, 0% 50%, 35% 35%);
    filter: drop-shadow(0 0 10px #fff) drop-shadow(0 0 20px #ffd700);
    animation: brillarGema 3s ease-in-out infinite;
    pointer-events: none;
}

@keyframes brillarGema {
    0%, 100% { opacity: 0.2; transform: scale(0.7); }
    50% { opacity: 1; transform: scale(1.2); }
}

/* --- CUADRO DE NOTAS INTERNO --- */
.contenedor {
    width: 100%;
    max-width: 420px;
    background: rgba(12, 10, 8, 0.96);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-radius: 24px;
    padding: 40px 35px;
    border: 3px solid transparent;
    border-image: linear-gradient(135deg, #8b6508, #ffd700, #fff8dc, #ffd700, #8b6508) 1;
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.95), 0 0 40px rgba(255, 215, 0, 0.2);
    transition: max-width 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 5;
}

body.app-activa .contenedor {
    background: var(--bg-tarjeta);
    border: 2px solid var(--borde);
    border-image: none;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.contenedor:has(#app-principal:not(.oculto)) {
    max-width: 850px;
}

.oculto { display: none !important; }

#pantalla-login { text-align: center; }

/* --- TÍTULO NOTAS IMPERIAL RESALTADO --- */
#pantalla-login h2, .header h2 {
    background: linear-gradient(to bottom, #ffffff 0%, #fff5cc 20%, #ffd700 50%, #b8860b 85%, #503a05 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 900;
    font-size: 34px;
    letter-spacing: 4px;
    text-transform: uppercase;
    filter: drop-shadow(0 4px 10px rgba(0,0,0,1));
    margin-bottom: 12px;
}

body.app-activa .header h2 {
    background: none;
    -webkit-background-clip: initial;
    -webkit-text-fill-color: initial;
    color: var(--texto-principal);
}

.subtitulo {
    color: #dfcdb6;
    font-size: 13px;
    margin-bottom: 25px;
}

/* --- CAMPOS DE FORMULARIO --- */
input[type="password"], input[type="text"], input[type="date"], textarea, select {
    width: 100%;
    padding: 12px;
    margin: 8px 0;
    border: 1px solid var(--borde);
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.4);
    color: var(--texto-secundario);
    font-size: 15px;
    outline: none;
}
input:focus, textarea:focus, select:focus {
    border-color: var(--accent) !important;
}

/* --- BOTÓN ACCEDER ESTILO LINGOTE DE ORO REAL --- */
button, .btn-bloque {
    background: linear-gradient(135deg, #b8860b 0%, #ffd700 45%, #fff8dc 65%, #ffd700 85%, #9a7b1c 100%) !important;
    color: #000000 !important;
    border: 1px solid #ffffff !important;
    padding: 14px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 800;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 2px;
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.3);
    transition: all 0.3s ease;
}
button:hover, .btn-bloque:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.6), 0 0 15px #fff;
}

.btn-secundario {
    background: transparent !important;
    color: var(--texto-principal) !important;
    border: 1px solid var(--borde) !important;
}

/* --- APP COMPONENTES INTERNOS --- */
   .header {
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 12px;
        padding-bottom: 20px;
    }
	
.controles-top {
        flex-wrap: wrap;
        justify-content: center;
        width: 100%;
        gap: 8px;
    }

    /* 3. Hace que el selector de temas y los botones tengan un tamaño cómodo para tocar con el dedo */
    .controles-top select, 
    .controles-top button {
        flex: 1 1 auto;      /* Se estiran proporcionalmente para llenar el espacio libre */
        min-width: 85px;     /* Evita que se encojan de más y se vuelvan ilegibles */
        justify-content: center;
        text-align: center;
        padding: 6px 10px;   /* Un tamaño ideal para pantallas táctiles */
    }
	
.editor-nota {
    margin-bottom: 30px;
    background: rgba(0,0,0,0.2);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid var(--borde);
}
.editor-opciones { display: flex; gap: 15px; margin: 10px 0; }
.grupo-campo { flex: 1; }
.grupo-campo label { font-size: 12px; font-weight: bold; color: var(--texto-secundario); }
.editor-footer { display: flex; justify-content: flex-end; gap: 10px; }

/* --- GRID Y TARJETAS --- */
.grid-notas { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 15px; }
.nota-card {
    background: rgba(0,0,0,0.15);
    border: 1px solid var(--borde);
    border-radius: 8px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 160px;
}
.nota-card.color-default { border-left: 5px solid var(--accent); }
.nota-card.color-amarillo { border-left: 5px solid #f1c40f; }
.nota-card.color-verde { border-left: 5px solid #2ecc71; }
.nota-card.color-rojo { border-left: 5px solid #e74c3c; }
.nota-card.color-morado { border-left: 5px solid #9b59b6; }

.nota-titulo { font-weight: bold; margin-bottom: 8px; color: var(--texto-principal); }
.nota-cuerpo { font-size: 14px; color: var(--texto-secundario); white-space: pre-wrap; }
.nota-footer { margin-top: 15px; display: flex; justify-content: space-between; align-items: center; font-size: 11px; color: var(--texto-secundario); }

.btn-borrar { background: transparent !important; color: #ff8888 !important; border: 1px solid rgba(255,136,136,0.3) !important; font-size: 12px; padding: 4px 8px; }
.btn-editar { background: transparent !important; color: var(--texto-principal) !important; border: 1px solid var(--borde) !important; font-size: 12px; padding: 4px 8px; }

.animar-salto { animation: brincarEfecto 0.5s ease infinite; border: 2px solid #ffd700 !important; }
@keyframes brincarEfecto { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
/* --- EN TU ESTILOS.CSS BUSCA INPUT[TYPE="PASSWORD"] Y DÉJALO ASÍ --- */
input[type="password"] {
    width: 100%;
    padding: 12px;
    margin: 8px 0;
    border: 1px solid rgba(255, 215, 0, 0.3) !important; /* Fuerza el borde de oro tenue */
    background: rgba(0, 0, 0, 0.6) !important; /* Fuerza el fondo negro */
    color: #dfcdb6 !important; /* Fuerza el texto crema */
    font-size: 15px;
    outline: none;
}

input[type="password"]:focus {
    border-color: #ffd700 !important; /* Fuerza el brillo dorado al hacer clic */
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.4) !important;
}
