/* CLIENT PORTAL STYLES */

@import url('https://fonts.googleapis.com/css2?family=Lato:wght@300;400;700;900&family=Raleway:wght@300;400;700;900&display=swap');

/* Aplicar a todo el portal */
body {
    font-family: 'Lato', sans-serif;
}

body h1, 
body h2, 
body h3, 
body h4, 
body h5, 
body h6 {
    font-family: 'Raleway', sans-serif;
    font-weight: 300;
}

.client-login-page,
.client-change-password,
.client-forgot-password {
    /*background-color: #f5f5f5;*/
    background-color: #2d2d2d;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 20px;
}

.login-container,
.change-password-container,
.forgot-password-container {
    max-width: 500px;
    width: 100%;
    margin: 0 auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    padding: 30px;
}

.login-header,
.change-password-header,
.forgot-password-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1,
.change-password-header h1,
.forgot-password-header h1 {
    color: #2d2d2d;
    font-weight: 600;
    margin-top: 20px;
    margin-bottom: 10px;
}

.login-header p,
.change-password-header p,
.forgot-password-header p {
    color: #666;
}

.login-logo {
    height: 80px;
    width: auto;
    margin: 0 auto;
}

.login-form {
    padding: 0 15px; /* Agrega padding izquierdo y derecho */
}

.alert {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s;
    box-sizing: border-box; /* Asegura que el padding no afecte el ancho total */
}

.form-control:focus {
    border-color: #fc6404;
    outline: none;
    box-shadow: 0 0 0 2px rgba(252, 100, 4, 0.2);
}

.form-text {
    display: none;
    font-size: 13px;
    color: #666;
    margin-top: 5px;
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.btn {
    font-size: 16px;
    display: inline-block;
    padding: 12px 25px;
    border-radius: 4px;
    text-align: center;
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    flex: 1;
}

.btn-primary {
    background-color: #fc6404;
    color: white;
    border: none;
}

.btn-primary:hover {
    background-color: #e05a03;
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: #f0f0f0;
    color: #333;
    border: none;
}

.btn-secondary:hover {
    background-color: #e0e0e0;
    transform: translateY(-2px);
}

.forgot-password {
    display: block;
    text-align: center;
    margin-top: 20px;
    color: #666;
    text-decoration: none;
}

.forgot-password:hover {
    color: #fc6404;
    text-decoration: underline;
}

.remote-assistance {
    margin-top: 20px;
    border-top: 1px solid #eee;
    padding-top: 20px;
}

.assistance-card {
    background: #f9f9f9;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.assistance-icon {
    font-size: 30px;
    color: #fc6404;
}

.assistance-content h3 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #333;
}

.assistance-content p {
    margin-bottom: 15px;
    color: #666;
}

