:root {
  --primary-color: #4a90e2;
  --background-color: #f4f7f6;
  --text-color: #333;
  --container-bg: #ffffff;
  --border-color: #ddd;
  --error-color: #d9534f;
  --success-color: #28a745;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--background-color);
  color: var(--text-color);
  margin: 0;
  padding: 20px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
}

.container {
  background-color: var(--container-bg);
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 600px;
}

/* --- General Form Styles --- */
header { text-align: center; margin-bottom: 30px; border-bottom: 1px solid var(--border-color); padding-bottom: 20px; }
header h1 { color: var(--primary-color); margin: 0; }
.form-group { margin-bottom: 20px; }
label { display: block; margin-bottom: 8px; font-weight: 500; }
input[type="file"], select, input[type="password"], textarea {
  width: 100%; padding: 12px; border: 1px solid var(--border-color);
  border-radius: 8px; box-sizing: border-box; font-size: 16px;
  font-family: 'Inter', sans-serif;
}
textarea { resize: vertical; min-height: 80px; }
.hidden { display: none !important; }

/* --- Input con Botón (Validar) --- */
.input-group { display: flex; gap: 10px; }
.input-group input { flex-grow: 1; }
.input-group button {
  padding: 0 20px; border: 1px solid var(--primary-color);
  background-color: transparent; color: var(--primary-color);
  border-radius: 8px; cursor: pointer; font-weight: 500; transition: all 0.2s;
}
.input-group button:hover { background-color: var(--primary-color); color: white; }

/* --- Mensaje de Estado de Validación --- */
#validation-status {
  font-size: 14px; margin-top: 5px; display: block;
}
#validation-status.success { color: var(--success-color); }
#validation-status.error { color: var(--error-color); }

/* --- Botón Principal --- */
button#submit-button {
  width: 100%; padding: 15px; background-color: var(--primary-color);
  color: white; border: none; border-radius: 8px; font-size: 18px;
  font-weight: 700; cursor: pointer; transition: background-color 0.3s;
}
button#submit-button:disabled { background-color: #a0a0a0; cursor: not-allowed; }

/* --- Carga y Resultado --- */
#loading { text-align: center; margin-top: 30px; }
.spinner {
  border: 4px solid rgba(0, 0, 0, 0.1); width: 36px; height: 36px;
  border-radius: 50%; border-left-color: var(--primary-color);
  animation: spin 1s ease infinite; margin: 0 auto 10px;
}
@keyframes spin { 100% { transform: rotate(360deg); } }

/* --- Nuevo Diseño del Área de Resultados --- */
#result-wrapper { margin-top: 30px; }
.result-header {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px;
}
.result-header h2 { margin: 0; color: var(--primary-color); font-size: 22px; }
.result-header button#copy-btn {
  padding: 8px 15px; border: 1px solid var(--primary-color);
  background-color: var(--primary-color); color: white;
  border-radius: 8px; cursor: pointer; transition: all 0.2s;
}
.result-header button#copy-btn:hover { opacity: 0.8; }
/* --- ESTA ES LA NUEVA SECCIÓN ACTUALIZADA --- */
.result-container {
  padding: 20px;
  background-color: #f9f9f9;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  /* Estilos que antes estaban en #result-text */
  text-align: left; /* Alinear el texto a la izquierda para mejor lectura de informes */
  line-height: 1.6;
  color: var(--text-color);
  font-family: 'Inter', sans-serif; /* Usamos la fuente principal, no monospace */
}

/* Estilos para el contenido renderizado desde Markdown */
.result-container h1,
.result-container h2,
.result-container h3 {
  color: #1a202c; /* Un color oscuro y profesional para los títulos */
  margin-top: 1.8em;
  margin-bottom: 0.8em;
  border-bottom: 1px solid var(--border-color); /* Usamos tu variable de borde */
  padding-bottom: 0.3em;
}

.result-container h1 { font-size: 1.6em; }
.result-container h2 { font-size: 1.4em; }
.result-container h3 { font-size: 1.2em; }

.result-container p {
  margin-bottom: 1em;
}

.result-container ul,
.result-container ol {
  padding-left: 25px; /* Indentación limpia para listas */
  margin-bottom: 1em;
}

.result-container li {
  margin-bottom: 0.5em;
}

.result-container strong {
  color: var(--primary-color); /* ¡Resaltamos el texto importante con tu color primario! */
  font-weight: 700;
}

.result-container hr {
  border: none;
  border-top: 2px solid var(--border-color); /* Línea de separación limpia */
  margin: 2em 0;
}

/* --- Barra Superior con Toggle de Idioma --- */
.top-bar {
    position: absolute;
    top: 15px;
    right: 25px;
}
#lang-toggle-btn {
    background-color: #eef4fb;
    border: 1px solid var(--border-color);
    color: var(--primary-color);
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.2s;
}
#lang-toggle-btn:hover { background-color: #dbeaf7; }

/* --- Nuevo Header de la Aplicación --- */
.app-header {
    text-align: center;
    margin-bottom: 40px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
}
.app-header h1 {
    font-size: 2.5em;
    color: var(--primary-color);
    margin-bottom: 5px;
}
.app-header .tagline {
    font-size: 1.1em;
    color: #555;
    margin-top: 0;
    margin-bottom: 15px;
}
.app-header .description {
    font-size: 1em;
    line-height: 1.6;
    color: #333;
    max-width: 500px;
    margin: 0 auto;
}

/* --- Resultados y Footer --- */
#result-wrapper { margin-top: 30px; }
.result-header {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px;
}
.result-header h2 { margin: 0; color: var(--primary-color); font-size: 22px; }
.result-header button { /* ... sin cambios ... */ }

.privacy-section {
    margin-top: 50px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    color: #666;
}
.privacy-section h2 {
    text-align: center;
    color: #555;
    font-size: 1.2em;
}
.privacy-section ul {
    list-style: none;
    padding: 0;
    font-size: 0.9em;
    line-height: 1.7;
}
.privacy-section ul li {
    margin-bottom: 10px;
}