:root {
  --primary-dark: #1a2a3a;
  --accent-red: #e74c3c;
  --bg-light: #f4f6f8;
  --border-color: #eee;
}

.course-page {
  padding: 40px 20px;
  background: #fff;
}

.hero-course {
  background:
    linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.4)),
    url("../..//assets/brigadista-contra-incendios.jpg");

  background-size: cover;
  background-position: center;
  color: white;
  padding: 60px 20px;
  border-radius: 8px;
  margin-bottom: 40px;
  border-left: 10px solid var(--accent-red);
}
.hero-course h1 {
  font-size: 2.5rem;
  margin-bottom: 15px;
  line-height: 1.2;
}
.hero-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 15px;
}
.tag-sincronico {
  background: var(--accent-red);
  color: #fff;
  padding: 5px 15px;
  border-radius: 4px;
  font-weight: bold;
  font-size: 0.8rem;
  text-transform: uppercase;
}
.tag-incripcion-abierta {
  background: #2ecc71;
  color: #fff;
  padding: 5px 15px;
  border-radius: 4px;
  font-weight: bold;
  font-size: 0.8rem;
  text-transform: uppercase;
}
.grid-container {
  display: grid;
  grid-template-columns: 1fr 350px;
  gap: 40px;
}

.section-card {
  margin-bottom: 40px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 20px;
}
.section-card h2 {
  color: var(--primary-dark);
  margin-bottom: 20px;
  font-size: 1.6rem;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 2px solid var(--accent-red);
  padding-bottom: 5px;
  width: fit-content;
}

.enrollment-section {
  background: #f8fafb;
  border: 1px solid #e0e5e8;
  border-bottom: 1px solid #e0e5e8;
  border-radius: 8px;
  padding: 28px;
}
.enrollment-form {
  margin: 24px 0;
  padding: 24px;
  border: 1px solid #d7dde1;
  border-radius: 6px;
  background: #fff;
}
.form-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 20px;
}
.form-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.form-field label,
.choice-group legend {
  color: var(--primary-dark);
  font-weight: bold;
}
.form-field label span,
.choice-group legend span {
  color: var(--accent-red);
}
.form-field input {
  width: 100%;
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid #cbd3d8;
  border-radius: 4px;
  color: #333;
  font: inherit;
  background: #fff;
}
.form-field input:focus {
  outline: 2px solid rgba(231, 76, 60, 0.25);
  border-color: var(--accent-red);
}
.choice-group {
  display: grid;
  gap: 11px;
  margin: 26px 0 0;
  padding: 18px;
  border: 1px solid #e0e5e8;
  border-radius: 5px;
}
.choice-group legend {
  padding: 0 6px;
  line-height: 1.4;
}
.choice-group label {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: #444;
  line-height: 1.45;
  cursor: pointer;
}
.choice-group input[type="radio"] {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  margin: 2px 0 0;
  accent-color: var(--accent-red);
}
.choice-group-inline {
  display: flex;
  flex-wrap: wrap;
  column-gap: 28px;
}
.choice-group-inline legend {
  flex: 0 0 100%;
}
.enrollment-form .btn-next {
  margin-top: 26px;
}
.btn-next,
.payment-option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 100%;
  min-height: 50px;
  padding: 12px 20px;
  border: 0;
  border-radius: 5px;
  color: #fff;
  font: inherit;
  font-weight: bold;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
.btn-next {
  background: var(--accent-red);
}
.btn-next:hover {
  background: #c0392b;
}
.btn-next.is-loading {
  gap: 10px;
  cursor: wait;
  opacity: 0.85;
}
.btn-next.is-loading::before {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  border-radius: 50%;
  content: "";
  animation: form-spinner 0.75s linear infinite;
}
@keyframes form-spinner {
  to {
    transform: rotate(360deg);
  }
}
.payment-step {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid #d7dde1;
}
.total-box {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  max-width: 420px;
  margin-bottom: 20px;
  color: var(--primary-dark);
}
.total-box strong {
  font-size: 1.8rem;
  color: var(--accent-red);
}
.payment-prompt {
  margin-bottom: 12px;
  font-weight: bold;
}
.payment-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.transfer-option {
  background: var(--primary-dark);
}
.mercado-option {
  background: #009ee3;
}
.transfer-option:hover {
  background: #253d54;
}
.mercado-option:hover {
  background: #0089c8;
}
.payment-help {
  margin: 12px 0 0;
  color: #666;
  font-size: 0.9rem;
}
.payment-help a {
  color: var(--primary-dark);
  font-weight: bold;
}
.transfer-details {
  max-width: 560px;
  margin-top: 24px;
  padding: 20px;
  border-left: 5px solid #f0ad4e;
  background: #fff3cd;
  color: #594a22;
}
.transfer-details h3 {
  margin: 0 0 14px;
  color: var(--primary-dark);
}
.transfer-details p {
  margin: 7px 0;
}
.transfer-details .placeholder-note {
  margin-top: 16px;
  font-size: 0.85rem;
  font-style: italic;
}
.receipt-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  padding: 11px 16px;
  border-radius: 5px;
  background: #25d366;
  color: #fff;
  font-weight: bold;
  text-decoration: none;
  transition:
    background-color 0.2s ease,
    transform 0.2s ease;
}
.receipt-button:hover {
  background: #1fba5c;
  color: #fff;
  transform: translateY(-1px);
}
.receipt-button img {
  display: block;
}
.receipt-instructions {
  max-width: 560px;
  margin: 14px 0 0;
  font-size: 0.9rem;
  line-height: 1.5;
}
.receipt-instructions a {
  color: var(--primary-dark);
  font-weight: bold;
}

