/* 
ESTILOS BASE PARA PÁGINAS DE SISTEMA
*/

:root {
  --system-primary: #0056b3;
  --system-secondary: #6c757d;
  --system-success: #28a745;
  --system-danger: #dc3545;
  --system-warning: #ffc107;
  --system-info: #17a2b8;
  --system-light: #fafafa;
  --system-dark: #2d3436;
  --system-white: #ffffff;
  --system-background: #ffffff;
  --system-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --system-border-radius: 4px;
  --system-input-padding: 8px 12px;
  --system-input-height: 42px;
  --system-box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  --lt-color-gray-300: #e0e0e0;
  --btn-padding-y: 8px;
  --btn-padding-x: 16px;
  --btn-font-size: 16px;
  --btn-border-radius: 8px;
  --btn-transition: all 0.2s ease-in-out;
  --btn-primary-bg: var(--system-primary);
  --btn-primary-hover-bg: #0069d9;
  --btn-primary-active-bg: #0062cc;
  --btn-primary-color: var(--system-white);
}

/* Asegurar que todos los elementos tienen box-sizing: border-box */
*, *::before, *::after {
  box-sizing: border-box;
}

/* Detector de Bootstrap (se utiliza para ajustes condicionales) */
.mg-bootstrap-detector {
  display: none;
}

/* Clases de compatibilidad con Bootstrap */
.mg-mb-0 {
  margin-bottom: 0;
}
.mg-mb-3 {
  margin-bottom: 1rem;
}
.mg-mb-2 {
  margin-bottom: 0.5rem;
}

/* Estilos compartidos para inputs y selects */
.mg-form-control,
.mg-form-select {
  display: block;
  width: 100%;
  max-width: 100%;
  height: var(--system-input-height);
  padding: var(--system-input-padding);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  color: #212529;
  background-color: #fff;
  background-clip: padding-box;
  border: 1px solid #ced4da;
  border-radius: var(--system-border-radius);
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
  box-sizing: border-box;
}

.mg-form-control:focus,
.mg-form-select:focus {
  color: #212529;
  background-color: #fff;
  border-color: var(--system-dark);
  outline: 0;
  box-shadow: 0 0 0 0.25rem rgba(0, 123, 255, 0.25);
}

/* Ajustes específicos para selects */
.mg-form-select {
  padding-right: 2.25rem;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 16px 12px;
  appearance: none;
}

.mg-form-label {
  display: inline-block;
  margin-bottom: 2px;
  font-size: 14px;
  font-weight: 500;
  width: 100%;
}

.mg-form-text {
  margin-top: 0.25rem;
  font-size: 0.875em;
  color: var(--system-secondary);
  width: 100%;
}
.mg-form-check {
  min-height: 1.5rem;
  margin-bottom: 30px;
  display: flex;
  align-items: center;
  border-bottom-style: dashed;
  border-bottom-color: var(--system-secondary);
  border-width: 1px;
  padding-bottom: 30px;
}
.mg-form-check-input {
  width: 1em;
  height: 1em;
  margin-top: 0.25em;
  vertical-align: top;
  background-color: #fff;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  border: 1px solid rgba(0, 0, 0, 0.25);
  appearance: none;
  margin: 3px 10px 0 0;
}

.mg-form-check-input[type="radio"] {
  border-radius: 50%;
}

.mg-form-check-input:checked {
  background-color: var(--system-primary);
  border-color: var(--system-primary);
}

.mg-form-check-label {
  margin-bottom: 0;
}

/* Nuestro sistema propio - más simple y directo */
.mg-btn-primary { 
  display: inline-block; 
  background-color: var(--btn-primary-bg); 
  color: var(--btn-primary-color); 
  padding: var(--btn-padding-y) var(--btn-padding-x); 
  border-radius: var(--btn-border-radius); 
  text-decoration: none; 
  font-weight: 500; 
  transition: var(--btn-transition);
  border: none;
  cursor: pointer;
  font-size: var(--btn-font-size);
  font-family: var(--system-font);
  border: 1px solid var(--btn-primary-bg);
}

