/* =============================================================================
   Licence wizard — shared layout (School Licence Setup + Rollover)
   ============================================================================= */
.licence-wizard-page {
  --lw-space-xs: 0.5rem;
  --lw-space-sm: 0.75rem;
  --lw-space-md: 1rem;
  --lw-space-lg: 1.5rem;
  --lw-space-xl: 2rem;
  --lw-card-padding: 1.5rem;
  --lw-card-radius: 1rem;
  --lw-notice-padding: 1.25rem;
  --lw-step-py: 2rem;
}

.licence-wizard-page .wizard-navigation {
  margin-bottom: var(--lw-space-lg) !important;
}

.licence-wizard-page .licence-wizard-step-inner {
  padding-top: var(--lw-step-py);
  padding-bottom: var(--lw-step-py);
}

.licence-wizard-page .licence-wizard-step-header {
  margin-bottom: var(--lw-space-lg);
}

.licence-wizard-page .licence-wizard-step-header h4,
.licence-wizard-page .licence-wizard-step-header h5 {
  margin-bottom: var(--lw-space-xs);
}

.licence-wizard-page .licence-wizard-section-title {
  margin-bottom: var(--lw-space-md);
}

.licence-wizard-page .licence-wizard-section-lead {
  margin-bottom: var(--lw-space-lg);
}

/* Vertical rhythm inside step columns */
.licence-wizard-page .licence-wizard-stack {
  display: flex;
  flex-direction: column;
  gap: var(--lw-space-lg);
}

.licence-wizard-page .licence-wizard-stack > .card,
.licence-wizard-page .licence-wizard-stack > .licence-wizard-notice,
.licence-wizard-page .licence-wizard-stack > .alert,
.licence-wizard-page .licence-wizard-stack > .mb-4,
.licence-wizard-page .licence-wizard-stack > .row,
.licence-wizard-page .licence-wizard-stack > .rollover-course-mapping-card {
  margin-bottom: 0 !important;
  margin-top: 0 !important;
}

.licence-wizard-page .licence-wizard-stack .card.mb-4,
.licence-wizard-page .col-md-12.licence-wizard-stack > .card.mb-4 {
  margin-bottom: 0 !important;
}

.licence-wizard-page .wizard-step .card.shadow,
.licence-wizard-page .wizard-step .card.shadow-sm,
.licence-wizard-page .wizard-step .card.shadow-lg,
.licence-wizard-page .wizard-step .card.border-0.shadow-lg {
  margin-bottom: var(--lw-space-lg);
  border-radius: var(--lw-card-radius) !important;
}

.licence-wizard-page .licence-wizard-step-inner > .licence-wizard-step-header,
.licence-wizard-page .licence-wizard-step-inner > .alert,
.licence-wizard-page .licence-wizard-step-inner > .card,
.licence-wizard-page .licence-wizard-step-inner > #course-containers-wrapper,
.licence-wizard-page .licence-wizard-step-inner > #student-class-cards {
  margin-bottom: var(--lw-space-lg);
}

.licence-wizard-page .licence-wizard-step-inner > *:last-child {
  margin-bottom: 0 !important;
}

.licence-wizard-page .wizard-step .card.p-4,
.licence-wizard-page .wizard-step .card > .card-body,
.licence-wizard-page .sticky-summary .card > .card-body {
  padding: var(--lw-card-padding);
}

.licence-wizard-page .wizard-step .card .card.shadow-sm.p-3 {
  padding: var(--lw-space-md) !important;
  margin-top: var(--lw-space-md);
  margin-bottom: 0;
}

.licence-wizard-page .licence-wizard-notice,
.licence-wizard-page .wizard-step .border-start.border-5,
.licence-wizard-page .wizard-step .alert.rounded-4 {
  padding: var(--lw-notice-padding) !important;
  margin-bottom: var(--lw-space-md) !important;
  border-radius: var(--lw-card-radius) !important;
}

.licence-wizard-page .wizard-step .card > .bg-warning.border-warning.bg-opacity-10.rounded-3,
.licence-wizard-page .wizard-step .card > .bg-warning.border-warning.bg-opacity-10.rounded-3.p-4 {
  padding: var(--lw-notice-padding) !important;
}

.licence-wizard-page .wizard-step .form-label {
  margin-bottom: 0.35rem;
}

