

/* ==========================================
   1. VARIABLES Y REINICIO GLOBAL
   ========================================== */
:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-color: #0f172a;
    --subtext-color: #64748b;
    --border-color: #e2e8f0;
    --error-color: #ef4444;
    --radius: 12px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

html, body {
    height: 100%;
    background-color: var(--bg-color);
    color: var(--text-color);
}

/* El formulario ASP.NET debe actuar como el contenedor Flexport principal */
#form1 {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1.5rem;
}

/* ==========================================
   2. ELEMENTOS FIJOS EN PANTALLA (HEADER / FOOTER)
   ========================================== */

/* Título superior centralizado */
.titulo-fixed {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    margin: 0;
    padding: 0;
    z-index: 1000;
    text-align: center;
    white-space: nowrap;
}

/* Logo superior derecho */
.logo-fixed {
    position: fixed;
    top: 20px;
    right: 20px;
    max-width: 150px;
    height: auto;
    z-index: 1000;
}

/* Mensaje de Usuario y Cerrar Sesión - SIEMPRE VISIBLE EN INFERIOR IZQUIERDA */
.mensaje-fixed {
    position: fixed;
    /*bottom: 20px;*/   /*esto lo deja abajo*/
    top: 20px; /* Cambiado de bottom a top */
    left: 20px;
    z-index: 9999; /* Z-index alto para flotar sobre tablas, cards y formularios */
    display: inline-flex;
    flex-direction: column;
    gap: 4px;
    line-height: 1.3;
    padding: 10px 14px;
    text-align: left;
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.link-logout {
    color: #e74c3c;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: bold;
    cursor: pointer;
    display: inline-block;
}

    .link-logout:hover {
        color: #c0392b;
        text-decoration: underline;
    }

/* Ajustes Responsive para Elementos Fijos */
@media (max-width: 600px) {
    .titulo-fixed {
        top: 10px;
        font-size: 1.1rem;
    }

    .logo-fixed {
        top: 10px;
        right: 10px;
        max-width: 90px;
    }

    .mensaje-fixed {
        bottom: 10px;
        left: 10px;
        font-size: 0.85rem;
        padding: 8px 10px;
    }
}

/* ==========================================
   3. CONTENEDORES Y TARJETAS PRINCIPALES
   ========================================== */
.main-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 60px;
    margin: 0 auto;
    width: 100%;
}

.detalle-card {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 20px;
    width: 100%;
    max-width: 600px;
    margin: 10px auto 0 auto;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: left;
}

.grid-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding: 20px;
}

@media (max-width: 768px) {
    .grid-cards {
        display: flex;
        overflow-x: auto;
        padding-bottom: 10px;
    }

    .card {
        min-width: 220px;
        flex: 0 0 auto;
    }
}

.card {
    background: #ffffff;
    border-radius: 12px;
    padding: 30px 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid #eef2f5;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
}

    .card:hover {
        transform: translateY(-5px);
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    }

.card-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.card h3 {
    margin: 10px 0;
    color: #2c3e50;
    font-size: 1.2rem;
}

.card p {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-bottom: 20px;
}

/* ==========================================
   4. FORMULARIOS Y BOTONES
   ========================================== */
.form-group {
    margin-bottom: 1.25rem;
    display: flex;
    flex-direction: column;
}

    .form-group label {
        font-size: 0.875rem;
        font-weight: 600;
        margin-bottom: 0.5rem;
        color: var(--text-color);
    }

