.required::after {
    content: " *";
    color: red;
}

input[disabled]+label.required::after {
    display: none;
}

/* Declaraciones anuales son SIEMPRE opcionales - nunca mostrar asterisco */
#declaraciones-anuales-container-f .control-label::after,
#declaraciones-anuales-container-m .control-label::after,
#declaraciones-anuales-container-e .control-label::after,
.declaracion-item .control-label::after,
.declaracion-item .control-label.required::after {
    content: none !important;
}

.light-bg {
    background-color: #ffff;
}

.custom-icon {
    color: #3c493f;
    font-size: 48px;
}

.red-icon {
    color: #9b2247;
    font-size: 48px;
}

.table-text {
    font-size: 11pt;
}

.label-block {
    display: block;
    margin-bottom: 6px;
}

.radios-inline {
    display: flex;
    justify-content: space-around;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.radios-inline .radio-inline {
    display: flex;
    align-items: center;
    margin-right: 0;
}

.radios-inline .radio-inline input[type="radio"] {
    margin-right: 6px;
}

@media (max-width: 768px) {
    .radios-inline {
        justify-content: flex-start;
    }

    .radios-inline .radio-inline {
        margin-right: 12px;
    }
}


.error-msg {
    color: #a94442;
    font-size: 12px;
    margin-top: 4px;
}

.modal {
    z-index: 2000;
}

.modal-backdrop {
    z-index: 1900;
}

/* === Modal estilo GOB === */
.gob-modal .modal-content {
    border: 0;
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
}

.gob-modal .modal-header {
    border: 0;
    background: transparent;
}

.gob-modal .close {
    font-size: 20px;
    opacity: .6;
}

.gob-modal .close:hover {
    opacity: 1;
}

/* Cuerpo y espaciado */
.gob-modal .modal-body {
    text-align: center;
    padding: 15px 0px 30px;
}

.gob-modal .modal-footer {
    border: 0;
    padding: 0 56px 40px;
}

/* Ícono ok en círculo */
.gob-modal .ok-circle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #1E7E34;
    /* verde */
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 34px;
    margin-bottom: 20px;
}

/* Título / texto */
.gob-modal .modal-title-like {
    color: #0b1b2b;
    font-weight: 700;
    font-size: 20px;
    margin-bottom: 22px;
}

/* === Botón institucional SOLO dentro del modal === */
:root {
    --gob-guinda: #9b2247;
    --gob-guinda-hover: #7a1b38;
    --gob-guinda-active: #611232;
    --rn-gobmx: #9b2247;
    --rn-text: #1b2a32;
    --rn-border: #c9ccd1;
    --rn-muted: #6c757d;
}

.gob-modal .btn-institucional {
    background: var(--gob-guinda);
    border-color: var(--gob-guinda);
    color: #fff;
    width: 100%;
    border-radius: 6px;
    padding: 12px 18px;
    font-weight: 600;
}

.gob-modal .btn-institucional:hover {
    background: var(--gob-guinda-hover);
    border-color: var(--gob-guinda-hover);
    color: #fff;
}

.gob-modal .btn-institucional:active,
.gob-modal .btn-institucional:focus {
    background: var(--gob-guinda-active);
    border-color: var(--gob-guinda-active);
    color: #fff;
    box-shadow: 0 0 0 2px rgba(97, 18, 50, .2);
}

.rn-validate-group {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.rn-left-cube {
    width: 48px;
    height: 48px;
    border-radius: 6px;
    background: var(--rn-gobmx);
    color: #fff;
    display: grid;
    place-items: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .15);
}

.rn-help:focus {
    outline: 2px solid rgba(97, 18, 50, .35);
    outline-offset: 2px;
}

.rn-btn-outline {
    min-height: 40px;
    padding: 6px 18px;
    border: 1px solid var(--rn-border);
    background: #fff;
    color: var(--rn-text);
    border-radius: 4px;
    font-weight: 500;
}

.rn-btn-outline:hover,
.rn-btn-outline:focus {
    border-color: var(--rn-gobmx);
    background: var(--rn-gobmx);
    color: #fff;
}

.rn-btn-outline[disabled] {
    opacity: .6;
    cursor: not-allowed;
}

.rn-ope-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.rn-cube-btn {
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 6px;
    background: var(--rn-gobmx);
    color: #fff;
    display: grid;
    place-items: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
}

