/*
 * Diseño premium incluido automáticamente en [wpcf_form] y [wpcf_table]
 * (antes vivía en assets/tablaEjemplo-tablaVista.css y requería agregar
 * class="tablaEjemplo" / class="tablaVista" a mano). No requiere ninguna
 * librería externa.
 */

/* ============ [wpcf_form] ============ */

.wpcf-form-wrapper {
    position: relative;
    max-width: 640px;
    margin: 0 auto 24px;
    padding: 28px 28px 26px;
    background: #ffffff;
    border: 1px solid #e6e5f0;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(20, 30, 60, 0.06), 0 10px 28px rgba(30, 40, 90, 0.08);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    box-sizing: border-box;
    overflow: hidden;
}

.wpcf-form-wrapper::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #3b6ef6 0%, #6f8cf7 45%, #b68d40 100%);
}

.wpcf-form-wrapper .wpcf-field {
    margin-bottom: 18px;
}

.wpcf-form-wrapper .wpcf-field label {
    display: block;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.2px;
    color: #2b3446;
    margin-bottom: 0;
}

.wpcf-form-wrapper .wpcf-field input[type="text"],
.wpcf-form-wrapper .wpcf-field input[type="email"],
.wpcf-form-wrapper .wpcf-field input[type="tel"],
.wpcf-form-wrapper .wpcf-field input[type="number"],
.wpcf-form-wrapper .wpcf-field input[type="date"],
.wpcf-form-wrapper .wpcf-field select,
.wpcf-form-wrapper .wpcf-field textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    font-size: 14px;
    font-family: inherit;
    color: #1f2430;
    background: #f8f9fb;
    border: 1px solid #d5d9e0;
    border-radius: 6px;
    outline: none;
    resize: vertical;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.wpcf-form-wrapper .wpcf-field input[type="text"]::placeholder {
    color: #9aa1ad;
}

.wpcf-form-wrapper .wpcf-field input[type="text"]:hover,
.wpcf-form-wrapper .wpcf-field input[type="email"]:hover,
.wpcf-form-wrapper .wpcf-field input[type="tel"]:hover,
.wpcf-form-wrapper .wpcf-field input[type="number"]:hover,
.wpcf-form-wrapper .wpcf-field input[type="date"]:hover,
.wpcf-form-wrapper .wpcf-field select:hover,
.wpcf-form-wrapper .wpcf-field textarea:hover {
    border-color: #b7bec9;
}

.wpcf-form-wrapper .wpcf-field input[type="text"]:focus,
.wpcf-form-wrapper .wpcf-field input[type="email"]:focus,
.wpcf-form-wrapper .wpcf-field input[type="tel"]:focus,
.wpcf-form-wrapper .wpcf-field input[type="number"]:focus,
.wpcf-form-wrapper .wpcf-field input[type="date"]:focus,
.wpcf-form-wrapper .wpcf-field select:focus,
.wpcf-form-wrapper .wpcf-field textarea:focus {
    background: #ffffff;
    border-color: #3b6ef6;
    box-shadow: 0 0 0 3px rgba(59, 110, 246, 0.15);
}

.wpcf-form-wrapper .wpcf-field input[type="checkbox"] {
    width: auto;
    padding: 0;
    box-sizing: content-box;
    vertical-align: middle;
    margin-right: 6px;
}

.wpcf-form-wrapper .wpcf-field input[readonly] {
    background: #eef0f3;
    color: #6b7280;
    cursor: not-allowed;
}

.wpcf-form-wrapper .wpcf-field input.wpcf-invalid,
.wpcf-form-wrapper .wpcf-field select.wpcf-invalid,
.wpcf-form-wrapper .wpcf-field textarea.wpcf-invalid {
    border-color: #d64545;
    background: #fdf2f2;
}

.wpcf-field-oculto {
    display: none !important;
}

/* "Adquirió el seguro *" se destaca con una tarjeta propia (fondo e
   ícono), no solo con letra más grande, para diferenciarlo claramente
   de las demás etiquetas del formulario. */
.wpcf-form-wrapper .wpcf-field:has(.wpcf-radio-group) {
    background: linear-gradient(135deg, rgba(59, 110, 246, 0.07) 0%, rgba(182, 141, 64, 0.07) 100%);
    border: 1px solid rgba(59, 110, 246, 0.18);
    border-radius: 12px;
    padding: 16px 18px;
}

.wpcf-field-label {
    display: block;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.2px;
    color: #1e3a8a;
    margin-bottom: 10px;
    text-align: center;
}

.wpcf-field-label::before {
    content: "🛡";
    margin-right: 6px;
}

.wpcf-radio-group {
    display: flex;
    justify-content: center;
    gap: 18px;
    flex-wrap: wrap;
    padding: 4px 0;
}