.description-box {
  line-height: 1.6;
  color: #444;
  margin-bottom: 30px;
}
.description-box p {
  margin-bottom: 15px;
}

.cronograma-section {
  margin-bottom: 20px;
}
.cronograma-list {
  list-style: disc;
  list-style-position: inside;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 6px;
}
.cronograma-list li {
  padding: 4px 0 4px 18px;
  color: var(--primary-dark);
  font-size: 0.95rem;
  line-height: 1.5;
}

.highlights-list {
  background: #fff8f7;
  border: 1px solid #ffe4e1;
  padding: 20px;
  border-radius: 8px;
  margin: 20px 0;
}
.highlights-list ul {
  list-style: none;
  padding: 0;
}
.highlights-list li {
  margin-bottom: 10px;
  position: relative;
  padding-left: 25px;
}
.highlights-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--accent-red);
  font-weight: bold;
}

.temario-clase {
  background: #f9f9f9;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 20px;
  border: 1px solid var(--border-color);
}
.temario-clase h4 {
  color: var(--accent-red);
  margin-bottom: 12px;
  border-bottom: 1px solid #ddd;
  padding-bottom: 5px;
  font-size: 1.1rem;
}
.temario-clase ul {
  list-style: none;
  padding-left: 0;
}
.temario-clase ul li {
  padding: 6px 0;
  position: relative;
  padding-left: 20px;
  font-size: 0.95rem;
  line-height: 1.4;
}
.temario-clase ul li::before {
  content: "■";
  position: absolute;
  left: 0;
  color: var(--primary-dark);
  font-size: 0.7rem;
  top: 8px;
}

.sidebar-info {
  background: var(--bg-light);
  padding: 25px;
  border-radius: 8px;
  position: sticky;
  top: 10px;
  align-self: start;
  border: 1px solid #e0e0e0;
}
.info-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid #ddd;
  font-size: 0.95rem;
}
.info-row strong {
  color: var(--primary-dark);
}

.inscription-box {
  margin-top: 25px;
  text-align: center;
}
.btn-payment {
  background: #009ee3;
  color: white;
  padding: 12px;
  border-radius: 5px;
  display: block;
  margin-top: 10px;
  font-weight: bold;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 0.25s ease,
    background-color 0.25s ease,
    box-shadow 0.25s ease;
  transform: translateY(0) scale(1);
}
.btn-payment:hover {
  background-color: #0089c8;
  transform: translateY(0) scale(1.02);
  box-shadow: 0 6px 18px rgba(0, 158, 227, 0.28);
}
.btn-primary {
  background: #25d366;
  color: white;
  padding: 12px;
  border-radius: 5px;
  display: block;
  font-weight: bold;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 0.25s ease,
    background-color 0.25s ease,
    box-shadow 0.25s ease;
  transform: translateY(0) scale(1);
}
.btn-primary:hover {
  background-color: #1fba5c;
  transform: translateY(0) scale(1.02);
  box-shadow: 0 6px 18px rgba(37, 211, 102, 0.28);
}

.note-box {
  background: #fff3cd;
  border: 1px solid #ffeeba;
  padding: 15px;
  border-radius: 8px;
  font-size: 0.85rem;
  margin-top: 20px;
  color: #856404;
}

.eval-box {
  background: #e3f2fd;
  padding: 25px;
  border-radius: 8px;
  border-left: 6px solid #1976d2;
}
.qr-mock {
  width: 80px;
  height: 80px;
  background: #eee;
  position: absolute;
  bottom: 20px;
  right: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  border: 1px solid #ccc;
}

@media (max-width: 992px) {
  .grid-container {
    display: grid; /* Asegura que mantenga el comportamiento de grid */
    grid-template-columns: 1fr;
  }

  .sidebar-info {
    position: static;
  }

  /* Nuevas reglas para invertir el orden en mobile */
  .main-content {
    order: 2; /* Pasa a estar en segundo lugar */
  }

  .sidebar {
    order: 1; /* Sube al primer lugar */
  }
}

@media (max-width: 600px) {
  .enrollment-section {
    padding: 20px 16px;
  }
  .enrollment-form {
    padding: 18px 14px;
  }
  .form-fields {
    grid-template-columns: 1fr;
  }
  .payment-options {
    grid-template-columns: 1fr;
  }
  .payment-option,
  .btn-next {
    width: 100%;
  }
  .total-box {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
}