.label-centered {
    text-align: center;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

    .form-control:focus {
        border-color: var(--primary-color);
        box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
    }

.card-btn {
    background-color: #27ae60;
    color: white;
    border: none;
    padding: 10px 25px;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    width: 100%;
    transition: background-color 0.2s ease;
}

    .card-btn:hover {
        background-color: #219150;
    }

.btn {
    width: 100%;
    padding: 0.85rem;
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
    background-color: var(--primary-color);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    margin-top: 0.5rem;
}

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

.admin-actions {
    margin-top: 30px;
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.sec-btn {
    background-color: #ecf0f1;
    color: #34495e;
    border: 1px solid #bdc3c7;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
}

    .sec-btn:hover {
        background-color: #bdc3c7;
    }

    .sec-btn.logout {
        background-color: #e74c3c;
        color: white;
        border: none;
    }

        .sec-btn.logout:hover {
            background-color: #c0392b;
        }

/* ==========================================
   5. LOGIN & MFA PREVIEW
   ========================================== */
.preview-container {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.login-card {
    background: var(--card-bg);
    width: 100%;
    padding: 2.5rem 2rem;
    border-radius: var(--radius);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
    border: 1px solid var(--border-color);
}

.header {
    text-align: center;
    margin-bottom: 1.5rem;
}

    .header h2 {
        font-size: 1.5rem;
        font-weight: 700;
        color: var(--text-color);
        margin-bottom: 0.5rem;
    }

    .header p {
        font-size: 0.875rem;
        color: var(--subtext-color);
    }

.qr-container {
    display: flex;
    justify-content: center;
    align-items: center;
    background: #fff;
    padding: 1rem;
    border: 1px dashed var(--border-color);
    border-radius: 8px;
    margin: 1rem 0;
}

.qr-image {
    width: 180px;
    height: 180px;
}

.mfa-input {
    text-align: center;
    letter-spacing: 0.35em;
    font-size: 1.5rem;
    font-weight: bold;
}

/* ==========================================
   6. MENSAJES DE ALERTA Y AYUDA
   ========================================== */
.message-container {
    margin-bottom: 15px;
    text-align: center;
}

    .message-container span:not(:empty) {
        display: block;
        padding: 10px;
        background-color: #f8d7da;
        color: #721c24;
        border: 1px solid #f5c6cb;
        border-radius: 4px;
    }

.alert-error {
    display: block;
    color: var(--error-color);
    font-size: 0.875rem;
    text-align: center;
    margin-top: 1rem;
}

.instruction-text {
    font-size: 0.875rem;
    color: var(--subtext-color);
    line-height: 1.5;
    text-align: center;
    margin-bottom: 1rem;
}

.preview-divider {
    border-top: 2px dashed #cbd5e1;
    margin: 3rem 0;
    position: relative;
}

    .preview-divider::after {
        content: "VISTA DEL PASO 2 (MFA)";
        position: absolute;
        top: -12px;
        left: 50%;
        transform: translateX(-50%);
        background: #f8fafc;
        padding: 0 10px;
        font-size: 0.75rem;
        font-weight: bold;
        color: #64748b;
    }


/* ==========================================
   7. BOTÓN DESCARGAR Y TIPOS DE ARCHIVO
   ========================================== */

/* Estilo base del botón */
.btn-descargar {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background-color: #2b78e4;
    color: #ffffff !important;
    font-weight: 600;
    font-size: 14px;
    border-radius: 6px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

    /* Animación del icono dentro del botón */
    .btn-descargar i {
        font-size: 16px;
        transition: transform 0.2s ease;
    }

    /* Efecto Hover cuando está activo */
    .btn-descargar:hover {
        background-color: #1a5bb8;
        color: #ffffff !important;
        transform: translateY(-1px);
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
    }

        .btn-descargar:hover i {
            transform: scale(1.15);
        }

    /* Estado Deshabilitado */
    .btn-descargar.disabled,
    .btn-descargar[disabled] {
        background-color: #d1d5db !important;
        color: #9ca3af !important;
        cursor: not-allowed;
        transform: none;
        box-shadow: none;
        pointer-events: none; /* Bloquea clics en el navegador */
    }

        .btn-descargar.disabled i {
            color: #9ca3af !important;
        }

/* Colores personalizados según el tipo de archivo */
.icono-pdf {
    color: #e74c3c;
}
/* Rojo PDF */
.icono-excel {
    color: #27ae60;
}
/* Verde Excel */
.icono-word {
    color: #2980b9;
}
/* Azul Word */
.icono-zip {
    color: #f39c12;
}
/* Naranja ZIP */
.icono-imagen {
    color: #8e44ad;
}
/* Morado Imagen */

/* PASSWORD*/
.password-rules {
    font-size: 0.85rem;
    margin-top: 8px;
    padding: 10px;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
}

    .password-rules ul {
        list-style: none;
        padding-left: 0;
        margin: 5px 0 0 0;
    }

    .password-rules li {
        margin-bottom: 4px;
        color: #dc3545; /* Rojo por defecto */
        transition: color 0.3s ease;
    }

        .password-rules li.valid {
            color: #198754; /* Verde al cumplir la regla */
        }

            .password-rules li.valid::before {
                content: "✓ ";
                font-weight: bold;
            }

        .password-rules li.invalid::before {
            content: "✖ ";
            font-weight: bold;
        }

/* ---- Added for the ASP.NET Core version ---- */
.form-inline { display: inline; margin: 0; }
button.link-logout, button.link-button {
    background: none; border: none; padding: 0; cursor: pointer; font: inherit;
}
.link-button { color: #555; text-decoration: underline; margin-top: 12px; }
.usuario-conectado { font-weight: bold; color: green; margin-right: 12px; }
.mensaje-error { color: red; }
.mensaje-ok { color: green; font-weight: bold; }
.button-row { margin-top: 15px; display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
a.card-btn { display: inline-block; text-decoration: none; text-align: center; }
.qr-code { display: block; margin: 10px auto; }
.sin-datos { color: gray; font-style: italic; margin-top: 10px; }
