/* =========================================
   LOANWARE - ESTILOS GLOBALES UNIFICADOS
   ========================================= */

/* --- VARIABLES --- */
:root {
    --primary: #1a392a;
    --accent: #09FF00;
    --accent-dark: #059669; /* Verde más oscuro para mejor contraste en textos claros */
    --light-bg: #f8fafc;
    --shadow: 0 10px 30px rgba(0,0,0,0.08);
    --text-dark: #334155;
    --border-color: #e2e8f0;
}

/* --- RESET Y BASE --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Montserrat', 'Segoe UI', system-ui, sans-serif;
}

body {
    background-color: var(--light-bg);
    color: var(--text-dark);
    line-height: 1.6;
}

/* --- HEADER Y NAVEGACIÓN --- */
.header-main {
    background-color: var(--primary);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

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

.logo i { color: var(--accent); font-size: 1.5rem; }
.logo h1 { color: white; font-weight: 700; font-style: italic; letter-spacing: -0.05em; margin: 0; }
.logo h1 span { color: var(--accent); }

.main-nav a, .dropdown-btn {
    color: white;
    font-weight: 600;
    font-size: 0.85rem;
    transition: color 0.3s;
    text-decoration: none;
    background: transparent;
    border: none;
    cursor: pointer;
}

.main-nav a:hover, .main-nav a.active, .dropdown-btn:hover {
    color: var(--accent);
}

/* --- BOTÓN DE PERFIL / ACCIÓN --- */
.btn-login-style {
    border: 2px solid var(--accent);
    color: var(--accent);
    padding: 8px 20px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-login-style:hover {
    background: var(--accent);
    color: var(--primary);
    box-shadow: 0 0 15px rgba(9, 255, 0, 0.4);
}

/* --- ELEMENTOS DE DISEÑO --- */
.tag-label {
    color: var(--accent);
    background: var(--primary); /* Fondo oscuro para que el neón sea legible */
    padding: 4px 12px;
    border-radius: 50px;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 2px;
    display: inline-block;
}

.section-line {
    width: 60px;
    height: 4px;
    background: var(--accent);
    margin-top: 15px;
    border-radius: 10px;
}

/* --- CARDS (Optimizado para Catálogo e Historial) --- */
.card-loanware {
    background: white;
    padding: 30px;
    border-radius: 20px;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    will-change: transform;
}

.card-loanware:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.12);
}

.card-icon-box {
    width: 55px;
    height: 55px;
    background: var(--primary);
    color: var(--accent);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 25px;
    font-size: 1.5rem;
}

/* --- BOTONES DE TARJETAS --- */
.btn-card-primary {
    background: var(--primary);
    color: white;
    text-align: center;
    padding: 14px;
    border-radius: 12px;
    font-weight: 700;
    margin-top: auto;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
}

.btn-card-primary:hover {
    background: #000;
    transform: scale(1.02);
}

.btn-card-secondary {
    background: #f1f5f9;
    color: #475569;
    text-align: center;
    padding: 14px;
    border-radius: 12px;
    font-weight: 700;
    margin-top: auto;
    transition: background 0.3s;
    text-decoration: none;
}

.btn-card-secondary:hover {
    background: #e2e8f0;
}

/* --- TABLAS Y DATOS --- */
.table-responsive {
    overflow-x: auto;
    border-radius: 12px;
    margin-top: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

th, td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    background-color: var(--primary);
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
}

tr:hover td {
    background-color: #f8fafc;
}

/* --- ESTADOS (Pills) --- */
.estado {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.estado.Pendiente { background: #fef3c7; color: #d97706; }
.estado.Aprobado { background: #dcfce7; color: #15803d; }
.estado.Rechazado { background: #fee2e2; color: #b91c1c; }

/* --- FORMULARIOS --- */
input[type="number"], input[type="text"], textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.3s ease;
}

input:focus, textarea:focus {
    border-color: var(--accent-dark);
    box-shadow: 0 0 0 4px rgba(9, 255, 0, 0.1);
}

/* --- FOOTER --- */
.footer-main {
    background: var(--primary);
    padding-top: 60px;
    color: white;
    margin-top: auto;
}

.footer-main h3 span { color: var(--accent); }

.social-btn {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: white;
    transition: 0.3s;
    text-decoration: none;
}

.social-btn:hover {
    background: var(--accent);
    color: var(--primary);
    transform: translateY(-3px);
}

.footer-bottom-bar {
    border-top: 1px solid rgba(255,255,255,0.05);
    padding: 25px;
    text-align: center;
    font-size: 0.7rem;
    color: rgba(255,255,255,0.4);
    letter-spacing: 2px;
}

/* --- ACCESIBILIDAD --- */
.reading-guide {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--accent);
    z-index: 9999;
    pointer-events: none;
    display: none;
}

.accessibility-wrapper {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 10000 !important;
}

.btn-access {
    width: 65px;
    height: 65px;
    background: #1a392a !important; 
    border: 2px solid #09FF00; 
    border-radius: 50%;
    cursor: grab;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 25px rgba(9, 255, 0, 0.3);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: pulse-neon 2s infinite;
}

.btn-access i {
    color: #09FF00 !important;
    font-size: 1.8rem !important;
    text-shadow: 0 0 8px rgba(9, 255, 0, 0.6);
}

.btn-access:hover {
    transform: scale(1.1) rotate(5deg);
    background: #09FF00 !important;
}

.btn-access:hover i {
    color: #1a392a !important;
    text-shadow: none;
}

/* Menú de Accesibilidad */
.access-menu {
    position: absolute;
    bottom: 80px;
    right: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    width: 260px;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    display: none; /* Se activa con la clase .active desde tu JS */
    flex-direction: column;
    gap: 12px;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

/* Esta es la clave para que tu JS funcione */
.access-menu.active {
    display: flex;
    animation: slideUp 0.3s ease-out;
}

.access-section {
    background: rgba(26, 57, 42, 0.05);
    padding: 12px;
    border-radius: 15px;
}

/* --- ESTILOS PARA DALTONISMO (Sincronizado con tu JS) --- */

/* Protanopia (Rojo débil) */
.protanopia {
    filter: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg"><filter id="f"><feColorMatrix type="matrix" values="0.567, 0.433, 0, 0, 0, 0.558, 0.442, 0, 0, 0, 0, 0.242, 0.758, 0, 0, 0, 0, 0, 1, 0"/></filter></svg>#f');
}

/* Deuteranopia (Verde débil) */
.deuteranopia {
    filter: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg"><filter id="f"><feColorMatrix type="matrix" values="0.625, 0.375, 0, 0, 0, 0.7, 0.3, 0, 0, 0, 0, 0.3, 0.7, 0, 0, 0, 0, 0, 1, 0"/></filter></svg>#f');
}

/* Ceguera Total / Alto Contraste */
.ceguera-total {
    filter: grayscale(100%) contrast(150%);
}

/* --- ANIMACIONES --- */

@keyframes pulse-neon {
    0% { box-shadow: 0 0 0 0 rgba(9, 255, 0, 0.6); }
    70% { box-shadow: 0 0 0 15px rgba(9, 255, 0, 0); }
    100% { box-shadow: 0 0 0 0 rgba(9, 255, 0, 0); }
}

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