:root {
    --guinda: #6A1B2D;
    --guinda-hover: #541423;
    --dorado: #C9A65B;
}

/* CARD */
.card {
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .05);
}

/* HEADER */
.card-header {
    background: var(--guinda);
    border-bottom: 3px solid var(--dorado);
    font-weight: 600;
}

/* TITULOS */
.section-title {
    color: var(--guinda);
    border-bottom: 2px solid var(--dorado);
    padding-bottom: 4px;
    font-weight: 600;
}

.form-group-flotante {
    position: relative;
    margin: 10px 0;
}

/* INPUT */
.form-group-flotante input {
    width: 100%;
    padding: 10px 12px;
    font-size: 16px;
    border-radius: 6px;
    border: 2px solid #acacac;
    background-color: transparent;
    transition: all 0.25s ease;
}

/* Quitar estilos default de Bootstrap */
.form-control:focus {
    box-shadow: none;
}

/* Oculta placeholder */
.form-group-flotante input::placeholder {
    color: transparent;
}

/* LABEL */
.form-group-flotante label {
    position: absolute;
    top: 50%;
    left: 20px;
    transform: translateY(-50%);
    color: #888;
    font-size: 16px;
    pointer-events: none;
    transition: all 0.2s ease;
    background: transparent;
    padding: 0 4px;
}

/* EFECTO FLOTANTE */
.form-group-flotante input:focus+label,
.form-group-flotante input:not(:placeholder-shown)+label {
    top: -12px;
    transform: none;
    font-size: 12px;
    color: #541423;
    font-weight: 600;
    background: #fff;
}

/* INPUT EN FOCUS */
.form-group-flotante input:focus {
    border-color: #541423;
    box-shadow: 0 0 0 3px rgba(84, 20, 35, 0.15);
}

/* HOVER (detalle) */
.form-group-flotante input:hover {
    border-color: #541423;
}

.form-group-flotante input:disabled,
.form-group-flotante input[readonly] {
    color: #666;
    border-style: dashed;
    cursor: not-allowed;
}

/* ERROR (opcional, útil para validaciones) */
.form-group-flotante input.error {
    border-color: #dc3545;
}

.form-group-flotante input.error+label {
    color: #dc3545;
}

/* ÉXITO (opcional) */
.form-group-flotante input.success {
    border-color: #198754;
}

.form-group-flotante input.success+label {
    color: #198754;
}

.form-group-flotante select {
    width: 100%;
    padding: 10px 12px;
    font-size: 16px;
    border-radius: 6px;
    border: 2px solid #acacac;
    background-color: transparent;
    transition: all 0.25s ease;
    appearance: none;
}

/* FOCUS */
.form-group-flotante select:focus {
    border-color: #541423;
    box-shadow: 0 0 0 3px rgba(84, 20, 35, 0.15);
}

/* HOVER */
.form-group-flotante select:hover {
    border-color: #541423;
}

/* LABEL flotante cuando tiene valor */
.form-group-flotante select:focus+label,
.form-group-flotante select:valid+label {
    top: -12px;
    transform: none;
    font-size: 12px;
    color: #541423;
    font-weight: 600;
    background: #fff;
}

/* Contenedor */
.form-group-flotante .select2-container {
    width: 100% !important;
    display: block;
}

/* Caja principal */
.form-group-flotante .select2-selection--single {
    height: 40px !important;
    width: 100% !important;
    box-sizing: border-box;
    padding: 10px 12px !important;
    border-radius: 6px !important;
    border: 2px solid #acacac !important;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    background-color: transparent !important;
}

/* Texto */
.form-group-flotante .select2-selection__rendered {
    padding-left: 0 !important;
    color: #000;
}

/* Flecha */
.form-group-flotante .select2-selection__arrow {
    height: 100% !important;
    top: 0 !important;
}

/* Hover */
.form-group-flotante .select2-selection--single:hover {
    border-color: #541423 !important;
}

/* Focus */
.select2-container--open .select2-selection--single {
    border-color: #541423 !important;
    box-shadow: 0 0 0 3px rgba(84, 20, 35, 0.15);
}

/* Label flotante cuando hay valor */
.form-group-flotante.select-filled label {
    top: -12px;
    transform: none;
    font-size: 12px;
    color: #541423;
    font-weight: 600;
    background: #fff;
}

/* Mantiene mismo look */
.form-group-flotante input[type="date"] {
    appearance: none;
}

/* Label flotante para date */
.form-group-flotante input[type="date"]:focus+label,
.form-group-flotante input[type="date"]:valid+label {
    top: -12px;
    transform: none;
    font-size: 12px;
    color: #541423;
    font-weight: 600;
    background: #fff;
}