.wpcf-radio-group.wpcf-invalid {
    outline: 1px solid #d64545;
    border-radius: 6px;
    padding: 4px 8px;
    background: #fdf2f2;
}

.wpcf-radio-option {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #ffffff;
    border: 1px solid #d5d9e0;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 600;
    color: #1f2430;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.wpcf-radio-option:hover {
    border-color: #3b6ef6;
}

.wpcf-radio-option:has(input:checked) {
    border-color: #3b6ef6;
    background: #eef3ff;
    box-shadow: 0 0 0 3px rgba(59, 110, 246, 0.12);
}

.wpcf-radio-option input[type="radio"] {
    width: auto;
    margin: 0;
    accent-color: #3b6ef6;
}

/* "Fecha de Compra" vive dentro de .wpcf-radio-group (junto a las
   opciones SI/NO): al ser otro hijo flex del grupo, queda centrado
   igual que ellas. */
.wpcf-radio-fecha {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #ffffff;
    border: 1px solid #d5d9e0;
    border-radius: 999px;
}

.wpcf-radio-fecha-label {
    font-size: 13px;
    font-weight: 700;
    color: #6b7280;
    letter-spacing: 0.2px;
    white-space: nowrap;
    margin-bottom: 0px;
}

.wpcf-form-wrapper .wpcf-radio-fecha input[type="date"] {
    width: auto;
    border: none;
    background: transparent;
    padding: 0;
    font-size: 14px;
    font-weight: 600;
}

.wpcf-form-wrapper .wpcf-radio-fecha input[readonly] {
    background: transparent;
    color: #3d00ff;
}

.wpcf-privacy-field {
    font-size: 13px;
    line-height: 1.5;
}

.wpcf-form-wrapper .wpcf-privacy-field label {
    font-weight: 400;
}

/* Encierra el checkbox de política y los botones finales (Vista previa /
   Cancelar) en una franja aparte, separada del resto de campos. */
.wpcf-form-footer {
    margin-top: 6px;
    padding-top: 18px;
    border-top: 1px solid #ececf3;
    text-align: center;
}

.wpcf-form-footer .wpcf-privacy-field {
    margin-bottom: 16px;
}

/* Botones dentro del formulario (Vista previa / Corregir / Enviar) y los
   de "Editar" / "Cancelar" en [wpcf_table], que viven fuera del form. */
.wpcf-form-wrapper button,
.wpcf-form-wrapper .wpcf-submit,
.wpcf-back-button {
    display: inline-block;
    padding: 11px 22px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
}

.wpcf-form-wrapper .wpcf-submit {
    background: #3b6ef6;
    color: #ffffff;
}

.wpcf-form-wrapper .wpcf-submit:hover {
    background: #2f5bd6;
}

.wpcf-form-wrapper .wpcf-submit:active {
    transform: translateY(1px);
}

.wpcf-form-wrapper .wpcf-submit[disabled] {
    background: #b9c2d0;
    cursor: not-allowed;
}

.wpcf-back-button {
    background: #ffffff;
    color: #3b4354;
    border-color: #d5d9e0;
}

.wpcf-back-button:hover {
    background: #f2f3f5;
    border-color: #b7bec9;
}

.wpcf-form-wrapper .wpcf-preview-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 16px;
}

.wpcf-preview-title {
    margin-top: 0;
}

/* "Nuevo Registro" / "Editar Registro": se destaca igual que "Adquirió
   el seguro *" (mismo tamaño/peso, centrado), con un pequeño acento en
   degradado debajo a juego con la franja de arriba de la tarjeta. */
.wpcf-form-title {
    margin-top: 0;
    margin-bottom: 22px;
    padding-bottom: 14px;
    font-size: 30px;
    font-weight: 700;
    letter-spacing: 0.2px;
    color: #1e2126;
    text-align: center;
    position: relative;
}

/* Fecha de hoy debajo de "Nuevo Registro": solo texto, sin label ni
   estilo de campo, discreto (gris claro) como aclaración secundaria
   del título. Solo se muestra en "Nuevo Registro" (no al editar). */
.wpcf-fecha-registro-subtitulo {
    margin: -8px 0 22px;
    font-size: 14px;
    color: #8b93a1;
    text-align: center;
}

.wpcf-form-title::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 56px;
    height: 3px;
    border-radius: 3px;
    background: linear-gradient(90deg, #3b6ef6 0%, #b68d40 100%);
}

.wpcf-preview-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 16px;
    font-size: 18px;
    border: 1px solid #e2e5ea;
    border-radius: 6px;
}

.wpcf-preview-table th,
.wpcf-preview-table td {
    border-bottom: 1px solid #e6e8ec;
    padding: 9px 14px;
    text-align: left;
    line-height: 1.4;
}

.wpcf-preview-table tr:last-child th,
.wpcf-preview-table tr:last-child td {
    border-bottom: none;
}