.btn-download {
    background-color: #2d2d2d;
    color: white;
    padding: 10px 15px;
    border-radius: 4px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.btn-download:hover {
    background-color: #1a1a1a;
    color: white;
}


/* Estilos para el botón Home */
.home-return {
    text-align: center;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.home-icon {
    color: #666;
    font-size: 24px;
    transition: all 0.3s;
    display: inline-block;
    position: relative;
}

.home-icon:hover {
    color: #fc6404;
    transform: translateY(-2px);
}

/* Tooltip personalizado */
.home-icon::after {
    content: "Volver a Home";
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.3s;
    white-space: nowrap;
    pointer-events: none;
}

.home-icon:hover::after {
    opacity: 1;
}



/* DASHBOARD STYLES */
.client-dashboard {
    /*background-color: #f5f5f5;*/
    background-color: #2d2d2d;
    min-height: 100vh;
}

.dashboard-header {
    background-color: #2d2d2d;
    color: white;
    padding: 20px 0;
    margin-bottom: 30px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.client-info h1 {
    margin: 0;
    color: white;
    font-size: 24px;
}

.client-info p {
    margin: 5px 0 0;
    color: #ccc;
    font-size: 14px;
}

.header-actions {
    display: flex;
    gap: 15px;
}

.btn-outline {
    background: transparent;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px 15px;
    border-radius: 4px;
    transition: all 0.3s ease;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
}

.btn-danger {
    background: #dc3545;
    color: white;
    padding: 8px 15px;
    border-radius: 4px;
    border: none;
    transition: all 0.3s ease;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-danger:hover {
    background: #c82333;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.dashboard-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px 40px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.dashboard-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    margin-bottom: 20px; /* Espacio uniforme entre tarjetas */
}

.card-header {
    background: #f8f9fa;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
}

.card-header h2 {
    margin: 0;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #333;
}

.card-header i {
    color: #fc6404;
}

.card-body {
    padding: 20px;
}

.info-item {
    margin-bottom: 15px;
    display: flex;
}

.info-label {
    font-weight: 500;
    color: #666;
    min-width: 120px;
}

.info-value {
    color: #333;
    flex: 1;
}

.debt-amount {
    font-size: 28px;
    font-weight: 600;
    color: #dc3545;
    text-align: center;
    margin-bottom: 10px;
}

.debt-details {
    text-align: center;
    color: #666;
    font-size: 14px;
}

.invoices-section .dashboard-card,
.finance-section .dashboard-card {
    margin-bottom: 30px;
}

.section-header {
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
    margin-bottom: 0;
}

.section-header h2 {
    margin: 0;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #333;
}

.section-header i {
    color: #fc6404;
}

.table-responsive {
    overflow-x: auto;
}

.invoices-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
}

.invoices-table th,
.invoices-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.invoices-table th {
    background: #f8f9fa;
    font-weight: 500;
    color: #333;
}

.invoices-table tr:hover {
    background-color: #f9f9f9;
}


.invoices-table th.text-center,
.invoices-table td.text-center {
    text-align: center !important;
    padding-left: 0;
    padding-right: 0;
}


.invoices-table th:nth-child(5), /* "Monto" es la 5ta columna */
.invoices-table td:nth-child(5) {
    width: 120px; /* Ajusta según necesidad */
    text-align: right;
    padding-right: 15px; /* Añade espacio interno a la derecha */
}




.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status-pending {
    background-color: #fff3cd;
    color: #856404;
}

.pdf-download {
    color: #dc3545;
    font-size: 18px;
}

.pdf-download:hover {
    color: #c82333;
}

.no-invoices {
    text-align: center;
    padding: 40px 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
}

.no-invoices i {
    font-size: 40px;
    color: #28a745;
    margin-bottom: 15px;
}

.no-invoices p {
    margin: 0;
    color: #666;
}

.finance-contacts {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
}


.contact-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}


.contact-item {
    margin-bottom: 0;
    flex: 1;
    min-width: 0;
}

.contact-item i {
    color: #fc6404;
    width: 20px;
    text-align: center;
}

.contact-item a {
    color: #333;
    text-decoration: none;
}

.contact-item a:hover {
    color: #fc6404;
    text-decoration: underline;
}





/* Email copy tooltip styles */
.copy-email {
    position: relative;
    display: inline-block;
    cursor: pointer;
}

.email-tooltip {
    visibility: hidden;
    width: 100px;
    background-color: #555;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -50px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 12px;
}

.email-tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #555 transparent transparent transparent;
}

/* Tooltip normal (hover) */
.copy-email:hover::before {
    content: attr(data-tooltip);
    position: absolute;
    width: 100px;
    background-color: #555;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -50px;
    font-size: 12px;
}

/* Tooltip de copiado (active) */
.copy-email.active .email-tooltip {
    visibility: visible;
    opacity: 1;
}

.copy-email.active:hover::before {
    display: none;
}





/* forgot-password STYLES */
.client-forgot-password .forgot-password-container {
    position: relative;
    top: -30px;
}

/* FOOTER STYLES */
.main-footer {
    background-color: #2d2d2d;
    color: white;
    padding: 20px 0;
    margin-top: 40px;
    font-family: 'Lato', sans-serif;
}

.main-footer .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-content {
    margin: 0;
    font-size: 14px;
    color: #ccc;
}

.footer-content a {
    color: #fc6404;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-content a:hover {
    color: #ff8533;
    text-decoration: underline;
}

.footer-content strong {
    font-weight: 700;
}


/* Validaci贸n de Fortaleza STYLES */
.password-strength-meter {
    margin-top: 10px;
    height: 5px;
    background-color: #f0f0f0;
    border-radius: 3px;
    overflow: hidden;
}

.strength-bar {
    height: 100%;
    width: 0;
    transition: width 0.3s ease, background-color 0.3s ease;
}

.strength-label {
    margin-top: 5px;
    font-size: 12px;
    text-align: right;
    color: #666;
}

/* Strength levels colors */
.strength-weak {
    background-color: #dc3545;
}

.strength-medium {
    background-color: #fd7e14;
}

.strength-strong {
    background-color: #ffc107;
}

.strength-very-strong {
    background-color: #28a745;
}


/* PDF MODAL STYLES */
.modal {
    display: none; /* Se controla con JS */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    overflow: auto; /* Permite scroll si el contenido del modal es muy alto */
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto; /* Centrado vertical y horizontal */
    padding: 0; /* El padding se manejará en header y body */
    border-radius: 8px;
    width: 90%;
    max-width: 900px; /* Límite para el ancho */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    animation: fadeInModal 0.3s ease-out; /* Opcional: animación de entrada */
}

/* Opcional: Animación para el modal */
@keyframes fadeInModal {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #444; /* Un borde ligeramente más claro que el fondo */
    background-color: #2d2d2d; /* NUEVO FONDO OSCURO */
    color: #f0f0f0; /* Color de texto claro por defecto para el header */
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: #ffffff; /* TEXTO DEL TÍTULO EN BLANCO */
    font-weight: 500; /* Un poco más de peso para el título */
}

.modal-header-actions {
    display: flex;
    align-items: center;
}

/* Estilo para los botones de acción en el header (Descargar, Imprimir) */
.btn-header-action {
    background-color: transparent;
    border: 1px solid #666; /* Borde de botón más claro sobre fondo oscuro */
    color: #f0f0f0;       /* ÍCONOS/TEXTO DE BOTÓN EN COLOR CLARO */
    padding: 6px 10px;
    margin-left: 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    line-height: 1;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.btn-header-action:hover {
    background-color: #4a4a4a; /* Fondo del botón al pasar el mouse */
    border-color: #888;       /* Borde del botón al pasar el mouse */
    color: #ffffff;           /* Color del ícono/texto al pasar el mouse */
}

/* Estilo específico para el botón de cerrar en el header */
.modal-header-actions .close-modal {
    font-size: 1.6rem;
    font-weight: bold;
    color: #aaa; /* 'TIMES' EN COLOR GRIS CLARO */
    background: none;
    border: none;
    padding: 0 5px;
    margin-left: 10px;
    line-height: 1;
    transition: color 0.2s ease;
}

.modal-header-actions .close-modal:hover {
    color: #ffffff; /* 'TIMES' EN BLANCO AL PASAR EL MOUSE */
}

.modal-body {
    padding: 20px;
    max-height: calc(100vh - 180px); /* Ajusta según tu header/footer/márgenes */
    overflow-y: auto; /* Para el scroll vertical del contenido del PDF */
    overflow-x: hidden; /* Para ocultar el scroll horizontal */
}

#pdfViewerContainer {
    width: 100%;
    overflow: auto;
    margin-bottom: 20px;
    border: 1px solid #eee;
    background: #f9f9f9;
    min-height: 500px;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}

#pdfCanvas {
    max-width: 100%;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.pdf-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
}



