﻿/* ============================================================
   VARIABLES GLOBALES
============================================================ */
:root {
    --color-primario: #6B0010;
    --color-secundario: #A1202F;
    --color-gris-claro: #f5f5f5;
}

/* ============================================================
   BASE GENERAL — DEGRADÉ GLOBAL
============================================================ */
html, body {
    min-height: 100%;
    margin: 0;
    padding: 0;
    background: linear-gradient( to bottom, #ffffff 0%, #f7e3e7 15%, #efc7cf 35%, #e7abb7 55%, #df8f9f 75%, #d77387 90%, #cf576f 100% ) !important;
    background-attachment: fixed;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: transparent !important;
}

main {
    flex: 1;
}

/* ============================================================
   NAVBAR
============================================================ */
.navbar {
    background-color: var(--color-primario) !important;
}

.navbar-brand,
.nav-link {
    color: #fff !important;
    font-weight: 500;
}

    .nav-link:hover {
        color: var(--color-secundario) !important;
    }

/* ============================================================
   BOTONES GENERALES
============================================================ */
.btn-primary {
    background-color: var(--color-primario);
    border-color: var(--color-primario);
}

    .btn-primary:hover {
        background-color: var(--color-secundario);
        border-color: var(--color-secundario);
    }

/* ============================================================
   CARRUSEL
============================================================ */
.carousel-item img {
    object-fit: cover;
    height: 70vh;
    filter: brightness(70%);
}

.carousel-caption {
    bottom: 25%;
    background-color: rgba(0,0,0,.6);
    border-radius: 8px;
    padding: 1.5rem;
}

    .carousel-caption h2 {
        font-size: 2.2rem;
    }

    .carousel-caption p {
        max-width: 700px;
    }

.carousel-indicators [data-bs-target] {
    background-color: #fff;
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.carousel-indicators .active {
    background-color: #FFD700;
}

/* ============================================================
   FORMULARIOS Y CARDS
============================================================ */
.card {
    border: 1px solid var(--color-primario);
}

.input-validation-error {
    border-color: #dc3545 !important;
}

/* ============================================================
   CAMPOS OBLIGATORIOS
============================================================ */
.campo-obligatorio {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    background-color: var(--color-primario);
    border-radius: 50%;
}

input + .campo-obligatorio {
    right: -2px;
}

select + .campo-obligatorio,
textarea + .campo-obligatorio {
    right: -12px;
}

/* ============================================================
   FOOTER PRINCIPAL
============================================================ */
footer.site-footer {
    background-color: #333 !important;
    color: #fff !important;
    text-align: center;
    padding: 12px 0;
    width: 100%;
    margin-top: auto;
    position: relative;
}

/* ============================================================
   FOOTER — PANEL CORRESPONSALES
============================================================ */
footer.corresp-footer {
    background-color: #111;
    color: #bbb;
    text-align: center;
    padding: 10px 0;
    font-size: 0.8rem;
    width: 100%;
    position: fixed;
    bottom: 0;
    left: 0;
    z-index: 100;
}

/* ============================================================
   LOGIN — REESTRUCTURACIÓN DEFINITIVA
============================================================ */

/* Elimina padding del main solo aquí */
body.login-page main {
    padding-top: 40px !important;
    padding-bottom: 40px !important;
}

/* Wrapper sin forzar altura */
body.login-page .login-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 40px 0;
}

/* TARJETA */
body.login-page .login-card-container {
    width: 100%;
    max-width: 420px !important;
    margin: 0 auto;
}

body.login-page .login-card {
    width: 100%;
    border-radius: 16px;
    background: #ffffffdd;
    backdrop-filter: blur(6px);
}

/* TÍTULO */
body.login-page .text-titulo {
    color: #2e2e2e !important;
    font-size: 1.6rem;
}

/* INPUTS MODERNOS */
body.login-page .modern-input {
    border-radius: 10px !important;
    border: 1px solid #ccc;
    padding: 10px 14px;
    font-size: 1rem;
}

    body.login-page .modern-input:focus {
        border-color: var(--color-primario);
        box-shadow: 0 0 8px rgba(107, 0, 16, .25);
    }

/* OJITO */
body.login-page .custom-input-group {
    display: flex;
}

    body.login-page .custom-input-group .modern-input {
        border-right: none !important;
        border-radius: 10px 0 0 10px !important;
    }

body.login-page .btn-pass-visor {
    border: 1px solid #ced4da !important;
    border-left: none !important;
    background: #fff !important;
    padding: 0 16px !important;
    height: 46px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0 10px 10px 0 !important;
}

    body.login-page .btn-pass-visor:hover {
        background-color: #f4f4f4 !important;
    }

    body.login-page .btn-pass-visor i {
        font-size: 1.2rem;
        color: #555;
    }

/* BOTÓN LOGIN */
body.login-page .btn-login-modern {
    display: inline-block;
    background-color: var(--color-primario);
    color: #fff;
    border-radius: 10px;
    padding: 10px 32px !important;
    font-size: 1.05rem;
    font-weight: 600;
    transition: 0.25s ease;
    border: none;
}

    body.login-page .btn-login-modern:hover {
        background-color: var(--color-secundario);
        transform: translateY(-2px);
    }
/* ============================================================
   ESTILOS ESPECÍFICOS PARA VISTA CUENTA JUDICIAL
============================================================ */

/* Contenedor principal del formulario */
.form-container {
    max-width: 1400px;
    margin: 20px auto;
    padding: 25px 30px;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(107, 0, 16, 0.1);
    border: 1px solid rgba(107, 0, 16, 0.15);
}

    /* Títulos principales */
    .form-container h2 {
        margin-bottom: 35px;
        color: var(--color-primario);
        font-weight: 700;
        text-align: center;
        padding-bottom: 15px;
        border-bottom: 2px solid var(--color-primario);
    }

/* Secciones del formulario */
.form-section {
    margin-bottom: 25px;
    padding: 20px;
    background-color: #ffffff;
    border-radius: 10px;
    border-left: 5px solid var(--color-primario);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

    .form-section:hover {
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
        transform: translateY(-2px);
    }

    /* Títulos de sección */
    .form-section h5 {
        color: var(--color-primario);
        font-weight: 600;
        margin-bottom: 20px;
        padding-bottom: 10px;
        border-bottom: 1px solid rgba(107, 0, 16, 0.2);
    }

/* Etiquetas de formulario */
.form-label {
    font-weight: 500;
    color: #333;
    margin-bottom: 8px;
}

/* Campos de formulario */
.form-control {
    border-radius: 8px;
    border: 1px solid #ddd;
    padding: 10px 14px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

    .form-control:focus {
        border-color: var(--color-primario);
        box-shadow: 0 0 0 3px rgba(107, 0, 16, 0.15);
        outline: none;
    }

    /* Campos de solo lectura */
    .form-control[readonly] {
        background-color: #f9f9f9;
        border-color: #e0e0e0;
        cursor: not-allowed;
        color: #666;
    }

        .form-control[readonly]:focus {
            border-color: #e0e0e0;
            box-shadow: none;
        }

/* Campos de fecha específicos */
input[type="date"].form-control {
    padding: 9px 14px;
}

/* Campos de número (monto) */
input[type="number"].form-control {
    padding-right: 10px;
}

/* Contenedor de botón */
.btn-container {
    text-align: center;
    margin-top: 40px;
    padding-top: 25px;
    border-top: 1px solid #eee;
}

    /* Botón principal */
    .btn-container .btn-primary {
        background-color: var(--color-primario);
        border-color: var(--color-primario);
        border-radius: 10px;
        padding: 12px 40px;
        font-size: 1.1rem;
        font-weight: 600;
        transition: all 0.3s ease;
    }

        .btn-container .btn-primary:hover {
            background-color: var(--color-secundario);
            border-color: var(--color-secundario);
            transform: translateY(-2px);
            box-shadow: 0 6px 12px rgba(107, 0, 16, 0.2);
        }

        .btn-container .btn-primary:active {
            transform: translateY(0);
        }

/* Alertas */
.alert {
    border-radius: 10px;
    border: none;
    margin-bottom: 25px;
    padding: 15px 20px;
}

.alert-danger {
    background-color: rgba(220, 53, 69, 0.1);
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.alert-success {
    background-color: rgba(40, 167, 69, 0.1);
    color: #155724;
    border-left: 4px solid #28a745;
}

/* Mensajes de validación */
.text-danger {
    font-size: 0.85rem;
    margin-top: 5px;
    display: block;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .form-container {
        padding: 20px 15px;
        margin: 15px;
    }

    .form-section {
        padding: 15px;
    }

    .form-container h2 {
        font-size: 1.5rem;
    }

    .btn-container .btn-primary {
        padding: 10px 30px;
        font-size: 1rem;
        width: 100%;
    }
}

/* Estilos para tabla de resultados en Panel */
#tablaResultados {
    margin-top: 20px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

    #tablaResultados thead {
        background-color: var(--color-primario) !important;
    }

    #tablaResultados th {
        color: white;
        font-weight: 600;
        border: none;
        padding: 12px 15px;
    }

    #tablaResultados td {
        padding: 10px 15px;
        vertical-align: middle;
    }

    /* Filas clickeables */
    #tablaResultados tbody tr {
        cursor: pointer;
        transition: all 0.2s ease;
    }

        #tablaResultados tbody tr:hover {
            background-color: rgba(107, 0, 16, 0.05) !important;
        }

        #tablaResultados tbody tr.selected {
            background-color: rgba(107, 0, 16, 0.1) !important;
            font-weight: 500;
        }

