/* ============================================
   DIAGNÓSTICO ISPs COLOMBIA - ESTILOS
   Colores: #082d58 (azul oscuro), #20d1ba (turquesa)
   Tipografía: Poppins
   ============================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --color-primary: #082d58;
  --color-secondary: #20d1ba;
  --color-accent: #ffffff;
  --color-text: #333333;
  --color-bg: #f5f7fa;
  --color-success: #28a745;
  --color-error: #dc3545;
  --font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body {
  font-family: var(--font-family);
  color: var(--color-text);
  background-color: var(--color-bg);
  line-height: 1.6;
}

.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 20px;
}

/* ============ HEADER ============ */
.main-header {
  background: linear-gradient(135deg, var(--color-primary) 0%, #0a4075 100%);
  color: white;
  padding: 20px 0;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-logos {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 30px;
  margin-bottom: 15px;
  flex-wrap: wrap;
}

.header-logos .logo {
  height: 50px;
  width: auto;
  object-fit: contain;
  background: white;
  padding: 5px 15px;
  border-radius: 5px;
}

.header-title {
  text-align: center;
}

.header-title h1 {
  font-size: 1.8rem;
  font-weight: 600;
  margin-bottom: 5px;
}

.header-subtitle {
  font-size: 0.95rem;
  opacity: 0.9;
}

/* ============ MAIN CONTENT ============ */
.main-content {
  min-height: calc(100vh - 300px);
  padding: 40px 0;
}

/* ============ WELCOME SECTION ============ */
.welcome-section {
  max-width: 800px;
  margin: 0 auto;
}

.welcome-card {
  background: white;
  border-radius: 10px;
  padding: 40px;
  box-shadow: 0 2px 15px rgba(0,0,0,0.08);
  margin-bottom: 30px;
}

.welcome-card h2 {
  color: var(--color-primary);
  font-size: 1.8rem;
  margin-bottom: 20px;
  text-align: center;
}

.welcome-content p {
  margin-bottom: 15px;
  text-align: justify;
}

.info-boxes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin: 25px 0;
}

.info-box {
  background: var(--color-bg);
  border-left: 4px solid var(--color-secondary);
  padding: 15px;
  border-radius: 5px;
}

.info-box .icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 10px;
}

.welcome-footer {
  font-style: italic;
  color: #666;
  text-align: center;
  margin: 20px 0;
}

.welcome-highlight {
  background: linear-gradient(135deg, var(--color-secondary) 0%, #1ab5a0 100%);
  color: white;
  padding: 20px;
  border-radius: 8px;
  text-align: center;
  font-size: 1.1rem;
  margin-top: 25px;
}

/* ============ INITIAL QUESTION ============ */
.initial-question-card {
  background: white;
  border-radius: 10px;
  padding: 30px;
  box-shadow: 0 2px 15px rgba(0,0,0,0.08);
}

.initial-question-card h3 {
  color: var(--color-primary);
  margin-bottom: 20px;
  font-size: 1.5rem;
}

.question-text {
  font-size: 1.1rem;
  font-weight: 500;
  margin-bottom: 20px;
  color: var(--color-text);
}

/* ============ RADIO & CHECKBOX GROUPS ============ */
.radio-group, .checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.radio-option, .radio-group label, .checkbox-group label {
  display: flex;
  align-items: center;
  padding: 12px 15px;
  background: var(--color-bg);
  border: 2px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.radio-option:hover, .radio-group label:hover, .checkbox-group label:hover {
  background: #e8f4f8;
  border-color: var(--color-secondary);
}

.radio-option input, .radio-group input, .checkbox-group input {
  margin-right: 10px;
  cursor: pointer;
}

.radio-label {
  font-weight: 500;
}

/* ============ BUTTONS ============ */
.btn {
  display: inline-block;
  padding: 12px 30px;
  border: none;
  border-radius: 8px;
  font-family: var(--font-family);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  text-align: center;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-primary) 0%, #0a4075 100%);
  color: white;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(8, 45, 88, 0.3);
}

.btn-secondary {
  background: #6c757d;
  color: white;
}

.btn-secondary:hover {
  background: #5a6268;
}

.btn-success {
  background: var(--color-success);
  color: white;
}

.btn-success:hover {
  background: #218838;
}

.btn-large {
  padding: 15px 40px;
  font-size: 1.1rem;
  width: 100%;
  margin-top: 10px;
}

/* ============ FORM SECTIONS ============ */
.form-header {
  background: white;
  border-radius: 10px;
  padding: 30px;
  margin-bottom: 20px;
  box-shadow: 0 2px 15px rgba(0,0,0,0.08);
}

.form-header h2 {
  color: var(--color-primary);
  margin-bottom: 15px;
}

.form-description {
  color: #666;
  margin-bottom: 20px;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--color-bg);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 10px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-secondary) 0%, var(--color-primary) 100%);
  transition: width 0.3s ease;
  width: 0%;
}