/* Compatibilidad cuando ya tiene valor*/
.form-group-flotante input[type="date"].has-value+label {
    top: -12px;
    transform: none;
    font-size: 12px;
    color: #541423;
    font-weight: 600;
    background: #fff;
}

/* INPUTS */
.form-control {
    border-radius: 6px;
}

.form-control:focus {
    border-color: var(--guinda);
    box-shadow: 0 0 0 2px rgba(106, 27, 45, .15);
}

.btn-primary {
    background: var(--guinda) !important;
    border: none !important;
    color: #fff !important;
    font-weight: 600;
    transition: all .2s ease;
}

/* HOVER */
.btn-primary:hover {
    background: var(--guinda-hover) !important;
    color: #fff !important;
}

/* FOCUS (cuando haces click) */
.btn-primary:focus,
.btn-primary:active {
    background: var(--guinda-hover) !important;
    color: #fff !important;
    box-shadow: 0 0 0 2px rgba(106, 27, 45, .25) !important;
}

/* BOTONES  */
/* BOTON PRINCIPAL */
.btn-guardar {
    background: linear-gradient(135deg, #9FAA11, #8c9609);
    color: #fff;
    border: none;
    padding: 10px 22px;
    border-radius: 8px;
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(0, 0, 0, .15);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-guardar:hover {
    background: linear-gradient(135deg, #b7c61a, #9faa11);
    box-shadow: 0 6px 14px rgba(0, 0, 0, .25);
    transform: translateY(-1px) scale(1.02);
}

.btn-guardar:active {
    transform: scale(0.97);
    box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
}

.btn-guardar:disabled,
.btn-guardar.disabled {
    background: linear-gradient(135deg, #c9c9c9, #b5b5b5);
    color: #6c757d;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
    opacity: 0.7;
    filter: grayscale(40%);
}

.btn-guardar:disabled:hover,
.btn-guardar.disabled:hover {
    background: linear-gradient(135deg, #c9c9c9, #b5b5b5);
    box-shadow: none;
    transform: none;
}

.btn-accion {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 22px;
    font-size: 14px;
    border-radius: 6px;
    border: 1px solid transparent;
    background-color: transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.btn-accion:hover {
    transform: translateY(-1px);
}

.btn-enviar-custom {
    color: #2b8a3e;
    border-color: #2b8a3e;
}

.btn-enviar-custom:hover {
    background-color: #2b8a3e;
    color: #fff;
}

.btn-editar-custom {
    color: #a57f2c;
    border-color: #a57f2c;
}

.btn-editar-custom:hover {
    background-color: #a57f2c;
    color: #fff;
}

.btn-eliminar-custom {
    color: #dc3545;
    border-color: #dc3545;
    text-decoration: none;
}

.btn-eliminar-custom:hover {
    background-color: #dc3545;
    color: #fff;
    text-decoration: none;
}

.btn-primary-custom {
    color: #611232;
    border-color: #611232;
}

.btn-primary-custom:hover {
    background-color: #611232;
    color: #fff;
}

.btn-secondary-custom {
    color: #3b5bdb;
    border-color: #3b5bdb;
}

.btn-secondary-custom:hover {
    background-color: #3b5bdb;
    color: #fff;
}

.btn-light-custom {
    color: #2c5282;
    border-color: #2c5282;
}

.btn-light-custom:hover {
    background-color: #2c5282;
    color: #fff;
}

/* ESTATUS BASE */
.estatusDocxs {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}

/* PENDIENTE (ya lo tienes, lo mejoramos leve) */
.estatusDocxs.pendiente {
    background: rgba(201, 166, 91, .15);
    color: #8a6d1f;
    border: 1px solid rgba(201, 166, 91, .4);
}

/* CORRECTO */
.estatusDocxs.correcto {
    background: rgba(46, 125, 50, .15);
    color: #2e7d32;
    border: 1px solid rgba(46, 125, 50, .4);
}

/* ERROR */
.estatusDocxs.error {
    background: rgba(198, 40, 40, .15);
    color: #c62828;
    border: 1px solid rgba(198, 40, 40, .4);
}

/* OPCIONAL: revisión */
.estatusDocxs.revision {
    background: rgba(2, 136, 209, .15);
    color: #0277bd;
    border: 1px solid rgba(2, 136, 209, .4);
}

/* FILE */
input[type="file"] {
    border: 1px dashed #ccc;
    background: #fafafa;
}

/* ALERTA */
.alerta-ok {
    display: flex;
    gap: 10px;
    padding: 15px;
    background: #e8f5e9;
    border-left: 5px solid #2e7d32;
    border-radius: 8px;
    align-items: center;
}

.alerta-ok i {
    font-size: 24px;
    color: #2e7d32;
}

.input-doc:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
    opacity: 0.7;
}

.section-title {
    scroll-margin-top: 90px;
}

.highlight-error {
    animation: shake 0.4s ease;
    background: rgba(255, 0, 0, 0.05);
    border-radius: 5px;
    padding: 5px;
}

@keyframes shake {
    0% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-4px);
    }

    50% {
        transform: translateX(4px);
    }

    75% {
        transform: translateX(-4px);
    }

    100% {
        transform: translateX(0);
    }
}

/* VALIDACIÓN VISUAL */
/* Estado válido */
.is-valid {
    border: 2px solid #28a745 !important;
    background-image: url("data:image/svg+xml,%3Csvg fill='%2328a745' viewBox='0 0 16 16'%3E%3Cpath d='M13.485 1.929l-7.778 7.778-3.192-3.192L0 9.03l5.707 5.707L16 4.444z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
}

/* CAMPOS INVÁLIDOS */
.is-invalid {
    border: 2px solid #dc3545 !important;
    animation: errorPulse .8s ease-in-out 3;
}

.select2-container--default .select2-selection.is-invalid {
    border: 2px solid #dc3545 !important;
    animation: errorPulse .8s ease-in-out 3;
}

.select2-container--default .select2-selection.is-valid {
    border: 2px solid #28a745 !important;
}


/* Mensaje */
.invalid-feedback {
    display: block;
    color: #dc3545;
    font-size: 12px;
    font-weight: 600;
    margin-top: 4px;
    animation: fadeUp .35s ease;
}

/* ==========================================================
   CAMPOS REQUERIDOS Y OPCIONALES
========================================================== */

/* Label requerido */
label.campo-requerido,
label.campo-requerido star {
    color: #dc3545 !important;
    font-weight: 700;
}

/* Label opcional */
label.campo-opcional {
    color: #0d6efd !important;
    font-weight: 600;
}

/* Texto OPCIONAL */
.badge-opcional {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 8px;
    border-radius: 30px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .4px;
    text-transform: uppercase;
    color: #0d6efd;
    background: rgba(13, 110, 253, .08);
    border: 1px solid rgba(13, 110, 253, .25);
}

/* Checkbox requerido */
input[type="checkbox"][required] {
    accent-color: #dc3545;
}

/* Radio requerido */
input[type="radio"][required] {
    accent-color: #dc3545;
}

/* Checkbox opcional */
input[type="checkbox"]:not([required]) {
    accent-color: #0d6efd;
}

/* Radio opcional */
input[type="radio"]:not([required]) {
    accent-color: #0d6efd;
}

/* Select2 requerido */
.select2-requerido+.select2 .select2-selection {
    border-left: 4px solid #dc3545 !important;
}

/* Select2 opcional */
.select2-opcional+.select2 .select2-selection {
    border-left: 4px solid #0d6efd !important;
}

/* ANIMACIONES */
@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    20% {
        transform: translateX(-5px);
    }

    40% {
        transform: translateX(5px);
    }

    60% {
        transform: translateX(-4px);
    }

    80% {
        transform: translateX(4px);
    }
}

@keyframes errorPulse {

    0% {
        box-shadow: 0 0 0 rgba(220, 53, 69, 0);
    }

    25% {
        box-shadow: 0 0 10px rgba(220, 53, 69, .9);
    }

    50% {
        box-shadow: 0 0 0 rgba(220, 53, 69, 0);
    }

    75% {
        box-shadow: 0 0 10px rgba(220, 53, 69, .9);
    }

    100% {
        box-shadow: 0 0 0 rgba(220, 53, 69, 0);
    }
}

@keyframes fadeUp {

    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.focus-blink {
    animation: focusBlink .45s ease-in-out 5;
}

@keyframes focusBlink {

    0%,
    100% {
        border-color: #dc3545;
        box-shadow: 0 0 0 .15rem rgba(220, 53, 69, .15);
    }

    50% {
        border-color: #ffc107;
        box-shadow: 0 0 0 .35rem rgba(255, 193, 7, .45);
    }
}

/* Para Select2 */
.select2-selection.focus-blink {
    animation: focusBlink .45s ease-in-out 5;
}

/* Sacudida */
.error-shake {
    animation: shake .45s;
}

.btn-formato {
    border-radius: 10px;
    padding: 8px 14px;
    transition: all 0.3s ease;
}

.btn-formato:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.btn-formato.descargando {
    opacity: 0.8;
    pointer-events: none;
}

.msg-accion {
	margin-top: 6px;
	color: #3b5bdb;
	font-weight: 600;
}

.msg-accion {
    color: #3b5bdb;
}