.wpcf-preview-table th {
    width: 40%;
    background: #f4f6f9;
    color: #2b3446;
    font-weight: 600;
}

.wpcf-preview-table tr:nth-child(even) td {
    background: #fafbfc;
}

.wpcf-field-error {
    display: block;
    color: #b32d2e;
    font-size: 12px;
    margin-top: 4px;
}

.wpcf-message .wpcf-success {
    color: #2a7a2a;
    text-align: center;
}

.wpcf-message .wpcf-error {
    color: #b32d2e;
}

.wpcf-captcha-warning {
    background: #fff3cd;
    border: 1px solid #e0c46c;
    padding: 8px 12px;
    font-size: 13px;
}

.wpcf-warning {
    background: #fff3cd;
    border: 1px solid #e0c46c;
    padding: 8px 12px;
    font-size: 13px;
    border-radius: 3px;
}

/* ============ Candado de colaborador (nombre + PIN) ============ */

.wpcf-colab-logout-wrap {
    text-align: center;
    margin: 24px 0 0;
}

.wpcf-colab-logout-nombre {
    margin: 0 0 8px;
    font-size: 15px;
    font-weight: 600;
    color: #4b5563;
}

.wpcf-colab-logout {
    display: inline-block;
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
    background: #f8f9fb;
    border: 1px solid #d5d9e0;
    border-radius: 6px;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.wpcf-colab-logout:hover {
    background: #eef1f5;
    color: #1f2430;
    border-color: #b7bec9;
}

.wpcf-colab-gate {
    position: relative;
    max-width: 420px;
    margin: 0 auto;
    padding: 28px 28px 26px;
    background: #ffffff;
    border: 1px solid #e6e5f0;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(20, 30, 60, 0.06), 0 10px 28px rgba(30, 40, 90, 0.08);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    box-sizing: border-box;
    overflow: hidden;
}

.wpcf-colab-gate::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #3b6ef6 0%, #6f8cf7 45%, #b68d40 100%);
}

.wpcf-colab-gate .wpcf-error {
    color: #b32d2e;
    background: #fdecec;
    border: 1px solid #f2b8b8;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 18px;
    margin: 0 0 16px;
}

.wpcf-colab-gate .wpcf-warning {
    border-radius: 8px;
    font-size: 18px;
    margin: 0 0 16px;
}

.wpcf-colab-form label {
    display: block;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: #6b7280;
    margin-bottom: 16px;
}

