/*
 * Estilos del sitio Consulta de Pagos (Recibo Electrónico de Pago).
 * Sigue la guía de estilos del portal "Servicios en Línea" (GUIA_ESTILOS_PORTAL.md de TramitesenLinea),
 * ya que las páginas se muestran dentro de un iframe en Trámites en Línea (STL10039).
 */

:root {
    /* Marca */
    --gye-navy:    #132267;
    --gye-navy2:   #1B2E72;
    --gye-azul:    #157AB0;
    --gye-azul2:   #1DA9E1;
    --gye-oro:     #F6B827;
    --gye-oro-h:   #E2A50F;

    /* Tintes de cyan para superficies */
    --gye-azul-bg:  #E8F5FC;
    --gye-azul-bg2: #D3ECF8;
    --gye-azul-bd:  #BFE3F4;

    /* Estado */
    --gye-verde: #12B76A;
    --gye-rojo:  #F04438;
    --gye-amber: #F79009;

    /* Neutros */
    --gye-fondo:  #F0F3FA;
    --gye-blanco: #FFFFFF;
    --gye-borde:  #E2E8F4;
    --gye-txt1:   #0D1529;
    --gye-txt2:   #5A6A8A;
    --gye-txt3:   #98A7C4;

    /* Tipografía */
    --font: 'Barlow', 'Open Sans', sans-serif;
    --gye-font: var(--font);
}

/* ---------- Base ---------- */

*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}

body {
    background: var(--gye-fondo);
    color: var(--gye-txt1);
    font-family: var(--font);
    font-size: 13px;
    line-height: 1.5;
}

input, select, button, textarea {
    font-family: inherit;
}

.material-symbols-outlined {
    font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* ---------- Área de contenido ---------- */

.contenido {
    padding: 20px 24px;
}

/* ---------- Panel ---------- */

.panel {
    background: var(--gye-blanco);
    border: 1px solid var(--gye-borde);
    border-radius: 16px;
    padding: 20px;
}

.panel-centrado {
    max-width: 860px;
    margin: 0 auto;
}

.panel-ancho {
    max-width: 1100px;
    margin: 0 auto;
}

.panel-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.panel-titulo {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--gye-txt1);
}

.panel-subtitulo {
    margin: 2px 0 0;
    font-size: 12px;
    font-weight: 400;
    color: var(--gye-txt2);
}

/* ---------- Chips de ícono ---------- */

.chip-icono {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
}

.chip-icono .material-symbols-outlined {
    font-size: 20px;
}

