/* NCA Course Application modal — modern, responsive */
.enrol-modal {
    --enrol-brand: #158887;
    --enrol-brand-dark: #117a7a;
    --enrol-gold: #ffb81c;
    --enrol-navy: #1a1a2e;
    --enrol-navy-2: #16213e;
    --enrol-border: #dce3ea;
    --enrol-muted: #6b7280;
    --enrol-bg: #f6f9fb;
    --enrol-radius: 12px;
}

.enrol-modal .modal-dialog {
    margin: 0.75rem auto;
    max-width: 640px;
    width: calc(100% - 1.5rem);
}

.enrol-modal .modal-dialog-scrollable {
    max-height: calc(100vh - 1.5rem);
}

.enrol-modal .modal-dialog-scrollable .modal-content {
    max-height: calc(100vh - 1.5rem);
}

.enrol-modal-content {
    border: none;
    border-radius: var(--enrol-radius);
    overflow: hidden;
    box-shadow: 0 18px 48px rgba(17, 43, 66, 0.22);
    background: #fff;
}

.enrol-modal-header {
    position: relative;
    background: linear-gradient(135deg, var(--enrol-navy) 0%, var(--enrol-navy-2) 55%, #0f3d3d 100%);
    color: #fff;
    padding: 1.35rem 3.25rem 1.35rem 1.5rem;
    border: none;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
}

.enrol-modal-header .modal-title {
    font-family: 'Nunito', 'Segoe UI', sans-serif;
    font-size: 1.45rem;
    font-weight: 800;
    color: #fff;
    margin: 0;
    line-height: 1.25;
    letter-spacing: -0.02em;
}

.enrol-modal-subtitle {
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.92rem;
    line-height: 1.45;
    margin: 0;
}

.enrol-modal .enrol-close {
    position: absolute;
    right: 12px;
    top: 12px;
    z-index: 5;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    line-height: 1;
    transition: background 0.2s ease, transform 0.15s ease;
}

.enrol-modal .enrol-close:hover,
.enrol-modal .enrol-close:focus {
    background: rgba(255, 255, 255, 0.22);
    outline: none;
    transform: scale(1.04);
}

.enrol-modal-body {
    padding: 0;
    background: var(--enrol-bg);
}

.enrol-modal-body-inner {
    padding: 1.25rem 1.35rem 1.5rem;
}

.enrol-popup-form .form-label {
    display: block;
    font-weight: 600;
    font-size: 0.86rem;
    color: var(--enrol-navy);
    margin-bottom: 0.4rem;
}

.enrol-popup-form .form-label .req {
    color: #d11a2a;
}

.enrol-popup-form .form-control,
.enrol-popup-form .form-select {
    min-height: 48px;
    border-radius: 10px;
    border: 1px solid var(--enrol-border);
    background: #fff;
    font-size: 0.96rem;
    color: var(--enrol-navy);
    padding: 0.65rem 0.9rem;
    box-shadow: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.enrol-popup-form .form-control:focus,
.enrol-popup-form .form-select:focus {
    border-color: var(--enrol-brand);
    box-shadow: 0 0 0 3px rgba(21, 136, 135, 0.16);
    outline: none;
}

.enrol-popup-form .form-control::placeholder {
    color: #9aa3af;
}

.enrol-field-hint {
    font-size: 0.8rem;
    color: var(--enrol-muted);
    margin: 0.35rem 0 0;
    line-height: 1.4;
}

.enrol-form-note {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.82rem;
    color: var(--enrol-muted);
    background: #fff;
    border: 1px dashed var(--enrol-border);
    border-radius: 10px;
    padding: 0.7rem 0.85rem;
    margin: 0;
}

.enrol-form-actions {
    margin-top: 0.25rem;
    padding-top: 0.25rem;
}

.enrol-submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 50px;
    width: 100%;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--enrol-gold) 0%, #f0a800 100%);
    color: var(--enrol-navy) !important;
    font-weight: 800;
    font-size: 1rem;
    letter-spacing: 0.02em;
    text-transform: none;
    box-shadow: 0 8px 18px rgba(255, 184, 28, 0.35);
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.enrol-submit-btn:hover:not(:disabled) {
    filter: brightness(1.03);
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(255, 184, 28, 0.42);
    color: var(--enrol-navy) !important;
}

.enrol-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

#enrolFormMessage {
    border-radius: 10px;
    font-size: 0.92rem;
}

