/* ── Course Enrollment Modal ── */
:root {
  --ces-primary: #004D83;
  --ces-primary-dark: #003d6b;
  --ces-accent: #DA2B6B;
  --ces-accent-dark: #C4366F;
  --ces-bg: #fff;
  --ces-border: #e5e7eb;
  --ces-text: #111827;
  --ces-muted: #6b7280;
  --ces-radius: 14px;
  --ces-shadow: 0 25px 60px rgba(0, 0, 0, .22);
}

/* Overlay */
.ces-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .6);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  backdrop-filter: blur(4px);
  animation: cesOvIn .25s ease both;
}

.ces-overlay[hidden] {
  display: none !important;
}

@keyframes cesOvIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* Modal box */
.ces-modal {
  background: var(--ces-bg);
  border-radius: var(--ces-radius);
  box-shadow: var(--ces-shadow);
  width: 100%;
  max-width: 520px;
  max-height: 92vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  animation: cesMdIn .3s cubic-bezier(.4, 0, .2, 1) both;
}

@keyframes cesMdIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(.97);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

/* Close */
.ces-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: #f3f4f6;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  color: var(--ces-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s, color .2s;
  z-index: 2;
}

.ces-close:hover {
  background: #fee2e2;
  color: #ef4444;
}

/* Header */
.ces-modal-header {
  background: linear-gradient(135deg, var(--ces-primary) 0%, var(--ces-primary-dark) 100%);
  padding: 22px 24px 18px;
  flex-shrink: 0;
  color: #fff;
}

.ces-modal-header h2 {
  font-size: 19px;
  font-weight: 700;
  margin: 0 0 14px;
  color: #fff;
  font-family: 'Poppins', sans-serif;
}

/* Progress */
.ces-progress-bar {
  height: 4px;
  background: rgba(255, 255, 255, .25);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 10px;
}

.ces-progress-fill {
  height: 100%;
  background: #fff;
  border-radius: 99px;
  transition: width .4s cubic-bezier(.4, 0, .2, 1);
  width: 14.28%;
}

.ces-steps-dots {
  display: flex;
  gap: 5px;
}

.ces-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .25);
  color: rgba(255, 255, 255, .7);
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s, color .2s;
  flex-shrink: 0;
}

.ces-dot.active {
  background: #fff;
  color: var(--ces-primary);
}

.ces-dot.done {
  background: rgba(255, 255, 255, .5);
  color: #fff;
}

/* Body */
.ces-modal-body {
  overflow-y: auto;
  flex: 1;
}

/* Steps */
.ces-step {
  padding: 26px 26px 22px;
  animation: cesStIn .28s ease both;
}

.ces-step[hidden] {
  display: none !important;
}

@keyframes cesStIn {
  from {
    opacity: 0;
    transform: translateX(16px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.ces-step-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--ces-text);
  margin: 0 0 3px;
  font-family: 'Poppins', sans-serif;
}

.ces-step-sub {
  font-size: 13px;
  color: var(--ces-muted);
  margin: 0 0 18px;
}

/* Fields */
.ces-field {
  margin-bottom: 16px;
}

.ces-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ces-text);
  margin-bottom: 5px;
}

.ces-field label .req {
  color: #ef4444;
}

.ces-field input {
  width: 100%;
  box-sizing: border-box;
  border: 1.5px solid var(--ces-border);
  border-radius: 8px;
  padding: 10px 13px;
  font-size: 14px;
  color: var(--ces-text);
  outline: none;
  transition: border .2s, box-shadow .2s;
  font-family: 'Poppins', sans-serif;
}

.ces-field input:focus {
  border-color: var(--ces-primary);
  box-shadow: 0 0 0 3px rgba(0, 77, 131, .12);
}

.ces-err {
  display: block;
  font-size: 11px;
  color: #ef4444;
  margin-top: 3px;
  min-height: 15px;
}

/* Selection cards */
.ces-card-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.ces-card-grid .ces-sel-card {
    display: flex;
    align-items: center;
    justify-content: center;
} 
.ces-sel-card {
  flex: 1 1 calc(50% - 5px);
  min-width: 120px;
  border: 1.5px solid var(--ces-border);
  border-radius: 8px;
  padding: 12px 14px;
  cursor: pointer;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  color: var(--ces-text);
  transition: border .2s, background .2s, box-shadow .2s;
  font-family: 'Poppins', sans-serif;
  user-select: none;
}

.ces-sel-card:hover {
  border-color: var(--ces-primary);
  background: #eff6ff;
}

.ces-sel-card.selected {
  border-color: var(--ces-primary);
  background: #eff6ff;
  box-shadow: 0 0 0 3px rgba(0, 77, 131, .1);
}

.ces-icon-grid .ces-sel-card {
  flex: 1 1 calc(50% - 5px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.ces-card-icon {
  font-size: 24px;
}

/* Course list */
.ces-course-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ces-course-card {
  border: 1.5px solid var(--ces-border);
  border-radius: 8px;
  padding: 12px 16px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: border .2s, background .2s;
  font-family: 'Poppins', sans-serif;
}

.ces-course-card:hover {
  border-color: var(--ces-primary);
  background: #eff6ff;
}

.ces-course-card.selected {
  border-color: var(--ces-primary);
  background: #eff6ff;
  box-shadow: 0 0 0 3px rgba(0, 77, 131, .1);
}

.ces-course-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--ces-text);
}

.ces-course-price {
  font-size: 13px;
  font-weight: 700;
  color: var(--ces-primary);
}

/* Pricing */
.ces-pricing-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 4px 0;
}