.mg-btn-primary:hover { 
  transform: translateY(-2px); 
  color: var(--btn-primary-color);
  text-decoration: none;
  background-color: var(--btn-primary-hover-bg);
}

.mg-btn-primary:active {
  background-color: var(--btn-primary-active-bg);
  transform: translateY(0);
}

.mg-form-control:disabled {
  background-color: var(--lt-color-gray-300);
  opacity: 1;
}

/* Badges/Etiquetas */
.mg-badge { 
  display: inline-block; 
  padding: 4px 8px; 
  border-radius: 4px; 
  font-weight: 600; 
  font-size: 0.9em; 
}

.mg-badge-success { 
  color: white; 
  background-color: rgba(40,167,69,1); 
}

/* Alertas y mensajes de estado */
.mg-alert {
  position: relative;
  padding: 16px 20px;
  margin-bottom: 20px;
  border-radius: 8px;
  display: flex;
  align-items: flex-start;
  border-left-width: 4px;
  border-left-style: solid;
  background-color: #f8f9fa;
  line-height: 1.5;
}

.mg-alert i {
  margin-right: 12px;
  font-size: 20px;
  margin-top: 2px;
}

.mg-alert p {
  margin: 0;
  flex: 1;
  font-size: 0.95em;
}

.mg-alert-warning {
  border-left-color: var(--system-warning);
  background-color: rgba(255, 193, 7, 0.1);
}

.mg-alert-warning i {
  color: var(--system-warning);
}

.mg-alert-danger {
  border-left-color: var(--system-danger);
  background-color: rgba(220, 53, 69, 0.1);
}

.mg-alert-danger i {
  color: var(--system-danger);
}

.mg-alert-success {
  border-left-color: var(--system-success);
  background-color: rgba(40, 167, 69, 0.1);
}

.mg-alert-success i {
  color: var(--system-success);
}

.mg-alert-info {
  border-left-color: var(--system-info);
  background-color: rgba(23, 162, 184, 0.1);
}

.mg-alert-info i {
  color: var(--system-info);
}