.ti-azul  { background: #E8F5FC; color: #132267; }
.ti-amber { background: #FEF6E4; color: #92400E; }

/* ---------- Formularios ---------- */

.campo-label {
    display: block;
    margin-bottom: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: var(--gye-txt2);
}

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

.fila-accion .campo-flex {
    flex: 1 1 auto;
    min-width: 0;
}

/* ---------- Botones ---------- */

.btn-primario {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 40px;
    padding: 0 20px;
    border: 0;
    border-radius: 10px;
    background: var(--gye-azul2);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
    transition: all .16s;
}

.btn-primario:hover,
.btn-primario:focus {
    background: var(--gye-azul);
    color: #fff;
    text-decoration: none;
    outline: none;
}

.btn-secundario {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--gye-txt2);
    font-size: 12.5px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all .16s;
}

.btn-secundario:hover,
.btn-secundario:focus {
    color: var(--gye-txt1);
    text-decoration: underline;
}

.btn-secundario .material-symbols-outlined {
    font-size: 18px;
}

.btn-icono {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border: 1.5px solid var(--gye-azul-bd);
    border-radius: 10px;
    background: var(--gye-azul-bg);
    color: var(--gye-azul);
    text-decoration: none;
    cursor: pointer;
    transition: all .16s;
}

.btn-icono:hover,
.btn-icono:focus {
    transform: scale(1.1);
    outline: none;
}

.btn-icono .material-symbols-outlined {
    font-size: 20px;
}

/* Acción PDF dentro de tablas */
.btn-pdf {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #FDEDED;
    color: #B91C1C;
    text-decoration: none;
    transition: all .16s;
}

.btn-pdf:hover,
.btn-pdf:focus {
    background: #FBD5D5;
    color: #B91C1C;
    outline: none;
}

.btn-pdf .material-icons {
    font-size: 18px;
}

/* ---------- Inputs ---------- */

.input {
    width: 100%;
    height: 40px;
    padding: 10px 14px;
    border: 1.5px solid var(--gye-borde);
    border-radius: 10px;
    background: var(--gye-blanco);
    color: var(--gye-txt1);
    font-size: 13px;
    transition: all .16s;
}

.input:focus {
    border-color: var(--gye-azul2);
    outline: none;
}

.input::placeholder {
    color: var(--gye-txt3);
}

.input-centro {
    text-align: center;
}

.campo-corto {
    max-width: 280px;
}

/* Varios campos cortos en una misma fila (p. ej. año y número de convenio) */
.campos-fila {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.campos-fila > div {
    width: 180px;
}

/* Texto de los validadores de ASP.NET (RequiredFieldValidator, etc.) */
.validador {
    display: block;
    margin-top: 4px;
    font-size: 11.5px;
    font-weight: 600;
    color: #B42318;
}

/* ---------- Mensajes de sistema ---------- */

.msg {
    margin: 0 0 16px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
}

.msg-separado {
    margin-top: 12px;
}

.msg-exito       { background: #E7F7EF; border: 1px solid #12B76A; color: #027A48; }
.msg-advertencia { background: #FEF3E2; border: 1px solid #F79009; color: #B54708; }
.msg-error       { background: #FDEDED; border: 1px solid #F04438; color: #B42318; }

/* Nota informativa (texto largo, alineado a la izquierda) */
.nota {
    margin: 16px 0 0;
    padding: 12px 16px;
    border: 1px solid var(--gye-azul-bd);
    border-radius: 10px;
    background: var(--gye-azul-bg);
    color: var(--gye-navy);
    font-size: 12.5px;
}

.nota p {
    margin: 0;
}

.nota p + p {
    margin-top: 6px;
}

/* ---------- Bloques de la página ---------- */

.seccion + .seccion {
    margin-top: 22px;
    padding-top: 22px;
    border-top: 1px solid var(--gye-borde);
}

.seccion-titulo {
    margin: 0 0 10px;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--gye-txt1);
}

.texto {
    margin: 0 0 10px;
    color: var(--gye-txt2);
    text-align: justify;
}

.texto strong {
    color: var(--gye-txt1);
    font-weight: 600;
}

.dos-columnas {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.imagen-referencia {
    display: block;
    max-width: 100%;
    height: auto;
    border: 1px solid var(--gye-borde);
    border-radius: 12px;
}

.panel-head-accion {
    margin-left: auto;
    align-self: flex-start;
}

/* Código catastral: Sector · Manzana · Lote · División · Phv · Phh · Número · ayuda */
.codigo-catastral {
    display: grid;
    grid-template-columns: repeat(7, minmax(56px, 1fr)) auto;
    gap: 10px;
    align-items: end;
}

.codigo-catastral .campo-label {
    white-space: nowrap;
}

/* Captcha + botón de consulta */
.captcha-fila {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.captcha-img {
    height: 40px;
    border: 1px solid var(--gye-borde);
    border-radius: 8px;
}

.captcha-fila .input {
    width: 140px;
}

.panel-pie {
    display: flex;
    justify-content: center;
    margin-top: 22px;
}

/* ---------- Datos clave (contribuyente, totales) ---------- */

.datos-resumen {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}

.datos-resumen:empty {
    display: none;
}

.dato {
    padding: 14px 18px;
    border: 1px solid var(--gye-borde);
    border-radius: 14px;
    background: var(--gye-blanco);
}

.dato-label {
    display: block;
    margin-bottom: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: var(--gye-txt2);
}

.dato-valor {
    display: block;
    font-size: 15px;
    font-weight: 700;
    color: var(--gye-txt1);
}

.dato-cifra {
    font-size: 26px;
    font-weight: 800;
    line-height: 1;
}

/* ---------- Tabla de datos ---------- */

.tabla-contenedor {
    overflow-x: auto;
}

/* !important: el GridView de ASP.NET escribe style="border-collapse:collapse" en línea */
.tabla-datos {
    width: 100%;
    border: 1px solid var(--gye-borde) !important;
    border-collapse: separate !important;
    border-spacing: 0;
    border-radius: 12px;
    overflow: hidden;
    font-size: 12.5px;
}

.tabla-datos th {
    background: var(--gye-fondo);
    color: var(--gye-txt2);
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    text-align: left;
    white-space: nowrap;
    padding: 10px 14px;
    border-bottom: 1px solid var(--gye-borde);
}

.tabla-datos td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--gye-borde);
    vertical-align: middle;
    color: var(--gye-txt1);
}

.tabla-datos tr:first-child th:first-child { border-top-left-radius: 11px; }
.tabla-datos tr:first-child th:last-child  { border-top-right-radius: 11px; }

.tabla-datos tr:last-child td {
    border-bottom: 0;
}

.tabla-datos tr:hover td {
    background: #f7f9ff;
}

/* Columna identificadora (año, contrato…) */
.tabla-datos .col-anio,
.tabla-datos .col-clave {
    color: var(--gye-azul2);
    font-weight: 700;
}

/* Códigos / números de referencia */
.tabla-datos .col-codigo {
    font-family: monospace;
    font-size: 11.5px;
    color: var(--gye-txt2);
    white-space: nowrap;
}

/* Texto secundario dentro de la tabla */
.tabla-datos .col-sec {
    font-size: 11.5px;
    color: var(--gye-txt2);
}

/* Fechas y periodos: no se cortan en dos líneas */
.tabla-datos .col-fecha {
    white-space: nowrap;
}

.tabla-datos .col-monto {
    font-weight: 600;
    text-align: right;
    white-space: nowrap;
}

.tabla-datos .col-accion {
    text-align: center;
}

/* Columnas que el code-behind lee por posición pero no se muestran */
.tabla-datos .columnaOculta {
    display: none;
}

/* ---------- Estado vacío / error ---------- */

.estado-vacio {
    padding: 48px 20px;
    text-align: center;
}

.estado-vacio .estado-icono {
    font-size: 40px;
    color: var(--gye-txt3);
}

.estado-vacio .estado-titulo {
    margin: 10px 0 6px;
    font-size: 15px;
    font-weight: 700;
    color: var(--gye-txt1);
}

.estado-vacio .estado-texto {
    max-width: 520px;
    margin: 0 auto;
    font-size: 13px;
    color: var(--gye-txt2);
    word-break: break-word;
}

.estado-vacio .estado-acciones {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 22px;
}

/* ---------- Overlay "Procesando…" ---------- */

.overlay-procesando {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
    align-items: center;
    justify-content: center;
    background: rgba(15, 27, 61, .35);
}

.overlay-caja {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 22px;
    border-radius: 12px;
    background: var(--gye-blanco);
    box-shadow: 0 8px 32px rgba(15, 27, 61, .16), 0 2px 6px rgba(0, 0, 0, .07);
    font-size: 14px;
    font-weight: 600;
    color: var(--gye-txt1);
}

.spinner {
    width: 22px;
    height: 22px;
    border: 3px solid var(--gye-borde);
    border-top-color: var(--gye-azul2);
    border-radius: 50%;
    animation: spin .7s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ---------- Paginación ---------- */

.paginacion {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 12px;
}

.paginacion-info {
    font-size: 12px;
    color: var(--gye-txt2);
}

.paginacion-botones {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.pag-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border: 1px solid var(--gye-borde);
    border-radius: 8px;
    background: var(--gye-blanco);
    color: var(--gye-txt1);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: all .16s;
}

.pag-btn:hover,
.pag-btn:focus {
    background: var(--gye-fondo);
    border-color: var(--gye-azul2);
    outline: none;
}

/* Página actual: ASP.NET renderiza el LinkButton deshabilitado con la clase aspNetDisabled */
.pag-btn.aspNetDisabled {
    background: var(--gye-azul2);
    border-color: var(--gye-azul2);
    color: #fff;
    cursor: default;
}

/* ---------- Select2 (combo con buscador) ---------- */

.select2-container--default .select2-selection--single {
    height: 40px;
    border: 1.5px solid var(--gye-borde);
    border-radius: 10px;
    background: var(--gye-blanco);
    transition: all .16s;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    padding-left: 14px;
    padding-right: 34px;
    line-height: 37px;
    font-size: 13px;
    color: var(--gye-txt1);
}

.select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: var(--gye-txt3);
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 37px;
    right: 8px;
}

.select2-container--default.select2-container--open .select2-selection--single,
.select2-container--default.select2-container--focus .select2-selection--single {
    border-color: var(--gye-azul2);
    outline: none;
}

.select2-dropdown {
    border: 1.5px solid var(--gye-azul2);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 6px 24px rgba(15, 27, 61, .12);
    font-size: 13px;
}

.select2-container--open .select2-dropdown--below {
    margin-top: 4px;
}

.select2-container--open .select2-dropdown--above {
    margin-top: -4px;
}

.select2-container--default .select2-search--dropdown .select2-search__field {
    padding: 8px 12px;
    border: 1.5px solid var(--gye-borde);
    border-radius: 8px;
    outline: none;
}

.select2-container--default .select2-search--dropdown .select2-search__field:focus {
    border-color: var(--gye-azul2);
}

.select2-results__option {
    padding: 8px 14px;
}

.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
    background: var(--gye-azul-bg);
    color: var(--gye-azul);
}

.select2-container--default .select2-results__option--selected {
    background: var(--gye-azul-bg2);
    color: var(--gye-navy);
    font-weight: 600;
}

/* ---------- Responsive ---------- */

@media (max-width: 992px) {
    .dos-columnas {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 768px) {
    .codigo-catastral {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .contenido {
        padding: 12px;
    }

    .panel {
        padding: 16px;
    }

    .fila-accion {
        flex-direction: column;
        align-items: stretch;
    }

    .captcha-fila .input {
        flex: 1 1 120px;
    }

    .campos-fila > div {
        flex: 1 1 140px;
        width: auto;
    }

    .btn-primario {
        width: 100%;
    }
}