.rn-cube-btn:hover {
    background: #4f0f29;
}

.rn-cube-btn:disabled {
    opacity: .6;
    cursor: not-allowed;
}

.rn-help {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1px solid var(--rn-border);
    background: #fff;
    color: #6c757d;
    display: grid;
    place-items: center;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.rn-tooltip-white+.tooltip>.tooltip-inner {
    background: #fff;
    color: var(--rn-text);
    border: 1px solid var(--rn-border);
    border-radius: 4px;
    padding: 6px 10px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .08);
}

.rn-tooltip-white+.tooltip .tooltip-arrow {
    display: none;
}

.is-hidden {
    display: none !important;
}

.text-bold {
    font-weight: bold;
}

.btn-continuar {
    background-color: #ffffff;
    border: 2px solid #9b2247;
    color: #9b2247;
    padding: 8px 20px;
    font-weight: 500;
}

.btn-cancelar {
    background-color: #9b2247;
    border: 2px solid #9b2247;
    color: #ffffff;
    padding: 8px 20px;
    font-weight: 500;
}

/* Sobrescribir hover, focus y active */
.btn-continuar:hover,
.btn-continuar:focus,
.btn-continuar:active {
    background-color: #9b2247 !important;
    color: #ffffff !important;
    border-color: #9b2247 !important;
    box-shadow: none !important;
}

.btn-cancelar:hover,
.btn-cancelar:focus,
.btn-cancelar:active {
    background-color: #7a1b38 !important;
    color: #ffffff !important;
    border-color: #7a1b38 !important;
    box-shadow: none !important;
}

.btn-continuar,
.btn-cancelar {
    outline: none !important;
    box-shadow: none !important;
}

.btn-continuar:focus,
.btn-continuar:active,
.btn-cancelar:focus,
.btn-cancelar:active {
    outline: none !important;
    box-shadow: none !important;
}

/* Unificar tooltips a estilo blanco */
.tooltip-inner {
    background-color: #ffffff !important;
    /* fondo blanco */
    color: #000000 !important;
    /* texto negro */
    border: 1px solid #ccc;
    /* borde gris claro */
    font-size: 13px;
    font-weight: 500;
}

/* Flecha del tooltip */
.tooltip.bs-tooltip-top .arrow::before,
.tooltip.bs-tooltip-bottom .arrow::before,
.tooltip.bs-tooltip-left .arrow::before,
.tooltip.bs-tooltip-right .arrow::before {
    border-color: transparent;
}

.tooltip.bs-tooltip-top .arrow::before {
    border-top-color: #ffffff !important;
}

.tooltip.bs-tooltip-bottom .arrow::before {
    border-bottom-color: #ffffff !important;
}

.tooltip.bs-tooltip-left .arrow::before {
    border-left-color: #ffffff !important;
}

.tooltip.bs-tooltip-right .arrow::before {
    border-right-color: #ffffff !important;
}

.min-h-40 {
    min-height: 40px;
    display: block;
}

.label-eq {
    height: 56px;
    display: flex;
    align-items: flex-end;
}

.btn:focus,
.btn:active,
.btn:active:focus,
.btn:focus-visible,
button:focus,
button:active,
button:focus-visible {
    outline: none !important;
    box-shadow: none !important;
}

button::-moz-focus-inner,
.btn::-moz-focus-inner {
    border: 0;
}

/* === Estilos para errores de validación inline === */

/* Quitar margin-bottom extra de los form-control en tabs */
.tab-content form .form-control {
    margin-bottom: 0 !important;
}

/* Mensaje de error inline */
.alert-danger[data-inline="true"] {
    position: relative;
    display: block;
    margin-top: 2px;
    margin-bottom: 4px;
    padding: 0;
    font-size: 12px;
    line-height: 16px;
    height: 16px;
    background-color: transparent !important;
    border: none !important;
    color: #a94442 !important;
}

/* Input con error - fondo rojo claro */
input[aria-invalid="true"],
select[aria-invalid="true"],
textarea[aria-invalid="true"],
.form-control[aria-invalid="true"],
#paus input[aria-invalid="true"],
#paus select[aria-invalid="true"],
#paus .form-control[aria-invalid="true"] {
    background-color: #fff0f0 !important;
    border-color: #a94442 !important;
}

