:root {
  --primary: #8B0000;       /* rojo oscuro condimento */
  --primary-dark: #5c0000;  /* rojo más intenso */
  --secondary: #002244;     /* azul oscuro corporativo */
  --accent: #d2b48c;        /* café claro tipo especia */
  --bg: #ffffff;            /* blanco puro */
  --text: #333;
  --muted: #666;
  --border: #ddd;
  --danger: #d93025;
}

*{ box-sizing:border-box; }

body{
  font-family:'Roboto',sans-serif;
  background:var(--bg);
  margin:0;
  color:var(--text);
}

.container{
  max-width:1100px;
  margin:40px auto;
  background:#fff;
  padding:30px;
  border-radius:12px;
  box-shadow:0 8px 24px rgba(0,0,0,.08);
}

h1{
  margin:0 0 24px 0;
  text-align:center;
  color: var(--primary);
}

label{
  display:flex ;
  flex-direction:column;
  gap:6px;
  margin-bottom: 12px;
  font-size:.92rem;
  color:#222;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
input[type="number"],
input[type="file"],
select{
  width:100%;
  padding:10px 12px;
  border:1px solid #ccc;
  margin-bottom: 12px;
  border-radius:8px;
  font-size:.92rem;
  background:#fff;
  display: flex;
}

input:focus, select:focus{
  outline:none;
  border-color:var(--primary);
  box-shadow:0 0 0 3px rgba(139,0,0,.12); /* sombra roja */
}

fieldset{
  border:1px solid var(--accent);
  border-radius:12px;
  padding:18px;
  margin:18px 0;
}

legend{
  padding:0 6px;
  color:var(--primary);
  font-weight:700;
}

.grid-1{ display:grid; grid-template-columns:1fr; gap:14px; }
.grid-2{ display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.grid-3{ display:grid; grid-template-columns:1fr 1fr 1fr; gap:14px; }
.grid-4{ display:grid; grid-template-columns:repeat(4,1fr); gap:14px; }

@media (max-width:900px){
  .grid-4{ grid-template-columns:1fr 1fr; }
}
@media (max-width:700px){
  .grid-3{ grid-template-columns:1fr; }
  .grid-2{ grid-template-columns:1fr; }
}

.switch-row{
  display:flex; align-items:center; gap:16px; flex-wrap:wrap;
}
.switch-row .inline{ display:inline-flex; align-items:center; gap:6px; }

.help{
  color:var(--muted); font-size:.9rem; margin:8px 0 0;
}

.control-row{ display:flex; gap:16px; margin-bottom:16px; }
.control-col{ flex:1; }

.actions{
  display:flex; justify-content:flex-end; gap:10px; margin-top:10px;
}

.btn-primary,
.btn-secondary{
  padding:10px 16px;
  border-radius:10px;
  border:none;
  cursor:pointer;
  font-weight:600;
}

/* Botón principal en rojo corporativo */
.btn-primary{ background:var(--primary); color:#fff; }
.btn-primary:hover{ background:var(--primary-dark); }

/* Botón secundario en azul oscuro */
.btn-secondary{ background:var(--secondary); color:#fff; }
.btn-secondary:hover{ background:#00162e; }

.hidden{ display:none !important; }

.thankyou{ text-align:center; padding:30px 10px; }

.declaracion{
  background:#fafafa;
  border:1px solid var(--border);
  border-radius:10px;
  padding:12px;
  font-size:.90rem;
  line-height:1.5;
}

/* Repetidores */
.repeat-rows{ display:flex; flex-direction:column; gap:12px; }
.repeat-row{ position:relative; padding-bottom:0; }
.repeat-row .remove-row{
  position:absolute; right:0; top:-10px;
  background:#ffe8e6; color:#7a1111; border:none; border-radius:8px;
  padding:6px 10px; cursor:pointer; font-weight:600;
}
input.invalid, select.invalid{
  border-color:var(--danger) !important;
  box-shadow:0 0 0 3px rgba(217,48,37,.12) !important;
}

/*cards */
.card-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.card {
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 8px 6px;
  cursor: pointer;
  flex: 0 0 auto;
  text-align: center;
  font-size: 0.85rem;
  line-height: 1.2;
  transition: 0.2s;
}

.card input { display: none; }

.card-body {
  padding: 1px 1px;
  margin: 0;
}

.card input:checked + .card-body,
.card:has(input:checked) {
  border-color: var(--primary);
  background: rgba(139,0,0,.08);
}

/* tipos de transacciones */
.grid-options {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.card {
  flex: 1 1 120px;
  border: 2px solid #ccc;
  border-radius: 8px;
  cursor: pointer;
  transition: 0.2s;
  text-align: center;
}

.card input { display: none; }

.card-body {
  padding: 5px;
  font-size: 0.95rem;
}

.card input:checked + .card-body {
  background: var(--secondary);
  color: #fff;
  border-color: var(--secondary);
}

/* actividad economica y pais */
.sugerencias {
  list-style: none;
  padding: 4px;
  margin: 4px 0;
  border: 0.5px solid var(--border);
  max-height: 80%;
  overflow-y: auto;
  background: white;
  font-size: 0.9rem;
}

.sugerencias li {
  padding: 6px;
  cursor: pointer;
}

.sugerencias li:hover {
  background: var(--primary);
  color: white;
}

/*Logo weeee */

.header-logo img {
  max-height: 150px;   /* más grande */
  width: 150px;        /* ancho fijo */
  border-radius: 60%;  /* redondo */
  object-fit: cover;   /* recorta si sobra */
  display: block;
  margin: 0 auto 40px; /* centrado y con espacio abajo */
  border: 1px solid var(--primary); /* opcional: borde con color corporativo */
  box-shadow: 0 4px 10px rgba(0,0,0,0.10);
}



.form-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.form-list li {
  margin: 8px 0;
}

.form-list button {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  font-size: 1rem;
  padding: 8px;
  cursor: pointer;
  color: var(--primary);
  border-radius: 6px;
  transition: 0.2s;
}

.form-list button:hover {
  background: var(--accent);
  color: #fff;
}


.bloque-natural {
  display: none;
}

/*colores de borde de fondo dependiendo de si esta lleno o no */
input:valid { border-left: 4px solid #007bff; }
input:invalid { border-left: 4px solid #dc3545; }

/* modificable solo para las indicaciones Bloque de indicaciones del formulario */
.bloque-indicaciones {
  background-color: #f8f9fa;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 16px;
  margin: 16px 0 20px;
  color: #333;
}
.bloque-indicaciones h3 {
  margin-top: 0;
}


/* Esto es solo para la parteb de anexos que se vea bien jajaja*/
/*  Estilo moderno para anexos de proveedor */
.anexos-modern {
  background: #f9fafc;
  border: 1px solid #dde1e6;
  border-radius: 10px;
  padding: 20px;
  margin-top: 25px;
}
.anexos-cliente legend {
  color: #0055aa; /* Ejemplo: título de otro color */
}


.anexos-modern legend {
  font-weight: 600;
  font-size: 1.05rem;
  color: #333;
}

.anexo-seccion {
  margin-top: 20px;
}

.anexo-seccion h4 {
  color: #0077cc;
  font-size: 1rem;
  margin-bottom: 8px;
}

.anexo-seccion label {
  display: block;
  font-weight: 500;
  margin-bottom: 10px;
  color: #333;
}

.anexo-seccion input[type="file"] {
  display: block;
  margin-top: 5px;
  padding: 4px;
  font-size: 0.9rem;
}

.anexo-seccion input[type="file"]:hover {
  background: #1049b3;
  border-radius: 5px;
}

hr {
  border: none;
  border-top: 1px solid #ccc;
  margin: 20px 0;
}

/* lineas de declaracion donde edice YO ACTUANDO en nombre bla bla bla*/
.linea-continua input[type="text"] {
  display: inline-block;
  width: auto;
  min-width: 160px;
  border: none;
  border-bottom: 1px solid #999;
  background: transparent;
  margin: 0 6px;
  padding: 2px 4px;
  text-align: center;
  font-size: 0.95rem;
}

.linea-continua input[type="text"]:focus {
  outline: none;
  border-bottom: 1.5px solid #222;
}

/* Esto es para  la parte de evaluacion de riesgo*/
.inline-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.inline-group label {
  margin: 0;
}

/*part del perfil transaccional de proveedor */

.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.btn-group label {
  background-color: #f7f7f7;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 6px 14px;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
  font-size: 0.9rem;
}

.btn-group label:hover {
  background-color: #e9e9e9;
}

.btn-group input[type="checkbox"] {
  display: none;
}

.btn-group input[type="checkbox"]:checked + span,
.btn-group label:has(input[type="checkbox"]:checked) {
  background-color: #1e88e5;
  color: #fff;
  border-color: #1e88e5;
}

#otrosTexto, .js-otros-texto {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 0.9rem;
}

.hidden { display: none; }


/*  Estado gris elegante (cuando los campos están desactivados) */
.disabled-gray {
  background-color: #f4f4f4 !important;
  color: #777 !important;
  border-color: #ccc !important;
  cursor: not-allowed;
  opacity: 0.8;
  transition: all 0.3s ease;
}

/*  Transición general para todos los campos (suave y moderna) */
input, select, textarea {
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease, opacity 0.25s ease;
}

/*  Inputs activos — sutil mejora de foco (borde azulado elegante) */
.pep-section input:not(:disabled):focus,
.pep-section select:focus,
.pep-section textarea:focus {
  border-color: #2196f3;
  box-shadow: 0 0 5px rgba(33,150,243,0.25);
}

/*  Bloques ocultos (si los usás en otros lugares) */
.hidden {
  display: none !important;
}

/*  Fieldset más definido, limpio y equilibrado */
fieldset.pep-section {
  border: 2px solid #e1e1e1;
  border-radius: 10px;
  padding: 1.2rem 1.5rem;
  margin-bottom: 1.5rem;
  background: linear-gradient(180deg, #fafafa 0%, #fefefe 100%);
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

/*  Legend moderno con color de acento y peso justo */
fieldset.pep-section legend {
  font-weight: 600;
  font-size: 1.1rem;
  color: #8B0000;
  padding: 0 10px;
  border-left: 4px solid #2196f3;
  margin-bottom: 0.6rem;
}

/*  Mejor alineación entre inputs dentro del grid */
.pep-section .grid-2,
.pep-section .grid-3 {
  display: grid;
  gap: 1rem;
}

/*  Etiqueta “Sí/No” o texto de estado (opcional si lo usás) */
.pep-status-text {
  font-style: italic;
  color: #666;
  margin-top: 0.4rem;
}


/* --- Campos compactos --- */
/* ================================
Acomodar inputs pequeños en 2 columnas
   ================================ */
fieldset .grid-6 .input-sm,
fieldset .grid-8 .input-sm,
fieldset .grid-6 .input-md,
fieldset .grid-8 .input-md {
  display: inline-block;
  vertical-align: top;
  width: 48%;              /* dos columnas con pequeño margen */
  margin-right: 2%;
  box-sizing: border-box;
}

/* Forzar los labels compactos a adaptarse a esa doble columna */
label.compacto {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  width: 48%;               /* se ajusta a la mitad */
  margin-bottom: 0.5rem;
  box-sizing: border-box;
}

/* Pequeño respiro visual */
label.compacto:nth-child(even) {
  margin-right: 0;
}
label.compacto:nth-child(odd) {
  margin-right: 2%;
}

/* Suavizamos el espaciado general */
fieldset .grid-6,
fieldset .grid-8 {
  gap: 0.4rem 0.5rem;
}


/* ======================================
   🎯 Botones "Agregar" con mejor estilo
   ====================================== */

/* Base moderna */
button.btn-secundary.add-row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: #5c0000;            /* color institucional */
  color: #fff;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 2px 6px rgba(92, 0, 0, 0.2);
}

/* Icono simulado con "+" si no hay ícono */
button.btn-secundary.add-row::before {
  content: "+";
  font-size: 1.1rem;
  font-weight: bold;
  line-height: 1;
}

/* Hover brillante */
button.btn-secundary.add-row:hover {
  background: #7b0000;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(92, 0, 0, 0.35);
}

/* Click efecto */
button.btn-secundary.add-row:active {
  transform: scale(0.97);
  background: #470000;
}

/* Espaciado entre botones y campos */
.repeats-rows + .btn-secundary.add-row {
  margin-top: 0.6rem;
}



/* --- Tabla resumen elegante --- */
.tabla-resumen {
  margin-top: 1rem;
  overflow-x: auto;
}

.tabla-resumen table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
}

.tabla-resumen th {
  background: #5c0000;
  color: #fff;
  padding: 0.5rem;
  text-align: left;
}

.tabla-resumen td {
  padding: 0.5rem;
  border-top: 1px solid #eee;
}

.tabla-resumen tr:nth-child(even) {
  background: #f9f9f9;
}

.tabla-resumen .btn-delete {
  background: #900;
  color: #fff;
  border: none;
  padding: 0.3rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
}

.tabla-resumen .btn-delete:hover {
  background: #c00;
}

/* --- Botones acción dentro de la tabla --- */
.tabla-resumen .btn-edit,
.tabla-resumen .btn-delete {
  border: none;
  padding: 0.3rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: 0.2s;
}

.tabla-resumen .btn-edit {
  background: #5c0000;
  color: #fff;
}
.tabla-resumen .btn-edit:hover {
  background: #7a1a1a;
}

.tabla-resumen .btn-delete {
  background: #900;
  color: #fff;
}
.tabla-resumen .btn-delete:hover {
  background: #c00;
}


/*Prueba de encabezado */

.tabla-resumen table th,
.tabla-resumen table td {
  text-align: left;
  vertical-align: middle;
  padding: 0.5rem 0.4rem;
  border-bottom: 1px solid #ddd;
}

.tabla-resumen table th {
  background: #f6f6f6;
  color: #5c0000;
  font-weight: 600;
}


/*El TOAST Warning del js  */
.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  background: #5c0000;
  color: white;
  padding: 10px 15px;
  border-radius: 6px;
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  z-index: 9999;
}
.toast.show {
  opacity: 1;
  transform: translateY(0);
}
.toast-warning { background: #0355cf; }
.toast-success { background: #007f4f; }

/*   Carga de archivos */