/* Estilos para inputs y formularios */
.mg-form-control {
  display: block;
  width: 100%;
  padding: var(--system-input-padding);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  color: #212529;
  background-color: #fff;
  background-clip: padding-box;
  border: 1px solid #ced4da;
  border-radius: var(--system-border-radius);
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.mg-form-control:focus {
  color: #212529;
  background-color: #fff;
  border-color: var(--system-primary);
  outline: 0;
  box-shadow: 0 0 0 0.25rem rgba(0, 123, 255, 0.25);
}

.mg-form-label {
  margin-bottom: 0.5rem;
  font-weight: 500;
  display: inline-block;
}

.mg-form-text {
  margin-top: 0.25rem;
  font-size: 0.875em;
  color: var(--system-secondary);
}

/* Estilos globales para páginas del sistema */
body {
  font-family: var(--system-font);
  margin: 0;
  padding: 0;
  background-color: var(--system-light);
}

h1, h2, h3 {
  margin: 10px 0;
}

/* Estilos para el footer con copyright */
.mg-system-footer {
  text-align: center;
  padding: 20px;
  margin-top: 40px;
  font-size: 14px;
  color: var(--system-secondary);
  background-color: #f8f9fa;
  border-top: 1px solid rgba(0,0,0,0.05);
}

.mg-system-footer small {
  display: block;
  margin-bottom: 5px;
}

.mg-system-footer img {
  height: 16px;
  width: auto;
  vertical-align: middle;
  margin: 0 2px;
}

.mg-system-footer a {
  color: var(--system-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.mg-system-footer a:hover {
  color: #004494;
}

.mG_invalid {
  border-color: var(--system-danger);
}
.mG_invalid:focus {
  border-color: var(--system-danger);
  box-shadow: 0 0 0 0.25rem rgba(220, 53, 69, 0.25);
}

/* Estilos modernos para páginas de error como 404 */
.mg-error-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 85vh;
  font-family: var(--system-font);
  background-color: var(--system-light);
  padding: 20px;
  box-sizing: border-box;
  text-align: center;
}

.mg-error-code {
  font-size: 120px;
  font-weight: 700;
  color: #f35b5b;
  margin: 0;
  line-height: 1;
  background: linear-gradient(45deg, var(--system-danger), var(--system-primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-fill-color: transparent;
}

.mg-error-title {
  font-size: 32px;
  font-weight: 600;
  color: var(--system-dark);
  margin: 10px 0;
}

.mg-error-message {
  font-size: 18px;
  color: var(--system-secondary);
  max-width: 500px;
  margin: 0 auto 30px;
  line-height: 1.5;
}

/* Botón para páginas de error, extiende mg-btn-primary */
.mg-error-button {
  /* Hereda propiedades base de mg-btn-primary */
  background-color: var(--system-primary); 
  color: var(--system-white);
  display: inline-block;
  text-decoration: none; 
  font-weight: 500; 
  transition: transform 0.2s ease;
  
  /* Personalizaciones específicas */
  padding: 12px 24px;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 86, 179, 0.2);
}

.mg-error-button:hover {
  transform: translateY(-2px);
  color: var(--system-white);
  background-color: var(--system-dark);
  box-shadow: 0 6px 8px rgba(0, 86, 179, 0.25);
}

.mg-error-illustration {
  width: 100%;
  max-width: 300px;
  margin-bottom: 30px;
}

/* Estilos para contenedores dinámicos genéricos */
.mg-content-dynamic {
  font-family: var(--system-font);
  padding: 2rem 0;
}

/* ---------------------------------- */
/* Estilos para secciones de checkout */
/* ---------------------------------- */
.mg-checkout-main {
  margin: 0 auto;
  max-width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
}

.mg-checkout-column {
  flex: 1;
  min-width: 280px;
}

.mg-checkout-data, 
.mg-checkout-pay {
  background-color: var(--system-white);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.mg-checkout-title {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 20px;
  /* background: linear-gradient(45deg, var(--system-primary), var(--system-info)); */
  background: linear-gradient(45deg, var(--system-danger), var(--system-primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-fill-color: transparent;
  display: inline-block;
}

.mg-checkout-aside {
  position: sticky;
  top: 20px;
  background-color: var(--system-white);
  border-radius: 8px;
  padding: 1.5rem;
  height: fit-content;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.mg-checkout-product {
  display: flex;
  align-items: center;
  padding-bottom: 15px;
  margin-bottom: 15px;
  border-bottom: 1px solid #f0f0f0;
}

.mg-checkout-product picture {
  position: relative;
  margin-right: 15px;
}

.mg-checkout-product picture img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 6px;
}

.mg-checkout-product picture span {
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--system-primary);
  color: var(--system-white);
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 600;
}

.mg-checkout-product section {
  display: flex;
  flex: 1;
  justify-content: space-between;
}

.mg-checkout-summary {
  list-style: none;
  padding: 0;
  margin: 0;
}

.mg-checkout-summary li {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  color: #555;
}

.mg-checkout-summary li:last-child {
  font-weight: 700;
  font-size: 1.2em;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #e9ecef;
  color: var(--system-dark);
}

/* --------------------- */
/* Estilos para facturas */
/* --------------------- */
.mg-container {
  max-width: 1200px;
  margin: 0 auto;
}

.mg-header {
  background-color: var(--system-dark);
  color: white;
  padding: 20px;
  margin-bottom: 30px;
  position: relative;
  overflow: hidden;
}

.mg-header::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--system-primary), var(--system-info));
}

.mg-logo {
  height: 50px;
  margin-right: 20px;
}

.mg-company-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mg-details {
  margin-left: 10px;
  display: flex;
  align-items: center;
  gap: 15px;
}

/* Título con degradado similar a páginas de error */
.mg-invoice-title {
  font-size: 32px;
  font-weight: 700;
  margin: 20px 0;
  /* background: linear-gradient(45deg, var(--system-primary), var(--system-info)); */
  background: linear-gradient(45deg, var(--system-danger), var(--system-primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-fill-color: transparent;
  display: inline-block;
}

.mg-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 30px;
  background-color: var(--system-white);
  border: none;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.mg-th {
  padding: 15px;
  text-align: left;
  background-color: #f8f9fa;
  color: var(--system-dark);
  font-weight: 600;
  font-size: 0.85em;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  border-bottom: 1px solid #e9ecef;
}

.mg-td {
  padding: 15px;
  text-align: left;
  border-bottom: 1px solid #f1f1f1;
  font-size: 0.95em;
}

.mg-table tbody tr:last-child .mg-td {
  border-bottom: none;
}

.mg-table tbody tr:nth-child(even) {
  background-color: #fcfcfc;
}

.mg-table tbody tr:hover {
  background-color: #f8f9fa;
}

.mg-receipt-info, 
.mg-payee-info {
  margin-bottom: 25px;
  padding-bottom: 15px;
}

.mg-receipt-info h3,
.mg-payee-info h3,
.mg-notes h3 {
  font-size: 1.1em;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--system-dark);
}

.mg-receipt-info p, 
.mg-payee-info p {
  margin: 8px 0;
  line-height: 1.6;
  color: #555;
  font-size: 0.95em;
}

.mg-receipt-info strong,
.mg-payee-info strong {
  font-weight: 600;
  color: var(--system-dark);
}

.mg-totals {
  text-align: right;
  margin-top: 30px;
  padding: 15px 20px;
  background-color: #f8f9fa;
  border-radius: 8px;
}

.mg-totals p {
  margin: 8px 0;
  font-weight: 500;
  color: #555;
}

.mg-totals p:last-child {
  font-size: 1.5em;
  font-weight: bold;
  color: var(--system-dark);
  padding-top: 10px;
  border-top: 1px solid #e9ecef;
  margin-top: 10px;
}

.mg-notes {
  margin-top: 30px;
  padding: 20px;
  background-color: #f8f9fa;
  border-radius: 8px;
  border-left: 4px solid var(--system-info);
  font-size: 0.95em;
  line-height: 1.6;
  color: #555;
}

/* ----------------- */
/* Estilos para blog */
/* ----------------- */
.mg-blog-title-container {
  background-color: var(--system-dark);
  color: white;
  padding: 40px 0;
  margin-bottom: 40px;
  position: relative;
  overflow: hidden;
}

.mg-article-container {
  padding: 2rem 0;
}

.mg-blog-title-container::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--system-primary), var(--system-info));
}