/* Estilos para toggle de contraseña */
.password-wrapper {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    width: 100%;
}

.password-wrapper input.form-control {
    padding-right: 3.2rem;
    flex: 1;
    min-width: 0;
}

.password-wrapper .toggle-password {
    position: absolute;
    top: 20;
    bottom: auto;
    right: 0.8rem;
    border: none;
    background: transparent;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 34px;
    /* altura del input bootstrap */
}

.password-wrapper .toggle-password i {
    font-size: 1.35rem;
    color: #666;
}

.password-wrapper .toggle-password:focus {
    outline: none;
}

.password-wrapper .alert-danger[data-inline="true"] {
    width: 100%;
    flex-basis: 100%;
    margin-top: 4px;
}

.required::after {
    content: " *";
    color: #a94442;
}

/* --- Utilidades Flexbox para soporte Bootstrap moderno en Bootstrap 3 --- */
.d-flex {
    display: flex !important;
}

.flex-wrap {
    flex-wrap: wrap !important;
}

.flex-column {
    flex-direction: column !important;
}

.justify-content-start {
    justify-content: flex-start !important;
}

.justify-content-end {
    justify-content: flex-end !important;
}

.justify-content-center {
    justify-content: center !important;
}

.justify-content-between {
    justify-content: space-between !important;
}

.justify-content-around {
    justify-content: space-around !important;
}

.align-items-start {
    align-items: flex-start !important;
}

.align-items-end {
    align-items: flex-end !important;
}

.align-items-center {
    align-items: center !important;
}

/* Anular floats de Bootstrap 3 dentro de contenedores flex para evitar conflictos */
.d-flex>[class*="col-"] {
    float: none !important;
}

.gap-5 {
    gap: 5px !important;
}

.gap-10 {
    gap: 10px !important;
}

.gap-15 {
    gap: 15px !important;
}

.gap-20 {
    gap: 20px !important;
}

/* Tag de Leyendas */
.leyenda-info {
    margin: 0 20px 20px 20px;
    font-size: 14px;
    background-color: #e3f2fd !important;
    border-color: #bbdefb !important;
    color: #0d47a1 !important;
}

/* === Unificación Total Permiso CRE (Flexbox) === */
.cre-input-group {
    display: flex !important;
    flex-direction: row !important;
    width: 100% !important;
    align-items: stretch !important;
}

.cre-control,
.cre-addon {
    height: 39px !important;
    margin: 0 !important;
    border: 1px solid #ccc !important;
    border-radius: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
}

/* Evitar bordes dobles al pegar elementos */
.cre-input-group>*:not(:first-child) {
    border-left: 0 !important;
}

.cre-input {
    flex: 1 !important;
    /* El input numérico ocupa todo el espacio sobrante */
    padding: 0 10px !important;
    justify-content: flex-start !important;
}

.cre-addon {
    background-color: #eee !important;
    padding: 0 10px !important;
    white-space: nowrap !important;
    color: #555 !important;
    flex-shrink: 0 !important;
    width: 70px !important;
}

.cre-select {
    padding: 0 20px 0 8px !important;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background: #fff url('data:image/svg+xml;charset=utf8,%3Csvg xmlns=\'http://www.w3.org/2000/svg\' viewBox=\'0 0 4 5\'%3E%3Cpath fill=\'%23333\' d=\'M2 0L0 2h4zm0 5L0 3h4z\'/%3E%3C/svg%3E') no-repeat right 8px center !important;
    background-size: 8px 10px !important;
    cursor: pointer !important;
    flex-shrink: 0 !important;
}

.cre-xs {
    width: 90px !important
}

.cre-sm {
    width: 120px !important
}

/* Redondeo solo en los extremos */
.cre-input-group>*:first-child {
    border-radius: 4px 0 0 4px !important;
}

.cre-input-group>*:last-child {
    border-radius: 0 4px 4px 0 !important;
}

/* Estado de Error Unificado */
.cre-has-error .cre-control,
.cre-has-error .cre-addon {
    border-color: #a94442 !important;
    border-width: 2px !important;
    z-index: 2;
    /* Asegura que el borde resalte */
}

/* Reducir el borde de los que no son el primero para evitar duplicidad de grosor */
.cre-has-error .cre-control:not(:first-child),
.cre-has-error .cre-addon:not(:first-child) {
    border-left: 0 !important;
}