/* Paginación */
.pagination {
    margin-top: 25px;
}

.page-link {
    color: var(--color-primario);
    border: 1px solid #ddd;
    margin: 0 2px;
    border-radius: 5px;
}

.page-item.active .page-link {
    background-color: var(--color-primario);
    border-color: var(--color-primario);
}

.page-link:hover {
    color: var(--color-secundario);
    background-color: rgba(107, 0, 16, 0.05);
    border-color: var(--color-primario);
}

/* Card del formulario de búsqueda */
.card.shadow-sm {
    border: 1px solid rgba(107, 0, 16, 0.15);
    border-radius: 12px;
    overflow: hidden;
}

/* Spinner loader */
.spinner-border.text-primary {
    color: var(--color-primario) !important;
}

/* Ajustes específicos para la página de cuenta */
body .form-control:not([readonly]) {
    background-color: #fff;
}

body .form-control[readonly] {
    background-color: #f8f9fa;
}

/* Separadores visuales */
.row.mb-3 {
    margin-bottom: 1.5rem !important;
}

/* Mejora para inputs en filas */
.row .col-md-3 .mb-3,
.row .col-md-4 .mb-3,
.row .col-md-6 .mb-3,
.row .col-md-8 .mb-3,
.row .col-md-12 .mb-3 {
    margin-bottom: 1rem !important;
}