.progress-text {
  text-align: right;
  font-size: 0.9rem;
  color: #666;
  font-weight: 500;
}

.form-section {
  background: white;
  border-radius: 10px;
  padding: 30px;
  margin-bottom: 20px;
  box-shadow: 0 2px 15px rgba(0,0,0,0.08);
  display: none;
}

.form-section.active {
  display: block;
}

.section-title {
  color: var(--color-primary);
  font-size: 1.5rem;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 3px solid var(--color-secondary);
}

.section-description {
  background: #f8f9fa;
  padding: 15px;
  border-radius: 5px;
  margin-bottom: 25px;
  font-size: 0.95rem;
  line-height: 1.6;
}

/* ============ FORM GROUPS ============ */
.form-group {
  margin-bottom: 25px;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--color-text);
}

.form-label.required::after {
  content: " *";
  color: var(--color-error);
}

.form-input, .form-select {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-family: var(--font-family);
  font-size: 1rem;
  transition: border-color 0.3s ease;
}

.form-input:focus, .form-select:focus {
  outline: none;
  border-color: var(--color-secondary);
}

.help-text {
  font-size: 0.9rem;
  color: #666;
  margin-top: 5px;
  font-style: italic;
}

/* ============ LIKERT SCALE ============ */
.likert-group {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 20px;
}

.likert-scale {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 15px;
}

.likert-option {
  flex: 1;
  text-align: center;
}

.likert-option input {
  display: none;
}

.likert-label {
  display: block;
  padding: 15px 10px;
  background: white;
  border: 2px solid #ddd;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 600;
  font-size: 1.2rem;
}

.likert-option input:checked + .likert-label {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}

.likert-label:hover {
  border-color: var(--color-secondary);
  transform: translateY(-2px);
}

/* ============ NAVIGATION BUTTONS ============ */
.form-nav-buttons {
  display: flex;
  gap: 15px;
  justify-content: space-between;
  margin-top: 30px;
}

.form-nav-buttons .btn {
  flex: 1;
}

/* ============ TABLE RESPONSIVE ============ */
.table-responsive {
  overflow-x: auto;
  margin: 20px 0;
}

.form-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
}

.form-table th, .form-table td {
  padding: 12px;
  text-align: left;
  border: 1px solid #ddd;
}

.form-table th {
  background: var(--color-primary);
  color: white;
  font-weight: 500;
}

.form-table td input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
}

/* ============ ERROR & SUCCESS MESSAGES ============ */
.error-message {
  background: #f8d7da;
  color: #721c24;
  padding: 12px 15px;
  border-radius: 5px;
  border-left: 4px solid var(--color-error);
  margin: 15px 0;
}

.success-box {
  background: #d4edda;
  border-left-color: var(--color-success);
}