.licence-wizard-page .wizard-step .card .mb-3:last-child {
  margin-bottom: 0 !important;
}

.licence-wizard-page .licence-wizard-actions {
  margin-top: var(--lw-space-lg) !important;
  padding-top: var(--lw-space-md) !important;
  padding-bottom: var(--lw-space-xl) !important;
  gap: var(--lw-space-md);
}

.licence-wizard-page .sticky-summary {
  display: flex;
  flex-direction: column;
  gap: var(--lw-space-lg);
}

.licence-wizard-page .sticky-summary > .card,
.licence-wizard-page .sticky-summary > .licence-wizard-notice,
.licence-wizard-page .sticky-summary > #student-breakdown-card {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

.licence-wizard-page #student-cost-note {
  margin: 0 !important;
}

.licence-wizard-page .course-sharing-wrapper,
.licence-wizard-page .course-sharing-container {
  padding: var(--lw-card-padding);
  margin-bottom: var(--lw-space-lg);
  border-radius: var(--lw-card-radius);
}

.licence-wizard-page .group-card {
  padding: var(--lw-card-padding);
  margin-bottom: var(--lw-space-md);
}

.licence-wizard-page .student-class-card .card-body {
  padding: var(--lw-card-padding);
}

.wizard-scroll { height: 100%; overflow-y: auto; padding-right: 10px; }
.sticky-summary { position: sticky; top: 100px; }
.selectable-card { cursor: pointer; transition: all 0.2s ease; border: 2px solid transparent; }
.selectable-card:hover { border-color: #198754; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.licence-option.border-success { border: 3px solid #198754 !important; background: linear-gradient(145deg, #e6f4ea, #d4edda) !important; }
.wizard-navigation { position: relative; padding: 0 20px; }
.wizard-step-circle { flex: 0 0 auto; text-align: center; }
.step-circle { transition: all 0.3s ease; }
.group-box { transition: all 0.3s ease; }
.class-item { cursor: grab; user-select: none; }
.separate-area { min-height: 60px; transition: all 0.2s; }
.invalid-feedback { display: none; }
.is-invalid ~ .invalid-feedback, .is-invalid + .invalid-feedback { display: block; }
@media (max-width: 768px) { .wizard-navigation small { display: none !important; } .wizard-step-circle { flex: 1; } }
.course-sharing-wrapper { background:#f7f8f6; padding:30px; border-radius:24px; border:1px solid #e0e4e1; }
.group-card { padding:25px; border-radius:20px; margin-bottom:20px; position:relative; }
.group-blue { background:#e8f1fb; border:2px solid #b6d1f3; }
.group-purple { background:#f0eaff; border:2px solid #d3c6ff; }
.group-label { padding:8px 18px; border-radius:12px; font-weight:600; color:white; }
.label-blue { background:#3f7ad6; }
.label-purple { background:#7e5bef; }
.class-pill { background:white; border:2px solid #c8d7ec; padding:10px 18px; border-radius:14px; display:inline-flex; gap:8px; }
.ungrouped-box { border:2px dashed #cdd7d2; padding:30px; border-radius:20px; }
.summary-box { background:#e3f0ea; padding:20px; border-radius:16px; font-weight:600; color:#2f6f58; }
/* Manual Grouping Styles */
.course-sharing-wrapper {
    background: #f7f8f6;
    padding: 30px;
    border-radius: 24px;
    border: 1px solid #e0e4e1;
}

.group-card {
    padding: 25px;
    border-radius: 20px;
    margin-bottom: 20px;
    position: relative;
    transition: all 0.3s ease;
}

.group-blue {
    background: #e8f1fb;
    border: 2px solid #b6d1f3;
}

.group-purple {
    background: #f0eaff;
    border: 2px solid #d3c6ff;
}

.group-label {
    padding: 8px 18px;
    border-radius: 12px;
    font-weight: 600;
    color: white;
}

/* Student Course Sharing specific styles */
#student-sharing-container .course-sharing-container {
    background: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 24px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

#student-sharing-container .course-sharing-container:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

#student-sharing-container .course-summary {
    background: #efe9ff;
    color: #6f42c1;
}

#student-sharing-container .class-badge {
    font-size: 0.9rem;
}

/* Ensure student badges show full information */
.student-class-info {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.student-class-info .class-name {
    font-weight: 600;
}

.student-class-info .class-details {
    font-size: 0.8rem;
    color: #6c757d;
}

/* Animation for new groups */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.group-card {
    animation: slideIn 0.3s ease;
}
/* Per-Course Grouping Styles */
.course-sharing-container {
    background: #ffffff;        /* Fresh Milk */
    border: 1px solid #e5e5e5;
    border-radius: 24px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.course-sharing-container:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.available-pool {
    background: #f0f2f0;
    border: 2px dashed #c8d4ce;
    border-radius: 12px;
    padding: 15px;
    min-height: 60px;
    transition: all 0.3s ease;
}

.available-pool:hover {
    border-color: #3f7ad6;
    background: #e8f0fe;
}

.class-badge {
    background: white;
    border: 2px solid #c8d7ec;
    border-radius: 14px;
    padding: 10px 18px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: grab;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: all 0.2s ease;
}

.class-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    border-color: #3f7ad6;
}

.class-badge:active {
    cursor: grabbing;
}

.group-card {
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 20px;
    position: relative;
    transition: all 0.3s ease;
}

.group-drop-area {
    min-height: 60px;
    border-radius: 12px;
    background: rgba(255,255,255,0.5);
    padding: 15px;
    transition: all 0.3s ease;
}

.group-drop-area:empty::before {
    content: 'Drag classes here to group them';
    color: #6c757d;
    font-style: italic;
    width: 100%;
    text-align: center;
    display: block;
    padding: 20px;
}

.separate-copies-box {
    border: 2px dashed #cdd7d2;
    background: #fafbfa;
    border-radius: 20px;
    padding: 25px;
    transition: all 0.3s ease;
}

.separate-copies-box:has(.class-badge) {
    border-color: #6c757d;
    background: #f8f9fa;
}

.separate-area {
    min-height: 60px;
}

.separate-area:empty::before {
    content: 'Drag classes here for separate copies';
    color: #adb5bd;
    font-style: italic;
    width: 100%;
    text-align: center;
    display: block;
    padding: 20px;
}

.course-summary {
    background: #e3f0ea;
    color: #2f6f58;
    border-radius: 16px;
    padding: 20px;
    font-weight: 600;
}

/* SortableJS specific */
.sortable-ghost {
    opacity: 0.4;
    background: #e9ecef;
    border: 2px dashed #adb5bd;
}

.sortable-drag {
    opacity: 0.9;
    transform: scale(1.05);
    box-shadow: 0 8px 16px rgba(0,0,0,0.15);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .course-sharing-container {
        padding: 20px;
    }

    .group-card {
        padding: 15px;
    }
}



/* Remove button hover effect */
.btn-remove-class {
    opacity: 0.7;
    transition: opacity 0.2s;
}

.btn-remove-class:hover {
    opacity: 1;
}

/* Empty message styling */
#empty-msg {
    display: block;
    padding: 20px;
    text-align: center;
    width: 100%;
}

/* Group drop area empty state */
.group-drop-area:empty::before {
    content: 'Drag classes here';
    color: #6c757d;
    font-style: italic;
    display: block;
    text-align: center;
    padding: 20px;
    width: 100%;
}

/* Separate area empty state */
.separate-area:empty::before {
    content: 'Drag classes here for separate copies';
    color: #adb5bd;
    font-style: italic;
    display: block;
    text-align: center;
    padding: 20px;
    width: 100%;
}

#student-breakdown-card .card-body {
    padding: 1.25rem;
}

#student-breakdown-list > div {
    padding: 0.5rem 0;
    border-bottom: 1px solid #f0f0f0;
}

#student-breakdown-list > div:last-child {
    border-bottom: none;
    margin-bottom: 0 !important;
}

#payment-processing-modal {
    z-index: 9999 !important;
}

#payment-processing-modal .modal-backdrop {
    z-index: 9998 !important;
    opacity: 0.5 !important;
}

/* Prevent clicks on backdrop */
.modal-backdrop.show {
    pointer-events: auto !important;
}

/* Ensure disabled button styling */
#final-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Spinner animation */
.spinner-border {
    animation: spinner-border 0.75s linear infinite;
}

@keyframes spinner-border {
    to { transform: rotate(360deg); }
}