/* Spinner PDF CSS */
.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1); /* Gris claro para el rastro */
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border-left-color: #007bff; /* Color primario (azul, o el de tu tema) */
    animation: spin 1s linear infinite;
    margin: 0 auto 10px auto; /* Centrado y con espacio abajo */
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Para centrar el contenido del loading indicator si es necesario */
#pdfLoadingIndicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px; /* Dale una altura mínima para que se vea bien mientras carga */
}


/* MODAL DE DESCARGA */
        .loading-modal {
            display: none; /* Hidden by default */
            position: fixed; /* Stay in place */
            z-index: 1000; /* Sit on top */
            left: 0;
            top: 0;
            width: 100%; /* Full width */
            height: 100%; /* Full height */
            overflow: auto; /* Enable scroll if needed */
            background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
        }

        .loading-modal-content {
            background-color: #fefefe;
            margin: 15% auto; /* 15% from the top and centered */
            padding: 20px;
            border: 1px solid #888;
            width: 80%; /* Could be more or less, depending on screen size */
            max-width: 400px;
            text-align: center;
            border-radius: 8px;
            box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19);
        }

        .loading-modal-content .spinner {
            border: 4px solid #f3f3f3; /* Light grey */
            border-top: 4px solid #3498db; /* Blue */
            border-radius: 50%;
            width: 40px;
            height: 40px;
            animation: spin 2s linear infinite;
            margin: 0 auto 20px auto;
        }

        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }



/* RESPONSIVE STYLES */
@media (max-width: 768px) {
    body.client-login-page {
        padding: 10px;
        overflow-x: hidden;
    }

    .login-container {
        max-width: 95%;
        margin: 0 auto;
        padding: 20px 15px;
        transform: none !important;
        left: 0 !important;
    }
    
    .login-container,
    .change-password-container,
    .forgot-password-container {
        padding: 20px;
    }
    
    .header-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .header-actions {
        width: 100%;
        justify-content: center;
            display: flex;
    gap: 10px;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .contact-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .contact-item {
        flex: none;
        width: 100%;
    }
    
    
    /* Reordenar elementos para móviles */
    .contact-row {
        display: flex;
        flex-direction: column;
    }
    
    
    /* Ocultar columnas no esenciales en móviles */
    .invoices-table th:nth-child(1),
    .invoices-table td:nth-child(1),  /* Item */
    .invoices-table th:nth-child(2),
    .invoices-table td:nth-child(2),  /* Tipo */
    .invoices-table th:nth-child(6),
    .invoices-table td:nth-child(6),  /* Estado */
    .invoices-table th:nth-child(7),
    .invoices-table td:nth-child(7) { /* PDF */
        display: none;
    }
    
    /* Ajustar el ancho de las columnas visibles */
    .invoices-table th:nth-child(3),
    .invoices-table td:nth-child(3),  /* Folio */
    .invoices-table th:nth-child(4),
    .invoices-table td:nth-child(4),  /* Fecha */
    .invoices-table th:nth-child(5),
    .invoices-table td:nth-child(5) { /* Monto */
        width: auto;
        padding: 8px 10px;
    }
    
    /* Asegurar que la tabla siga siendo horizontal */
    .invoices-table {
        display: table;
        width: 100%;
    }
    
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    
    
    
    /* Asegurar el orden correcto: nombre, teléfono, email */
    .contact-row .contact-item:nth-child(1) { order: 1; }
    .contact-row .contact-item:nth-child(2) { order: 2; }
    .contact-row .contact-item:nth-child(3) { order: 3; }
    
    .form-actions {
        flex-direction: column;
        gap: 10px; /* Espacio entre botones */
    }
    
    .form-actions .btn {
        width: 100%;
        margin: 0; /* Elimina márgenes que podrían afectar el ancho */
        box-sizing: border-box; /* Asegura que el padding no afecte el ancho total */
    }
    
    .btn {
        width: 100%;
    }
    
    .assistance-card {
        flex-direction: column;
        text-align: center;
    }
    
    .btn-download {
        white-space: normal;
        word-wrap: break-word;
        padding: 10px;
        text-align: center;
        display: block;
        width: calc(100% - 20px);
        margin: 0 auto 10px;
    }
    
    .assistance-content {
        width: 100%;
        padding: 0 10px;
    }
    
    .modal-content {
        width: 95%;
        margin: 20px auto;
    }
    
    #pdfViewerContainer {
        min-height: 300px;
    }
}