/* ====================================================== */
/*          CÓDIGO BASE DE LA PLANTILLA MVC           */
/* ====================================================== */
html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

.footer {
  position: absolute;
  bottom: 0;
  width: 100%;
  white-space: nowrap;
  line-height: 60px;
}

.text-danger {
    color: #dc3545 !important;
}

/* ====================================================== */
/*         ESTILOS DEL FORMULARIO - VERSIÓN ROBUSTA       */
/* ====================================================== */

:root {
    --primary-color: #0056b3;
    --secondary-color: #495057;
    --background-color: #f8fafc;
    --form-background: #ffffff;
    --border-color: #dee2e6;
    --success-color: #28a745;
    --font-family: 'Poppins', sans-serif;
}

body {
    font-family: var(--font-family);
    background-color: var(--background-color);
    margin: 0;
    padding: 20px;
}

/* --- Contenedor Principal del Formulario --- */
.form-container {
    background-color: var(--form-background);
    padding: 45px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    max-width: 480px;
    width: 100%;
    box-sizing: border-box;
    margin: 40px auto;
}

/* --- Cabecera del Formulario (Logo y Títulos) --- */
.form-header {
    text-align: center;
    margin-bottom: 30px;
}

.logo-img {
    max-width: 210px;
    height: auto;
    margin-bottom: 20px;
}

.form-header h2 {
    color: #343a40;
    font-size: 28px;
    font-weight: 600;
    margin: 0 0 10px;
}

.form-header p {
    color: #6c757d;
    font-size: 15px;
    line-height: 1.6;
}

/* --- Grupos de Formulario (Label + Campo) --- */
.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--secondary-color);
    font-size: 14px;
}


/* ============================================================= */
/*          NUEVO CSS A PRUEBA DE BALAS PARA INPUTS E ÍCONOS     */
/* ============================================================= */

/* 1. El wrapper es ahora un contenedor flex */
.input-wrapper {
    display: flex;
    align-items: center;
    position: relative;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--form-background);
    transition: border-color 0.3s, box-shadow 0.3s;
    /* Ajuste para el div de solo lectura */
    overflow: hidden;
}

/* 2. El ícono es un item flex, sin posicionamiento absoluto */
.form-icon {
    color: #adb5bd;
    transition: color 0.3s ease;
    font-size: 16px;
    padding-left: 18px;
    padding-right: 12px;
}

/* 3. El input y select son transparentes y ocupan el espacio restante */
.input-wrapper .form-control {
    width: 100%;
    flex-grow: 1;
    padding: 14px 18px 14px 0;
    border: none;
    border-radius: 0;
    box-shadow: none !important;
    outline: none;
    background-color: transparent;
    font-size: 16px;
    font-family: var(--font-family);
    color: #495057;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Placeholder styles */
.input-wrapper .form-control::placeholder {
    color: #adb5bd;
}

/* 4. El efecto de foco se aplica elegantemente al wrapper */
.input-wrapper:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 86, 179, 0.1);
}

.input-wrapper:focus-within .form-icon {
    color: var(--primary-color);
}

/* 5. Estilos para el campo de solo lectura (el div) */
.input-wrapper .readonly-field {
    /* El padding se aplica aquí para que el texto se alinee igual que en un input */
    padding: 14px 18px 14px 0;
    /* QUITAMOS EL BACKGROUND-COLOR DE AQUÍ */
    background-color: transparent; /* Hacemos transparente el campo en sí */
    cursor: default;
    user-select: none;
    width: 100%;
    min-height: calc(1.5em + 0.75rem + 16px - 28px); /* Ajuste de altura */
    line-height: 1.5;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

/* AÑADIMOS ESTA NUEVA REGLA */
/* Cuando el wrapper contenga un campo readonly, se pinta TODO el wrapper de gris */
.input-wrapper:has(.readonly-field) {
    background-color: #f0f2f5;
}

/* 6. Estilos específicos para el <select> */
.input-wrapper select.form-control {
    background-image: url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%23adb5bd" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"></polyline></svg>');
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1em;
}


/* --- Botón de Envío y Textos Finales --- */
.submit-btn {
    width: 100%;
    padding: 15px;
    background-image: linear-gradient(45deg, #0069d9, #0056b3);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin-top: 10px;
}

.submit-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 7px 20px rgba(0, 105, 217, 0.25);
}

.disclaimer-text {
    font-size: 12px;
    color: #6c757d;
    text-align: center;
    margin-top: 25px;
    margin-bottom: -10px;
    line-height: 1.5;
}

.privacy-text {
    font-size: 13px;
    color: #6c757d;
    text-align: center;
    margin-top: 25px;
}

.privacy-text a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.privacy-text a:hover {
    text-decoration: underline;
}

/* ====================================================== */
/*          ESTILOS PARA LA MODAL DE ÉXITO              */
/* ====================================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.2);
    text-align: center;
    max-width: 450px;
    width: 90%;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-header {
    font-size: 26px;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
}

.modal-body p {
    font-size: 16px;
    color: #555;
    line-height: 1.6;
    margin-bottom: 15px;
}

.modal-body p.highlight {
    background-color: #e9f5ff;
    padding: 10px;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
    text-align: left;
    font-size: 15px;
}

.modal-footer p {
    font-size: 14px;
    color: #777;
    margin-top: 25px;
    margin-bottom: 10px;
}

.progress-bar {
    height: 6px;
    width: 100%;
    background-color: #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
}

.progress {
    height: 100%;
    width: 100%;
    background-color: var(--primary-color);
    border-radius: 3px;
    transform: translateX(-100%);
}

.modal-overlay.active .progress {
    animation: progressBarAnimation 5s linear forwards;
}

@keyframes progressBarAnimation {
    from { transform: translateX(-100%); }
    to { transform: translateX(0%); }
}

/* --- Ajustes Finales para Pantallas Pequeñas --- */
@media (max-width: 520px) {
    .form-container {
        padding: 40px 25px;
        margin: 20px auto;
    }

    .form-header h2 {
        font-size: 24px;
    }
}

/* ====================================================== */
/*          ESTILOS PARA BOTONES EN TABLAS ADMIN          */
/* ====================================================== */

/* Estilo base y común para ambos botones de acciones en tablas */
.btn-table {
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    white-space: nowrap; /* Evita que el texto se parta en dos líneas */
}

    .btn-table:hover {
        transform: translateY(-2px); /* Pequeño efecto al pasar el ratón */
    }

/* Estilo específico para el botón "Validar" (verde) */
.btn-validate {
    background-color: #28a745; /* Verde de éxito */
    color: #ffffff; /* Texto blanco */
}

    .btn-validate:hover {
        background-color: #218838; /* Tono más oscuro al pasar el ratón */
    }

/* Estilo específico para el botón "Quitar Validación" (amarillo) */
.btn-unvalidate {
    background-color: #ffc107; /* Amarillo de advertencia */
    color: #212529; /* Texto oscuro para un alto contraste y legibilidad */
}

    .btn-unvalidate:hover {
        background-color: #e0a800; /* Tono más oscuro al pasar el ratón */
    }


body {
    background-color: #f4f7f6;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 20px auto;
    padding: 0 20px;
}

.header-actions a {
    margin-left: 15px;
}

.table-container {
    max-width: 1400px;
    margin: 40px auto;
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

th {
    background-color: #f8f8f8;
}

.filter-bar {
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}

.status-pill {
    padding: 5px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.status-pendiente {
    background-color: #fff0c2;
    color: #7a5c00;
}

.status-validado {
    background-color: #d4edda;
    color: #155724;
}