/* ============ TRANSITION MESSAGE ============ */
.transition-message {
  text-align: center;
  padding: 30px;
  background: linear-gradient(135deg, #e8f4f8 0%, #d0e8f2 100%);
  border-radius: 10px;
}

.transition-message h4 {
  color: var(--color-primary);
  margin-bottom: 15px;
  font-size: 1.3rem;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid var(--color-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 20px auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ============ GRACIAS PAGE ============ */
.gracias-section {
  max-width: 700px;
  margin: 0 auto;
}

.gracias-card {
  background: white;
  border-radius: 10px;
  padding: 50px 40px;
  box-shadow: 0 2px 15px rgba(0,0,0,0.08);
  text-align: center;
}

.success-icon {
  font-size: 4rem;
  margin-bottom: 20px;
}

.gracias-card h2 {
  color: var(--color-primary);
  margin-bottom: 25px;
  font-size: 1.8rem;
}

.gracias-content {
  text-align: left;
  margin-bottom: 30px;
}

.gracias-content .lead {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--color-primary);
  margin-bottom: 20px;
}

.footer-text {
  font-size: 0.9rem;
  color: #666;
  margin-top: 20px;
  font-style: italic;
}

/* ============ ERROR PAGE ============ */
.error-page {
  text-align: center;
  padding: 60px 20px;
}

.error-code {
  font-size: 6rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 20px;
}

/* ============ FOOTER ============ */
.main-footer {
  background: var(--color-primary);
  color: white;
  padding: 30px 0;
  text-align: center;
  margin-top: 50px;
}

.main-footer p {
  margin: 5px 0;
  font-size: 0.9rem;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
  .container {
    padding: 15px;
  }

  .welcome-card, .initial-question-card, .form-section {
    padding: 20px;
  }

  .header-title h1 {
    font-size: 1.3rem;
  }

  .header-logos .logo {
    height: 40px;
  }

  .likert-scale {
    flex-wrap: wrap;
  }

  .likert-option {
    min-width: 60px;
  }

  .form-nav-buttons {
    flex-direction: column;
  }

  .info-boxes {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .header-logos {
    gap: 15px;
  }

  .header-logos .logo {
    height: 35px;
    padding: 3px 10px;
  }

  .btn {
    padding: 10px 20px;
    font-size: 0.95rem;
  }

  .likert-label {
    padding: 10px 5px;
    font-size: 1rem;
  }
}

/* ============ VALIDACIONES Y ERRORES ============ */
.form-input.error, .form-select.error {
  border-color: #dc3545 !important;
  background-color: #fff5f5;
}

.field-error-message {
  color: #dc3545;
  font-size: 0.85rem;
  margin-top: 5px;
  display: block;
}

.validation-summary {
  background: #f8d7da;
  border: 2px solid #dc3545;
  border-radius: 8px;
  padding: 15px;
  margin: 20px 0;
}

.validation-summary h4 {
  color: #721c24;
  margin: 0 0 10px 0;
  font-size: 1rem;
}

.validation-summary ul {
  margin: 0;
  padding-left: 20px;
  color: #721c24;
}

.validation-summary li {
  margin-bottom: 5px;
}

/* Animación shake para errores */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
  20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.shake {
  animation: shake 0.5s;
}

/* Focus en campos con error */
.form-input.error:focus, .form-select.error:focus {
  outline: none;
  border-color: #dc3545;
  box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

/* Indicador visual de campo válido */
.form-input:valid:not(:placeholder-shown),
.form-select:valid {
  border-color: #28a745;
}

.form-input:valid:not(:placeholder-shown):focus,
.form-select:valid:focus {
  border-color: #28a745;
  box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

/* Estilos para grupos de preguntas con error */
.form-group.error {
  background-color: #fff5f5;
  border: 2px solid #dc3545;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 20px;
  animation: shake 0.5s;
}

/* Estilos específicos para preguntas Likert con error */
.likert-group.likert-error {
  background-color: #fff5f5 !important;
  border: 3px solid #dc3545 !important;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 20px;
  animation: shake 0.5s;
  box-shadow: 0 0 10px rgba(220, 53, 69, 0.2);
}

.likert-group.likert-error .form-label {
  color: #dc3545;
  font-weight: 600;
}

.likert-group.likert-error::after {
  content: '⚠️ Debe seleccionar una opción del 1 al 5';
  display: block;
  color: #dc3545;
  font-size: 0.9rem;
  margin-top: 10px;
  font-weight: 500;
}