/* ============================================================
   MEJORA VISUAL — VISTA CUENTA JUDICIAL
============================================================ */

/* Cabecera de la vista */
.cuenta-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

    .cuenta-header h2 {
        font-size: 1.9rem;
        font-weight: 700;
        color: var(--color-primario);
        display: flex;
        align-items: center;
        gap: 10px;
    }

        .cuenta-header h2::before {
            content: "⚖️";
            font-size: 1.9rem;
        }

/* Botón Volver */
.btn-volver {
    background-color: #ffffff;
    border: 2px solid var(--color-primario);
    color: var(--color-primario);
    font-weight: 600;
    padding: 8px 22px;
    border-radius: 10px;
    transition: all .3s ease;
}

    .btn-volver:hover {
        background-color: var(--color-primario);
        color: #fff;
        transform: translateY(-2px);
    }

/* Inputs más modernos */
.form-control {
    border-radius: 10px !important;
    border: 1px solid #d8d8d8;
    transition: 0.25s ease;
}

    .form-control:focus {
        border-color: var(--color-secundario);
        box-shadow: 0 0 6px rgba(107, 0, 16, .25);
    }

    /* Inputs readonly más elegantes */
    .form-control[readonly] {
        background: #fafafa !important;
        border-color: #e6e6e6 !important;
        color: #666 !important;
    }

/* Resaltado de secciones */
.form-section {
    border-left-width: 6px !important;
    border-left-style: solid;
    border-left-color: var(--color-secundario);
    background: #ffffff;
}

    /* Títulos de sección */
    .form-section h5 {
        font-size: 1.15rem;
        font-weight: 700;
        color: var(--color-primario);
    }

/* Etiquetas */
.form-label {
    font-weight: 600;
    color: #444;
}

/* Inputs alineados y mejor separados */
.row .col-md-3 .mb-3,
.row .col-md-4 .mb-3,
.row .col-md-6 .mb-3,
.row .col-md-8 .mb-3,
.row .col-md-12 .mb-3 {
    margin-bottom: 1.1rem !important;
}

/* Botón Guardar Moderno */
.btn-guardar {
    background-color: var(--color-primario) !important;
    border: none;
    padding: 12px 50px;
    border-radius: 12px;
    font-size: 1.15rem;
    font-weight: 700;
    transition: all 0.25s ease;
}

    .btn-guardar:hover {
        background-color: var(--color-secundario) !important;
        box-shadow: 0 6px 15px rgba(107, 0, 16, .25);
        transform: translateY(-2px);
    }

/* Mensajes */
.alert {
    border-radius: 12px;
    padding: 18px 20px;
}

/* Tabla más profesional */
#tablaResultados {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08) !important;
}

    #tablaResultados tbody tr:hover {
        background-color: rgba(107, 0, 16, .08) !important;
    }

/* Vista mejorada en celulares */
@media (max-width: 768px) {
    .cuenta-header h2 {
        font-size: 1.4rem;
    }

    .btn-volver {
        padding: 6px 16px;
        font-size: 0.85rem;
    }
}
.readonly-field {
    background-color: #e9ecef;
    opacity: 1;
    pointer-events: none;
}