.ces-price-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  border: none;
  border-radius: 8px;
  padding: 16px 20px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .18s, box-shadow .18s;
  font-family: 'Poppins', sans-serif;
}

.ces-price-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .15);
}

.ces-eb-btn {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
}

.ces-norm-btn {
  background: linear-gradient(135deg, var(--ces-primary), var(--ces-primary-dark));
  color: #fff;
}

.btn-price {
  font-size: 18px;
  font-weight: 800;
}

.ces-pricing-note {
  font-size: 12px;
  color: var(--ces-muted);
  margin: 0;
}

/* Nav */
.ces-nav {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.ces-btn-next,
.ces-btn-back {
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  font-weight: 600;
  padding: 11px 22px;
  border-radius: 8px;
  cursor: pointer;
  border: none;
}

.ces-btn-next {
  background: var(--ces-primary);
  color: #fff;
  flex: 1;
}

.ces-btn-next:hover {
  background: var(--ces-primary-dark);
}

.ces-btn-back {
  background: #f3f4f6;
  color: var(--ces-muted);
  flex-shrink: 0;
}

.ces-btn-back:hover {
  background: var(--ces-border);
  color: var(--ces-text);
}

/* Step 1 next (full width) */
.ces-step[data-step="1"] .ces-btn-next {
  width: 100%;
}

/* Processing */
.ces-processing {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 60px 26px;
  text-align: center;
}

.ces-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--ces-border);
  border-top-color: var(--ces-primary);
  border-radius: 50%;
  animation: cesSpin .8s linear infinite;
  margin-bottom: 20px;
}

@keyframes cesSpin {
  to {
    transform: rotate(360deg);
  }
}

/* Enroll button on page */
.ces-enroll-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: linear-gradient(135deg, var(--ces-primary), var(--ces-primary-dark));
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
  font-family: 'Poppins', sans-serif;
}

.ces-enroll-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 77, 131, .3);
}

.ces-empty {
  color: var(--ces-muted);
  font-size: 13px;
  text-align: center;
  padding: 20px 0;
}

/* Mobile */
@media (max-width:540px) {
  .ces-modal {
    max-height: 100vh;
    border-radius: 0;
  }

  .ces-overlay {
    padding: 0;
    align-items: flex-end;
  }

  .ces-step {
    padding: 18px 16px;
  }

  .ces-sel-card {
    flex: 1 1 100%;
  }
}

/* ── Duration cards ── */
.ces-duration-card {
  flex: 1 1 calc(33% - 8px);
  min-width: 110px;
  border: 1.5px solid var(--ces-border);
  border-radius: 8px;
  padding: 14px 12px;
  cursor: pointer;
  text-align: center;
  transition: border .2s, background .2s, box-shadow .2s;
  font-family: 'Poppins', sans-serif;
  user-select: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ces-duration-card:hover {
  border-color: var(--ces-primary);
  background: #eff6ff;
}

.ces-duration-card.selected {
  border-color: var(--ces-primary);
  background: #eff6ff;
  box-shadow: 0 0 0 3px rgba(0, 77, 131, .1);
}

.dur-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--ces-text);
}

.dur-price {
  font-size: 12px;
  font-weight: 500;
  color: var(--ces-primary);
}

/* ── Course summary box ── */
.ces-course-summary {
  background: #f0f4ff;
  border: 1.5px solid #c7d4f5;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 16px;
}

.ces-summary-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--ces-primary);
  font-family: 'Poppins', sans-serif;
}

.ces-summary-meta {
  font-size: 12px;
  color: var(--ces-muted);
  margin-top: 3px;
  font-family: 'Poppins', sans-serif;
}

/* ── Price buttons (updated with sub-label) ── */
.ces-price-btn {
  display: flex;
  flex-direction: column;
  width: 100%;
  border: none;
  border-radius: 10px;
  padding: 16px 20px;
  cursor: pointer;
  transition: transform .18s, box-shadow .18s;
  font-family: 'Poppins', sans-serif;
  gap: 4px;
  text-align: left;
}

.ces-price-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
}

.ces-price-btn:active {
  transform: translateY(0);
}

.btn-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.btn-label {
  font-size: 15px;
  font-weight: 700;
}

.btn-price {
  font-size: 20px;
  font-weight: 800;
}

.btn-sub {
  font-size: 11px;
  opacity: .8;
  font-weight: 400;
}

.ces-eb-btn {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
}

.ces-norm-btn {
  background: linear-gradient(135deg, var(--ces-primary), var(--ces-primary-dark));
  color: #fff;
}

/* ── Pricing summary name line ── */
.ces-summary-name {
  font-size: 12px;
  color: var(--ces-muted);
  margin-top: 2px;
  font-family: 'Poppins', sans-serif;
}

/* ── Back button: disabled appearance when JS hides it ── */
.ces-btn-back[style*="display:none"] {
  display: none !important;
}

/* ── Step 1 nav: full-width next since no back ── */
.ces-step[data-step="1"] .ces-nav {
  display: block;
}

.ces-step[data-step="1"] .ces-btn-next {
  width: 100%;
}

/* ── Sessions note (Step 6) ── */
.ces-sessions-hint {
  font-size: 11px;
  font-weight: 400;
  color: var(--ces-muted);
}

.ces-sessions-note {
  font-size: 12px;
  color: #92400e;
  background: #fef3c7;
  border: 1px solid #fcd34d;
  border-radius: 6px;
  padding: 8px 12px;
  margin-top: 6px;
}

#ces-sessions {
  max-width: 140px;
}