/* =============================
   1. VARIABLES GLOBALES
   ============================= */
:root {
  /* Colores principales */
  --primary-color: #219ebc;
  --primary-hover: #1b8dad;
  --secondary-color: #2e86ab;
  /* Colores de texto */
  --text-primary: #2c3e50;
  --text-secondary: #6c6c6c;
  --text-light: #8fa0b3;
  --text-title: #002239;
  /* Colores de fondo */
  --bg-white: #ffffff;
  --bg-light: #f8fafc;
  --bg-primary: var(--primary-color);
  /* Tipografía */
  --font-main: "Poppins", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  /* Bordes y radios */
  --border-radius-md: 10px;
  --border-radius-lg: 16px;
  /* Sombras */
  --shadow-sm: 0px 4px 4px 0px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  /* Espaciado */
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;
  /* Transiciones */
  --transition: all 0.3s ease;
}

/* =============================
   2. RESET Y ESTILOS BASE
   ============================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Poppins", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

html,
body {
  height: 100%;
  color: var(--text-primary);
  background-color: var(--bg-white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* =============================
   3. LAYOUT PRINCIPAL
   ============================= */
.main-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f8fafc 0%, #e8f4f8 100%);
  padding: 2rem;
}

.content-wrapper {
  max-width: 1200px;
  width: 100%;
  background: white;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.header-section {
  background: white;
  padding: 3rem 2rem;
  text-align: center;
  color: white;
}

.logo {
  width: 150px;
  height: 150px;
  margin: 0 auto 1.5rem;
}

.header-section h1 {
  font-size: 2.5rem;
  font-weight: var(--font-weight-bold);
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.header-section p {
  font-size: 1.2rem;
  font-weight: var(--font-weight-medium);
  opacity: 0.95;
  max-width: 800px;
  margin: 0 auto;
  line-height: 1.6;
  color: var(--secondary-color);
}

.form-section {
  padding: 3rem 2rem;
  background: linear-gradient(135deg, #219ebc 0%, #16748b 100%);
}

.intro-text {
  background: var(--primary-color);
  color: white;
  padding: 2rem;
  border-radius: var(--border-radius-md);
  margin-bottom: 2rem;
  text-align: center;
}

.intro-text h2 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.intro-text p {
  font-size: 1rem;
  opacity: 0.95;
}

/* =============================
   4. FORMULARIO
   ============================= */
.form-container {
  max-width: 600px;
  margin: 0 auto;
}

.form-intro-text {
  color: white;
  margin-bottom: 1.75rem;
  font-size: 1.3rem;
  font-weight: var(--font-weight-medium);
  line-height: 1.6;
  text-align: center;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  font-size: 1rem;
  font-weight: var(--font-weight-medium);
  color: white;
  margin-bottom: 0.5rem;
}

.form-control {
  width: 100%;
  height: 54px;
  border-radius: var(--border-radius-lg);
  padding: 0 1.25rem;
  border: 2px solid #e5e7eb;
  font-size: 1rem;
  color: var(--text-primary);
  background: var(--bg-white);
  transition: var(--transition);
}

.form-control::placeholder {
  color: #9ca3af;
  font-size: 0.95rem;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(33, 158, 188, 0.1);
}

.form-control.input-validation-error,
.form-control.is-invalid {
  border-color: #ef4444;
}

/* Select styling */
select.form-control {
  appearance: none;
  padding-right: 2.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%232c3e50' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-color: var(--bg-white);
  cursor: pointer;
}

/* Sin valor seleccionado (gris) */
select.form-control:invalid {
  color: #9ca3af;
}

/* Con valor seleccionado (negro) */
select.form-control:valid {
  color: var(--text-primary);
}

select.form-control:hover {
  border-color: var(--primary-color);
}

select.form-control option {
  color: var(--text-primary);
  background-color: var(--bg-white);
  padding: 0.5rem;
}

select.form-control option[value=""] {
  color: #9ca3af;
}

select.form-control option:checked {
  background: linear-gradient(#7dc7dd, #7dc7dd);
  background-color: #7dc7dd !important;
  color: var(--text-primary);
}

.form-control.is-invalid:focus {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.text-danger {
  font-size: 0.875rem;
  color: #7dc7dd;
  margin-top: 0.25rem;
  display: block;
  font-weight: 600;
}

.validation-summary-errors {
  background: rgba(125, 199, 221, 0.15);
  border: 2px solid #7dc7dd;
  border-radius: var(--border-radius-md);
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.validation-summary-errors ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.validation-summary-errors li {
  color: #7dc7dd;
  font-size: 0.875rem;
  font-weight: 600;
}

/* =============================
   5. CHECKBOX PERSONALIZADO
   ============================= */
.form-check {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.form-check-label {
  flex: 1;
  color: white;
  font-size: 1rem;
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  user-select: none;
  margin-bottom: 0;
  transition: var(--transition);
}

.form-check-label:hover {
  opacity: 0.95;
  text-decoration: underline;
}

.form-check-input {
  width: 24px;
  height: 24px;
  min-width: 24px;
  min-height: 24px;
  cursor: pointer;
  accent-color: #7dc7dd;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 4px;
  transition: var(--transition);
}

.form-check-input:hover {
  border-color: white;
  box-shadow: 0 0 0 2px rgba(125, 199, 221, 0.3);
}

.form-check-input:checked {
  background-color: #7dc7dd;
  border-color: #7dc7dd;
  box-shadow: 0 0 0 2px rgba(125, 199, 221, 0.3);
}

.form-check-input:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(125, 199, 221, 0.4);
}

/* =============================
   5. BOTONES
   ============================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 2rem;
  border-radius: var(--border-radius-lg);
  font-weight: var(--font-weight-semibold);
  text-decoration: none;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  font-size: 1.1rem;
  border: none;
  min-height: 56px;
  letter-spacing: 0.5px;
}

.btn-primary {
  background: #7dc7dd;
  color: var(--text-primary);
  width: 100%;
  box-shadow: 0 4px 12px rgba(125, 199, 221, 0.4);
}

.btn-primary:hover {
  background: #6db5cc;
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(125, 199, 221, 0.5);
}

.btn-primary:active {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(2, 132, 199, 0.4);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* =============================
   6. PÁGINA DE ÉXITO
   ============================= */
.success-container {
  text-align: center;
  padding: 4rem 2rem;
}

.success-icon {
  width: 100px;
  height: 100px;
  background: var(--primary-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 2rem;
  font-size: 3rem;
  color: white;
}

.success-container h1 {
  color: var(--primary-color);
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.success-container p {
  color: var(--text-secondary);
  font-size: 1.2rem;
  margin-bottom: 2rem;
  line-height: 1.6;
}

.success-container .success-btn {
  max-width: 300px;
  margin: 0 auto;
  display: block;
}

/* =============================
   7. PÁGINA DE ERROR
   ============================= */
.error-container {
  text-align: center;
  padding: 4rem 2rem;
}

.error-icon {
  width: 120px;
  height: 120px;
  background: linear-gradient(135deg, #ff6b6b 0%, #ff5252 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 2rem;
  color: white;
  font-size: 3rem;
  box-shadow: 0 8px 20px rgba(255, 107, 107, 0.3);
  animation: float 3s ease-in-out infinite;
}

.error-icon svg {
  width: 60px;
  height: 60px;
}

.error-container h1 {
  color: var(--text-title);
  font-size: 2.5rem;
  margin-bottom: 1rem;
  font-weight: var(--font-weight-bold);
}

.error-message {
  color: var(--text-secondary);
  font-size: 1.2rem;
  margin-bottom: 2rem;
  line-height: 1.6;
}

.error-details {
  background: var(--bg-light);
  padding: 1.5rem;
  border-radius: var(--border-radius-md);
  margin: 2rem 0;
  border-left: 4px solid #ff6b6b;
}

.error-detail-label {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: var(--font-weight-semibold);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.error-detail-value {
  display: block;
  background: white;
  padding: 0.75rem;
  border-radius: 4px;
  font-size: 0.9rem;
  word-break: break-all;
  color: var(--text-primary);
  font-family: "Courier New", monospace;
}

.error-info {
  background: rgba(255, 107, 107, 0.05);
  padding: 2rem;
  border-radius: var(--border-radius-md);
  margin: 2rem 0;
  text-align: left;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

.error-info h3 {
  color: var(--text-title);
  font-size: 1.1rem;
  margin-bottom: 1rem;
  text-align: center;
}

.error-suggestions {
  list-style: none;
  padding: 0;
  margin: 0;
}

.error-suggestions li {
  color: var(--text-secondary);
  padding: 0.5rem 0 0.5rem 1.75rem;
  position: relative;
  font-size: 0.95rem;
}

.error-suggestions li:before {
  content: "✓";
  position: absolute;
  left: 0;
  color: #ff6b6b;
  font-weight: bold;
  font-size: 1.2rem;
}

.error-btn {
  margin-top: 2rem;
  width: 100%;
  max-width: 300px;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* =============================
   7. RESPONSIVE
   ============================= */
@media (max-width: 768px) {
  .header-section h1 {
    font-size: 1.8rem;
  }

  .header-section p {
    font-size: 1rem;
  }

  .logo {
    width: 120px;
    height: 120px;
  }

  .form-section {
    padding: 2rem 1.5rem;
  }

  .success-container h1 {
    font-size: 1.8rem;
  }

  .success-container p {
    font-size: 1rem;
  }

  .error-container h1 {
    font-size: 1.8rem;
  }

  .error-icon {
    width: 100px;
    height: 100px;
  }

  .error-icon svg {
    width: 50px;
    height: 50px;
  }
}

@media (max-width: 480px) {
  .main-container {
    padding: 1rem;
  }

  .header-section {
    padding: 2rem 1rem;
  }

  .header-section h1 {
    font-size: 1.5rem;
  }

  .logo {
    width: 100px;
    height: 100px;
  }

  .form-section {
    padding: 1.5rem 1rem;
  }
}