.mg-blog-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin: 0;
  text-align: center;
  background: linear-gradient(45deg, var(--system-white), #f8f9fa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-fill-color: transparent;
}

.mg-blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2.5rem;
  padding: 0 20px;
}

.mg-blog-card {
  background-color: var(--system-white);
  border: none;
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  position: relative;
}

.mg-blog-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.mg-card-image {
  height: 220px;
  overflow: hidden;
  position: relative;
}

.mg-img-link {
  display: block;
  width: 100%;
  height: 100%;
}

.mg-img-responsive {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.mg-blog-card:hover .mg-img-responsive {
  transform: scale(1.05);
}

.mg-card-body {
  padding: 2rem;
}

.mg-card-category {
  margin-bottom: 1rem;
}

.mg-card-category .mg-badge {
  background: linear-gradient(45deg, var(--system-primary), var(--system-info));
  color: var(--system-white);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.mg-card-title {
  font-size: 1.3rem;
  font-weight: 600;
  margin: 0 0 1rem 0;
  line-height: 1.4;
}

.mg-card-title a {
  color: var(--system-dark);
  text-decoration: none;
  transition: color 0.3s ease;
}

.mg-card-title a:hover {
  color: var(--system-primary);
}

.mg-card-meta {
  font-size: 0.85rem;
  color: var(--system-secondary);
  margin-bottom: 1rem;
  font-weight: 500;
}

.mg-card-excerpt {
  color: #555;
  margin-bottom: 1.5rem;
  line-height: 1.6;
  font-size: 0.95rem;
}

.mg-card-excerpt p {
  margin: 0;
}

.mg-btn-text {
  display: inline-flex;
  align-items: center;
  color: var(--system-primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  position: relative;
}

.mg-btn-text:hover {
  color: var(--system-dark);
  transform: translateX(4px);
}

.mg-btn-text::after {
  content: "\2192";
  margin-left: 8px;
  transition: transform 0.2s ease;
}

.mg-btn-text:hover::after {
  transform: translateX(4px);
}

/* Estilos para artículo individual */
.mg-article {
  max-width: 900px;
  margin: 0 auto;
  background-color: var(--system-white);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.mg-article-header {
  padding: 3rem 3rem 1rem 3rem;
  background: linear-gradient(135deg, #f8f9fa 0%, var(--system-white) 100%);
  border-bottom: 1px solid #f0f0f0;
}

.mg-article-title {
  font-size: 2.8rem;
  font-weight: 700;
  margin: 0 0 1.5rem 0;
  line-height: 1.2;
  background: linear-gradient(45deg, var(--system-dark), var(--system-primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-fill-color: transparent;
}

.mg-article-meta {
  font-size: 1rem;
  color: var(--system-secondary);
  margin-bottom: 1rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

.mg-article-meta::before {
  content: "📅";
  font-size: 0.9rem;
}

.mg-article-category {
  margin-bottom: 0;
}

.mg-article-category .mg-badge {
  background: linear-gradient(45deg, var(--system-primary), var(--system-info));
  color: var(--system-white);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.mg-article-image {
  margin: 0;
  height: 400px;
  overflow: hidden;
}

.mg-article-image .mg-img-responsive {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mg-article-content {
  padding: 3rem;
  line-height: 1.8;
  color: #444;
  font-size: 1.1rem;
}

.mg-article-content h1,
.mg-article-content h2,
.mg-article-content h3,
.mg-article-content h4,
.mg-article-content h5,
.mg-article-content h6 {
  color: var(--system-dark);
  font-weight: 600;
  margin: 2rem 0 1rem 0;
}

.mg-article-content p {
  margin-bottom: 1.5rem;
}

.mg-article-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 1.5rem 0;
}

.mg-article-content blockquote {
  border-left: 4px solid var(--system-primary);
  margin: 2rem 0;
  padding: 1rem 1.5rem;
  background-color: #f8f9fa;
  border-radius: 0 8px 8px 0;
  font-style: italic;
}

.mg-article-tags {
  margin: 0;
  padding: 2rem 3rem 3rem 3rem;
  border-top: 1px solid #f0f0f0;
  background-color: #fafafa;
}

.mg-article-tags strong {
  color: var(--system-dark);
  font-weight: 600;
  margin-bottom: 1rem;
  display: block;
}

.mg-tag {
  display: inline-block;
  padding: 8px 16px;
  background: linear-gradient(45deg, #f8f9fa, #e9ecef);
  color: var(--system-dark);
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  margin-right: 0.75rem;
  margin-bottom: 0.75rem;
  transition: all 0.2s ease;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.mg-tag:hover {
  background: linear-gradient(45deg, var(--system-primary), var(--system-info));
  color: var(--system-white);
  transform: translateY(-2px);
}

/* -------------------------------- */
/* Estilos para formularios dinámicos */
/* -------------------------------- */
.mg-form-container {
  padding: 2rem 0;
  font-family: var(--system-font);
  background-color: var(--system-light);
}

.mg-form {
  background-color: var(--system-white);
  border-radius: 12px;
  padding: 2.5rem;
  margin: 0 auto;
  max-width: 700px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.mg-form-title {
  font-size: 2.2rem;
  font-weight: 700;
  margin: 0 0 2rem 0;
  text-align: center;
  background: linear-gradient(45deg, var(--system-dark), var(--system-primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-fill-color: transparent;
  line-height: 1.3;
}

.mg-form-field {
  margin-bottom: 2rem;
}

.mg-form-field:last-of-type {
  margin-bottom: 2.5rem;
}

/* Campos de título y encabezado */
.mg-field-title {
  font-size: 1.8rem;
  font-weight: 700;
  margin: 2.5rem 0 1rem 0;
  color: var(--system-dark);
  border-bottom: 2px solid var(--system-primary);
  padding-bottom: 0.5rem;
}

.mg-field-title:first-child {
  margin-top: 0;
}

.mg-field-subtitle {
  margin: 0.5rem 0 1.5rem 0;
  color: var(--system-secondary);
  font-size: 1rem;
  line-height: 1.5;
}

.mg-field-header {
  font-size: 1.4rem;
  font-weight: 600;
  margin: 2rem 0 0.8rem 0;
  color: var(--system-dark);
  border-left: 4px solid var(--system-primary);
  padding-left: 1rem;
}

.mg-field-header:first-child {
  margin-top: 0;
}

.mg-field-subheader {
  margin: 0.5rem 0 1rem 0;
  color: var(--system-secondary);
  font-size: 0.95rem;
  line-height: 1.5;
  padding-left: 1rem;
}

.mg-field-text {
  padding: 1.5rem;
  background-color: #f8f9fa;
  border-radius: 8px;
  border-left: 4px solid var(--system-info);
  margin: 1rem 0;
}

.mg-field-text strong {
  color: var(--system-dark);
  font-weight: 600;
  display: block;
  margin-bottom: 0.5rem;
}

.mg-field-text p {
  margin: 0;
  color: var(--system-secondary);
  line-height: 1.6;
}

/* Labels y descripciones */
.mg-field-label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--system-dark);
  font-size: 1rem;
}

.mg-field-description {
  margin: 0.25rem 0 0.75rem 0;
  font-size: 0.9rem;
  color: var(--system-secondary);
  line-height: 1.4;
}

.mg-required {
  color: var(--system-danger);
  font-weight: 700;
  margin-left: 4px;
}

/* Inputs */
.mg-input {
  display: block;
  width: 100%;
  padding: 12px 16px;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  color: var(--system-dark);
  background-color: var(--system-white);
  background-clip: padding-box;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  transition: all 0.2s ease-in-out;
  font-family: var(--system-font);
}

.mg-input:focus {
  color: var(--system-dark);
  background-color: var(--system-white);
  border-color: var(--system-primary);
  outline: 0;
  box-shadow: 0 0 0 0.25rem rgba(0, 123, 255, 0.15);
}

.mg-input::placeholder {
  color: #adb5bd;
  opacity: 1;
}

/* Textarea */
.mg-textarea {
  display: block;
  width: 100%;
  padding: 12px 16px;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  color: var(--system-dark);
  background-color: var(--system-white);
  background-clip: padding-box;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  transition: all 0.2s ease-in-out;
  font-family: var(--system-font);
  min-height: 120px;
  resize: vertical;
}

.mg-textarea:focus {
  color: var(--system-dark);
  background-color: var(--system-white);
  border-color: var(--system-primary);
  outline: 0;
  box-shadow: 0 0 0 0.25rem rgba(0, 123, 255, 0.15);
}

.mg-textarea::placeholder {
  color: #adb5bd;
  opacity: 1;
}

/* Select */
.mg-select {
  display: block;
  width: 100%;
  padding: 12px 16px;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  color: var(--system-dark);
  background-color: var(--system-white);
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 16px 12px;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  transition: all 0.2s ease-in-out;
  appearance: none;
  font-family: var(--system-font);
  cursor: pointer;
}

.mg-select:focus {
  border-color: var(--system-primary);
  outline: 0;
  box-shadow: 0 0 0 0.25rem rgba(0, 123, 255, 0.15);
}

/* Radio buttons */
.mg-radio-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.mg-radio-option {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background-color: #f8f9fa;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.mg-radio-option:hover {
  background-color: #e9ecef;
  border-color: var(--system-primary);
}

.mg-radio-option input[type="radio"] {
  width: 18px;
  height: 18px;
  margin: 0 12px 0 0;
  accent-color: var(--system-primary);
  cursor: pointer;
}

.mg-radio-option label {
  margin: 0;
  cursor: pointer;
  flex: 1;
  font-weight: 500;
  color: var(--system-dark);
}

.mg-radio-option:has(input:checked) {
  background-color: rgba(0, 123, 255, 0.1);
  border-color: var(--system-primary);
}

/* Checkboxes */
.mg-checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.mg-checkbox-option {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background-color: #f8f9fa;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.mg-checkbox-option:hover {
  background-color: #e9ecef;
  border-color: var(--system-primary);
}

.mg-checkbox-option input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0 12px 0 0;
  accent-color: var(--system-primary);
  cursor: pointer;
}

.mg-checkbox-option label {
  margin: 0;
  cursor: pointer;
  flex: 1;
  font-weight: 500;
  color: var(--system-dark);
}

.mg-checkbox-option:has(input:checked) {
  background-color: rgba(0, 123, 255, 0.1);
  border-color: var(--system-primary);
}

/* Acciones del formulario */
.mg-form-actions {
  text-align: center;
  padding-top: 1.5rem;
  border-top: 1px solid #e9ecef;
  margin-top: 2rem;
}
.mg-form-actions .mg-btn-primary {
  padding: 14px 32px;
  font-size: 1.1rem;
  font-weight: 600;
  min-width: 180px;
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}
.mg-form-actions .mg-btn-primary i {
  margin-right: 8px;
}
.mg-form-actions .mg-btn-primary:hover {
  box-shadow: 0 6px 16px rgba(0, 123, 255, 0.4);
}

/* Estados de validación */
.mg-input.mg-invalid,
.mg-textarea.mg-invalid,
.mg-select.mg-invalid {
  border-color: var(--system-danger);
}

.mg-input.mg-invalid:focus,
.mg-textarea.mg-invalid:focus,
.mg-select.mg-invalid:focus {
  border-color: var(--system-danger);
  box-shadow: 0 0 0 0.25rem rgba(220, 53, 69, 0.25);
}

/* ---------- */
/* Responsive */
/* ---------- */
@media (max-width: 768px) {
  .mg-error-code {
    font-size: 80px;
  }
  
  .mg-error-title {
    font-size: 24px;
  }
  
  .mg-error-message {
    font-size: 16px;
  }
  
  .mg-checkout-main {
    width: 100%;
  }

  .mg-company-info {
    flex-direction: column;
    align-items: flex-start;
  }

  .mg-logo {
    margin-bottom: 10px;
  }

  .mg-table {
    font-size: 0.9em;
  }

  .mg-th, .mg-td {
    padding: 8px 6px;
  }

  /* Blog responsive */
  .mg-blog-title-container {
    padding: 30px 0;
    margin-bottom: 30px;
  }
  
  .mg-blog-title {
    font-size: 2rem;
  }
  
  .mg-blog-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 0 15px;
  }
  
  .mg-blog-card {
    border-radius: 12px;
  }
  
  .mg-card-image {
    height: 180px;
  }
  
  .mg-card-body {
    padding: 1.5rem;
  }
  
  .mg-card-title {
    font-size: 1.1rem;
  }
  
  .mg-article {
    margin: 0 15px;
    border-radius: 12px;
  }
  
  .mg-article-header {
    padding: 2rem 1.5rem 1rem 1.5rem;
  }
  
  .mg-article-title {
    font-size: 2rem;
    line-height: 1.3;
  }
  
  .mg-article-image {
    height: 250px;
  }
  
  .mg-article-content {
    padding: 2rem 1.5rem;
    font-size: 1rem;
  }
  
  .mg-article-tags {
    padding: 1.5rem;
  }
  
  .mg-tag {
    padding: 6px 12px;
    font-size: 0.8rem;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
  }
  
  /* Formularios responsive */
  .mg-form-container {
    padding: 1rem 0;
  }
  
  .mg-form {
    margin: 0 15px;
    padding: 1.5rem;
    border-radius: 8px;
  }
  
  .mg-form-title {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
  }
  
  .mg-field-title {
    font-size: 1.4rem;
    margin: 2rem 0 0.8rem 0;
  }
  
  .mg-field-header {
    font-size: 1.2rem;
    margin: 1.5rem 0 0.6rem 0;
  }
  
  .mg-form-actions .mg-btn-primary {
    width: 100%;
    padding: 16px 24px;
    font-size: 1rem;
  }
  
  .mg-radio-group,
  .mg-checkbox-group {
    gap: 0.5rem;
  }
  
  .mg-radio-option,
  .mg-checkbox-option {
    padding: 10px 12px;
  }
} 