/* Course multi-select */
.enrol-ms {
    position: relative;
}

.enrol-ms-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-bottom: 0.55rem;
    min-height: 0;
}

.enrol-ms-chips:empty {
    display: none;
    margin: 0;
}

.enrol-ms-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    max-width: 100%;
    background: rgba(21, 136, 135, 0.1);
    border: 1px solid rgba(21, 136, 135, 0.28);
    color: var(--enrol-brand-dark);
    border-radius: 999px;
    padding: 0.35rem 0.45rem 0.35rem 0.75rem;
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.3;
}

.enrol-ms-chip-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 16rem;
}

.enrol-ms-chip-remove {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 999px;
    background: rgba(21, 136, 135, 0.15);
    color: var(--enrol-brand-dark);
    font-size: 14px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
}

.enrol-ms-chip-remove:hover {
    background: rgba(21, 136, 135, 0.28);
}

.enrol-ms-trigger {
    width: 100%;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.65rem 0.9rem;
    border: 1px solid var(--enrol-border);
    border-radius: 10px;
    background: #fff;
    color: var(--enrol-navy);
    font-size: 0.96rem;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.enrol-ms-trigger:hover,
.enrol-ms-trigger:focus,
.enrol-ms.is-open .enrol-ms-trigger {
    border-color: var(--enrol-brand);
    box-shadow: 0 0 0 3px rgba(21, 136, 135, 0.16);
    outline: none;
}

.enrol-ms-trigger-text {
    flex: 1;
    min-width: 0;
    color: var(--enrol-muted);
}

.enrol-ms.has-selection .enrol-ms-trigger-text {
    color: var(--enrol-navy);
    font-weight: 600;
}

.enrol-ms-trigger-meta {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
}

.enrol-ms-count {
    display: none;
    min-width: 1.5rem;
    height: 1.5rem;
    padding: 0 0.4rem;
    border-radius: 999px;
    background: var(--enrol-brand);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    align-items: center;
    justify-content: center;
}

.enrol-ms.has-selection .enrol-ms-count {
    display: inline-flex;
}

.enrol-ms-caret {
    color: var(--enrol-muted);
    font-size: 0.75rem;
    transition: transform 0.15s ease;
}

.enrol-ms.is-open .enrol-ms-caret {
    transform: rotate(180deg);
}

.enrol-ms-panel {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    z-index: 30;
    background: #fff;
    border: 1px solid var(--enrol-border);
    border-radius: 12px;
    box-shadow: 0 14px 36px rgba(17, 43, 66, 0.18);
    overflow: hidden;
}

.enrol-ms.is-open .enrol-ms-panel {
    display: block;
}

.enrol-ms-search-wrap {
    padding: 0.65rem;
    border-bottom: 1px solid #eef2f6;
    background: #fafcfd;
}

.enrol-ms-search {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--enrol-border);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    font-size: 0.92rem;
    background: #fff;
}

.enrol-ms-search:focus {
    border-color: var(--enrol-brand);
    box-shadow: 0 0 0 3px rgba(21, 136, 135, 0.12);
    outline: none;
}

.enrol-ms-list {
    max-height: min(260px, 42vh);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0.35rem;
}

.enrol-ms-option {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    width: 100%;
    border: none;
    background: transparent;
    text-align: left;
    padding: 0.7rem 0.65rem;
    border-radius: 8px;
    cursor: pointer;
    color: var(--enrol-navy);
    font-size: 0.9rem;
    line-height: 1.35;
    transition: background 0.12s ease;
}

.enrol-ms-option:hover,
.enrol-ms-option:focus {
    background: rgba(21, 136, 135, 0.08);
    outline: none;
}

.enrol-ms-option.is-selected {
    background: rgba(21, 136, 135, 0.12);
}

.enrol-ms-option.is-hidden {
    display: none;
}

.enrol-ms-check {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin-top: 1px;
    border: 2px solid #b7c2cc;
    border-radius: 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    color: transparent;
    font-size: 12px;
    font-weight: 700;
}