.wpcf-colab-form select,
.wpcf-colab-form input[type="text"] {
    width: 100%;
    box-sizing: border-box;
    margin-top: 8px;
    padding: 12px 14px;
    font-size: 18px;
    color: #1f2430;
    background: #f8f9fb;
    border: 1px solid #d5d9e0;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.wpcf-colab-form select:hover,
.wpcf-colab-form input[type="text"]:hover {
    border-color: #b7bec9;
}

.wpcf-colab-form select:focus,
.wpcf-colab-form input[type="text"]:focus {
    background-color: #ffffff;
    border-color: #3b6ef6;
    box-shadow: 0 0 0 3px rgba(59, 110, 246, 0.15);
}

.wpcf-colab-form button {
    width: 100%;
    padding: 12px 24px;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 0.2px;
    color: #ffffff;
    background: linear-gradient(135deg, #3b6ef6 0%, #2f5bd6 100%);
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(59, 110, 246, 0.25);
    transition: box-shadow 0.15s ease, transform 0.05s ease;
}

.wpcf-colab-form button:hover {
    box-shadow: 0 6px 14px rgba(59, 110, 246, 0.32);
}

.wpcf-colab-form button:active {
    transform: translateY(1px);
}

/* ============ [wpcf_form]: responsive (mobile / desktop) ============ */

/* Mobile: una sola columna, un poco más compacto (comportamiento base,
   se deja explícito para que no dependa "por defecto" de que no haya
   reglas de escritorio aplicándose). */
@media (max-width: 767px) {
    .wpcf-form-wrapper {
        padding: 20px 18px;
        border-radius: 12px;
    }

    .wpcf-radio-group {
        gap: 14px;
    }
}

/* Desktop: el formulario (no la previsualización) pasa a 2 columnas y
   se ensancha hasta 850px. Los campos que no tiene sentido partir a la
   mitad (radio "Adquirió el seguro", el checkbox de política, y la fila
   de acciones "Vista previa"/"Cancelar") ocupan las 2 columnas. */
@media (min-width: 768px) {
    .wpcf-form-wrapper {
        max-width: 850px;
    }

    .wpcf-form-wrapper form.wpcf-form:not(.wpcf-preview-form) {
        display: grid;
        grid-template-columns: 1fr 1fr;
        column-gap: 24px;
        align-items: start;
    }

    .wpcf-form-wrapper form.wpcf-form:not(.wpcf-preview-form) .wpcf-field:has(.wpcf-radio-group),
    .wpcf-form-wrapper form.wpcf-form:not(.wpcf-preview-form) .wpcf-field:has(textarea),
    .wpcf-form-wrapper form.wpcf-form:not(.wpcf-preview-form) .wpcf-form-footer {
        grid-column: 1 / -1;
    }
}

/* ============ [wpcf_table] ============ */

.wpcf-table-wrapper {
    position: relative;
    max-width: 640px;
    margin: 0 auto 24px;
    padding: 28px 28px 26px;
    background: #ffffff;
    border: 1px solid #e6e5f0;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(20, 30, 60, 0.06), 0 10px 28px rgba(30, 40, 90, 0.08);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    box-sizing: border-box;
    overflow: hidden;
}

.wpcf-table-wrapper::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #3b6ef6 0%, #6f8cf7 45%, #b68d40 100%);
}

.wpcf-table-wrapper .wpcf-table-filter {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 22px;
}

.wpcf-table-wrapper .wpcf-table-filter label {
    flex: 1 1 220px;
    display: block;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: #6b7280;
    margin-bottom: 0;
}

.wpcf-table-wrapper .wpcf-table-filter input[type="text"],
.wpcf-table-wrapper .wpcf-table-filter input[type="number"] {
    width: 100%;
    box-sizing: border-box;
    margin-top: 8px;
    padding: 12px 14px 12px 38px;
    font-size: 18px;
    color: #1f2430;
    background: #f8f9fb url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%236b7280' stroke-width='2' viewBox='0 0 24 24'><circle cx='11' cy='11' r='7'/><line x1='21' y1='21' x2='16.65' y2='16.65'/></svg>") no-repeat 13px center;
    background-size: 15px;
    border: 1px solid #d5d9e0;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.wpcf-table-wrapper .wpcf-table-filter input[type="text"]:hover,
.wpcf-table-wrapper .wpcf-table-filter input[type="number"]:hover {
    border-color: #b7bec9;
}

.wpcf-table-wrapper .wpcf-table-filter input[type="text"]:focus,
.wpcf-table-wrapper .wpcf-table-filter input[type="number"]:focus {
    background-color: #ffffff;
    border-color: #3b6ef6;
    box-shadow: 0 0 0 3px rgba(59, 110, 246, 0.15);
}

.wpcf-table-wrapper .wpcf-table-filter button {
    padding: 12px 24px;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 0.2px;
    color: #ffffff;
    background: linear-gradient(135deg, #3b6ef6 0%, #2f5bd6 100%);
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(59, 110, 246, 0.25);
    transition: box-shadow 0.15s ease, transform 0.05s ease;
}

.wpcf-table-wrapper .wpcf-table-filter button:hover {
    box-shadow: 0 6px 14px rgba(59, 110, 246, 0.32);
}

.wpcf-table-wrapper .wpcf-table-filter button:active {
    transform: translateY(1px);
}

.wpcf-table-wrapper .wpcf-table-filter .wpcf-back-button {
    padding: 12px 22px;
}

.wpcf-table-wrapper table.wpcf-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 16px;
    border: 1px solid #ececf3;
    border-radius: 10px;
    overflow: hidden;
}

.wpcf-table-wrapper table.wpcf-table th,
.wpcf-table-wrapper table.wpcf-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #ececf3;
    line-height: 1.4;
}

.wpcf-table-wrapper table.wpcf-table tr:last-child th,
.wpcf-table-wrapper table.wpcf-table tr:last-child td {
    border-bottom: none;
}

.wpcf-table-wrapper table.wpcf-table th {
    width: 42%;
    background: #f6f7fb;
    color: #6b7280;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

.wpcf-table-wrapper table.wpcf-table td {
    color: #1e2126;
    font-weight: 600;
}

.wpcf-table-wrapper table.wpcf-table tr:nth-child(even) td,
.wpcf-table-wrapper table.wpcf-table tr:nth-child(even) th {
    background: #fbfbfd;
}

.wpcf-table-wrapper .wpcf-warning {
    background: #fff6e0;
    border: 1px solid #e5c66b;
    color: #6b5518;
    border-radius: 8px;
    font-size: 16px;
}

.wpcf-resultado-acciones {
    margin: 18px 0 0;
    text-align: right;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.wpcf-resultado-acciones .wpcf-back-button {
    text-decoration: none;
    display: inline-block;
}

.wpcf-resultado-acciones .wpcf-editar-button {
    background: linear-gradient(135deg, #3b6ef6 0%, #2f5bd6 100%);
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 4px 10px rgba(59, 110, 246, 0.25);
}

.wpcf-resultado-acciones .wpcf-editar-button:hover {
    box-shadow: 0 6px 14px rgba(59, 110, 246, 0.32);
}