.enrol-ms-option.is-selected .enrol-ms-check {
    border-color: var(--enrol-brand);
    background: var(--enrol-brand);
    color: #fff;
}

.enrol-ms-option-label {
    flex: 1;
    min-width: 0;
    word-break: break-word;
}

.enrol-ms-empty,
.enrol-ms-loading {
    padding: 1rem 0.75rem;
    text-align: center;
    color: var(--enrol-muted);
    font-size: 0.88rem;
}

.enrol-ms-actions {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.55rem 0.65rem;
    border-top: 1px solid #eef2f6;
    background: #fafcfd;
}

.enrol-ms-actions button {
    border: none;
    background: transparent;
    color: var(--enrol-brand);
    font-weight: 700;
    font-size: 0.82rem;
    padding: 0.35rem 0.45rem;
    cursor: pointer;
    border-radius: 6px;
}

.enrol-ms-actions button:hover {
    background: rgba(21, 136, 135, 0.1);
}

.enrol-ms-native {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.enrol-success-card {
    text-align: center;
    max-width: 420px;
    margin: 0 auto;
}

.enrol-success-icon-wrap {
    margin-bottom: 1rem;
}

.enrol-success-icon {
    font-size: 3.5rem;
    color: var(--enrol-brand);
    line-height: 1;
}

.enrol-success-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--enrol-navy);
    margin-bottom: 0.5rem;
}

.enrol-success-lead {
    font-size: 0.95rem;
    color: #555;
    line-height: 1.5;
    margin-bottom: 1.25rem;
}

.enrol-success-id-box {
    background: linear-gradient(135deg, #f0f9f9 0%, #e8f4f4 100%);
    border: 1px solid var(--enrol-brand);
    border-radius: 10px;
    padding: 0.75rem 1.25rem;
    margin-bottom: 1.25rem;
}

.enrol-success-id-label {
    display: block;
    font-size: 0.8rem;
    color: var(--enrol-brand);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.enrol-success-id-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--enrol-navy);
    letter-spacing: 1px;
}

.enrol-success-next {
    font-size: 0.9rem;
    color: #333;
    margin-bottom: 1rem;
}

.enrol-success-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
}

.enrol-success-secondary {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
}

.enrol-btn-secondary {
    display: inline-block;
    padding: 10px 20px;
    border: 2px solid var(--enrol-gold);
    color: var(--enrol-navy);
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
    background: #fff;
}

.enrol-btn-secondary:hover {
    background: var(--enrol-gold);
    color: var(--enrol-navy);
}

@media (max-width: 575.98px) {
    .enrol-modal .modal-dialog {
        margin: 0.5rem auto;
        width: calc(100% - 1rem);
        max-height: calc(100vh - 1rem);
    }

    .enrol-modal .modal-dialog-scrollable .modal-content {
        max-height: calc(100vh - 1rem);
    }

    .enrol-modal-header {
        padding: 1.15rem 3rem 1.1rem 1.15rem;
    }

    .enrol-modal-header .modal-title {
        font-size: 1.28rem;
    }

    .enrol-modal-body-inner,
    .enrol-success-screen {
        padding: 1rem 1rem 1.25rem;
    }

    .enrol-ms-chip-label {
        max-width: 12rem;
    }

    .enrol-ms-list {
        max-height: min(220px, 38vh);
    }

    .enrol-ms-panel {
        position: fixed;
        left: 0.75rem;
        right: 0.75rem;
        top: auto;
        bottom: 0.75rem;
        max-height: min(70vh, 480px);
        display: none;
        flex-direction: column;
        z-index: 1065;
    }

    .enrol-ms.is-open .enrol-ms-panel {
        display: flex;
    }

    .enrol-ms-list {
        flex: 1;
        max-height: none;
    }

    .enrol-form-actions {
        position: sticky;
        bottom: 0;
        background: linear-gradient(180deg, rgba(246, 249, 251, 0) 0%, var(--enrol-bg) 28%);
        padding-top: 0.75rem;
        margin-left: -0.15rem;
        margin-right: -0.15rem;
    }
}

@media (max-width: 375px) {
    .enrol-success-secondary {
        width: 100%;
        flex-direction: column;
    }

    .enrol-btn-secondary {
        width: 100%;
        text-align: center;
    }
}
