/* Custom styles for CHARLIE */

html {
    scrollbar-gutter: stable;
}

body.modal-open {
    overflow: auto !important;
    padding-right: 0 !important;
}

:root {
    --radius-item: 10px;
    --radius-lg: 4px;
    --radius-sm: 2px;
    --sidebar-width: 110px;
}

/* =============================================
   Top Bar (persistent header on every page)
   ============================================= */
.top-bar {
    background-color: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    z-index: 1040;
    padding: 10px 0;
    height: 72px;
}

/* "Payment failed" banner: full width, pinned directly under the sticky top bar
   (72px tall) so it stays visible while the page scrolls. Below the top bar's
   z-index and above page content; Bootstrap modals (1055) still cover it. */
.payment-banner {
    position: sticky;
    top: 72px;
    z-index: 1030;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px 16px;
    padding: 10px 24px;
    background-color: #fff3cd;
    color: #664d03;
    border-bottom: 1px solid #ffe69c;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    font-size: 0.95rem;
    text-align: center;
}

.payment-banner form {
    margin: 0;
}

/* Subscription cancelled: the same bar in red (Bootstrap "danger" colours). */
.payment-banner-danger {
    background-color: #f8d7da;
    color: #842029;
    border-bottom-color: #f1aeb5;
}

.top-bar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: relative;
    height: 100%;
}

.top-bar-back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #1a1a2e;
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
}

.top-bar-back-link:hover {
    color: #000;
    text-decoration: none;
}

.top-bar-title-center {
    position: absolute;
    left: calc(50% + var(--sidebar-width) / 2);
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.35rem;
    font-weight: 600;
    color: #1a1a2e;
}

.top-bar-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
}

.top-bar-logo img {
    width: 182px;
    height: 48px;
}

.top-bar-logout-form {
    margin: 0;
}

.top-bar-logout {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #333;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: var(--radius-lg);
    transition: background-color 0.2s, color 0.2s;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.top-bar-logout:hover {
    background-color: #f0f0f0;
    color: #111;
    text-decoration: none;
}

/* Auth page top bar override: position absolutely so it doesn't affect centering */
.auth-page .top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    box-shadow: none;
    background-color: transparent;
}

/* Dropdown submenu styles */
.dropdown-submenu {
    position: relative;
}

.dropdown-submenu .dropdown-menu {
    top: 0;
    right: 100%;
    margin-top: -1px;
}

.dropdown-submenu:hover .dropdown-menu,
.dropdown-submenu:focus-within .dropdown-menu {
    display: block;
}

.dropdown-submenu .dropdown-toggle::after {
    transform: rotate(-90deg);
    float: right;
    margin-top: 8px;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

body.dashboard-bg {
    background-color: #f0f1f4;
}


.footer {
    margin-top: auto;
}

.footer-brand-text {
    color: #07a8a3;
    font-size: 0.8rem;
}

.auth-form {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    border-radius: var(--radius-lg);
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

/* =============================================
   Auth Pages (Login / Sign Up)
   ============================================= */

.auth-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0;
    padding: 40px 20px;
}

.auth-bg-login {
    background: linear-gradient(135deg, #F0FDFA 0%, #F3E8FF 100%);
}

.auth-bg-signup {
    background: linear-gradient(135deg, #664277 0%, #65497C 7%, #645080 14%, #635785 21%, #615E89 29%, #5F658E 36%, #5D6C92 43%, #597397 50%, #55799C 57%, #5080A0 64%, #4B87A5 71%, #438EAA 79%, #3A94AE 86%, #2D9BB3 93%, #17A2B8 100%);
}

.auth-container {
    width: 100%;
    max-width: 448px;
    margin: auto 0;
}

.auth-messages {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1050;
    width: 90%;
    max-width: 480px;
}

.auth-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0px 20px 25px -5px rgba(0, 0, 0, 0.2), 0px 8px 10px -6px rgba(0, 0, 0, 0.1);
    padding: 32px;
    animation: auth-card-in 0.35s ease-out;
}

@keyframes auth-card-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-card {
        animation: none;
    }
}

.auth-card-header {
    text-align: center;
    margin-bottom: 16px;
}

.auth-logo {
    height: 84px;
    margin-bottom: 16px;
}

.auth-title {
    font-size: 30px;
    font-weight: 400;
    color: #101828;
    letter-spacing: -0.02em;
    margin-bottom: 0;
}

.auth-subtitle {
    color: #3B475B;
    font-size: 16px;
    font-weight: 400;
    margin-bottom: 0;
}

.auth-form-group {
    margin-bottom: 16px;
}

.auth-form-group label {
    display: block;
    font-size: 14px;
    font-weight: 400;
    color: #101828;
    margin-bottom: 8px;
}

.auth-form-group .form-control {
    border: 1px solid #D1D5DC;
    border-radius: 10px;
    padding: 8px 16px;
    font-size: 16px;
    margin-bottom: 0;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-form-group .form-control::placeholder {
    color: rgba(10, 10, 10, 0.3);
}

.auth-form-group .form-control:hover {
    border-color: #b9a9c9;
}

.auth-form-group .form-control:focus {
    border-color: #664277;
    box-shadow: 0 0 0 3px rgba(102, 66, 119, 0.13);
}

.auth-btn {
    width: 100%;
    padding: 12px;
    background-color: #664277;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    margin-top: 8px;
    transition: background-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.auth-btn:hover {
    background-color: #553566;
    box-shadow: 0 6px 16px rgba(102, 66, 119, 0.28);
}

.auth-btn:active {
    transform: translateY(1px);
}

.auth-btn:focus-visible {
    outline: 2px solid #664277;
    outline-offset: 2px;
}

.auth-divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
    color: #9ca3af;
    font-size: 0.85rem;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    border-bottom: 1px solid #e5e7eb;
}

.auth-divider span {
    padding: 0 12px;
}

.auth-terms {
    text-align: center;
    font-size: 0.8rem;
    color: #9ca3af;
    margin-top: 16px;
    margin-bottom: 0;
}

.auth-terms a {
    color: #9ca3af;
    text-decoration: underline;
}

.auth-terms a:hover {
    color: #6c757d;
}

.auth-back-home {
    margin-top: 8px;
}

.auth-footer .auth-back-home a {
    color: #6c757d;
    font-weight: 400;
    text-decoration: none;
    font-size: 0.85rem;
}

.auth-footer .auth-back-home a:hover {
    color: #495057;
    text-decoration: underline;
}

.auth-footer {
    text-align: center;
    margin-top: 16px;
}

.auth-footer p {
    font-size: 14px;
    color: #3B475B;
    margin: 0;
}

.auth-footer a {
    color: #07A8A3;
    font-weight: 400;
    text-decoration: none;
    transition: color 0.15s ease;
}

.auth-footer a:hover {
    color: #059590;
    text-decoration: underline;
}

/* Login-specific overrides */
.auth-bg-login .auth-form-group {
    margin-bottom: 24px;
}

.auth-bg-login .auth-btn {
    margin-top: 0;
}

/* Signup-specific overrides */
.auth-bg-signup {
    padding: 16px 20px;
}

.auth-bg-signup .auth-card {
    padding: 26px 32px;
}

.auth-bg-signup .auth-card-header {
    margin-bottom: 10px;
}

.auth-bg-signup .auth-logo {
    height: 72px;
    margin-bottom: 10px;
}

.auth-bg-signup .auth-title {
    font-size: 28px;
    font-weight: 500;
}

.auth-bg-signup .auth-subtitle {
    font-size: 15px;
}

.auth-bg-signup .auth-form-group {
    margin-bottom: 12px;
}

.auth-bg-signup .auth-form-group .form-control {
    padding: 12px 16px;
}

.auth-bg-signup .auth-btn {
    margin-top: 0;
}

.auth-bg-signup .auth-divider {
    margin: 12px 0;
    color: #3B475B;
    font-size: 14px;
}

.auth-bg-signup .auth-divider::before,
.auth-bg-signup .auth-divider::after {
    border-bottom-color: rgba(10, 10, 10, 0.5);
}

.auth-btn-svg {
    display: block;
    width: 100%;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.auth-btn-svg img {
    width: 100%;
    height: 48px;
    display: block;
    border-radius: 10px;
}

.auth-btn-svg:hover {
    opacity: 0.85;
}

.auth-btn-svg:focus-visible {
    outline: 2px solid #664277;
    outline-offset: 2px;
    border-radius: 10px;
}

.auth-bg-signup .auth-terms {
    font-size: 14px;
    color: rgba(10, 10, 10, 0.5);
    margin-top: 10px;
}

.auth-bg-signup .auth-terms a {
    color: rgba(10, 10, 10, 0.5);
    text-decoration: none;
    font-weight: 500;
}

.auth-bg-signup .auth-terms a:hover {
    color: rgba(10, 10, 10, 0.7);
    text-decoration: underline;
}

.auth-bg-signup .auth-footer {
    margin-top: 0;
    padding-top: 16px;
}

.auth-bg-signup .auth-footer p {
    font-size: 16px;
}

.auth-bg-signup .auth-footer a {
    font-weight: 500;
}

.auth-bg-signup .auth-footer .auth-back-home a {
    color: rgba(10, 10, 10, 0.5);
    font-size: 16px;
}

.auth-bg-signup .auth-footer .auth-back-home a:hover {
    color: rgba(10, 10, 10, 0.7);
}

@media (max-width: 520px) {
    .auth-card {
        padding: 28px 20px;
    }

    .auth-bg-signup .auth-card {
        padding: 24px 16px;
    }
}

/* Form styling */
.form-group {
    position: relative;
    clear: both;
    overflow: visible;
    margin-bottom: 30px;
    display: block;
}

/* Learning needs container styles */
.learning-needs-container {
    display: block;
    width: 100%;
    margin-top: 10px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    clear: both;
}

/* Fix for checkbox list */
.learning-needs-container ul {
    list-style: none;
    padding-left: 0;
    margin-bottom: 15px;
}

/* Fix for checkbox items */
.learning-needs-container li {
    display: block;
    margin-bottom: 10px;
    clear: both;
    width: 100%;
}

/* Fix for checkbox alignment */
.learning-needs-container input[type="checkbox"] {
    margin-right: 8px;
    vertical-align: top;
    float: left;
    margin-top: 5px;
}

/* Fix for checkbox labels */
.learning-needs-container label {
    display: inline-block;
    margin-left: 0;
    margin-bottom: 10px;
    width: 90%;
    max-width: 90%;
    word-wrap: break-word;
    text-align: left;
}

/* Other text field container */
#other_text_container {
    margin-top: 15px;
    margin-bottom: 15px;
    padding-top: 5px;
    clear: both;
}

/* Fix for profile dropdown to ensure it's below learning needs */
#id_profile {
    margin-top: 10px;
    clear: both;
}

#other_text_container {
    margin-top: 10px;
    margin-bottom: 15px;
}

.form-group {
    margin-bottom: 1rem;
}

.btn-primary {
    @apply bg-primary;
}

.btn-primary:hover {
    @apply bg-primary:hover;
}

.navbar-brand {
    font-weight: bold;
}



/* Fix for tooltip on disabled dropdown items */
.dropdown-item.disabled {
    pointer-events: auto;    /* re-enable hover/focus */
    cursor: not-allowed;     /* keep the disabled look */
}

@media (max-width: 767px) {
    .dropdown-item {
        white-space: normal;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
}

.password-requirements-container {
    margin-top: 0.5rem;
}

.password-requirements-toggle {
    font-size: 0.8rem;
    color: #6c757d;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.password-requirements-toggle:hover {
    color: #5a6268;
    text-decoration: none;
}

.password-requirements {
    font-size: 0.8rem;
    color: #6c757d;
    padding: 0.5rem;
    background-color: #f8f9fa;
    border-radius: var(--radius-lg);
}

/* UoC Lookup Page Styles */
.header {
    text-align: center;
    margin-bottom: 30px;
}

.search-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
    margin: 0 auto;
}

.search-form input {
    padding: 10px;
    font-size: 16px;
}

.search-form button {
    padding: 10px;
    background-color: #007bff;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 16px;
}

.error {
    color: red;
    text-align: center;
    margin-top: 20px;
}

/* UoC Detail Page Styles */
.back-link {
    display: inline-block;
    margin-bottom: 20px;
    color: #007bff;
    text-decoration: none;
}

.back-link:hover {
    text-decoration: underline;
}

.section {
    margin-bottom: 30px;
    border: 1px solid #ddd;
    border-radius: var(--radius-lg);
    padding: 15px;
}

.section h2 {
    margin-top: 0;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.info-row {
    display: flex;
    margin-bottom: 10px;
}

.info-label {
    width: 200px;
    font-weight: bold;
}

.info-value {
    flex: 1;
}

.mapping-item {
    margin-bottom: 15px;
    padding: 10px;
    background-color: #f9f9f9;
    border-radius: var(--radius-lg);
}

.releases-item {
    margin-bottom: 15px;
    padding: 10px;
    background-color: #f9f9f9;
    border-radius: var(--radius-lg);
}

.download-section {
    margin-top: 30px;
}

.download-list {
    list-style-type: none;
    padding: 0;
}

.download-item {
    margin-bottom: 10px;
}

.download-link {
    display: inline-block;
    padding: 8px 15px;
    background-color: #007bff;
    color: white;
    text-decoration: none;
    border-radius: var(--radius-lg);
    margin-right: 10px;
    margin-top: 20px;
}

.download-link:hover {
    background-color: #0056b3;
}

/* UoC Parsed Content Styles */
.file-info {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.file-type {
    background-color: #f0f0f0;
    padding: 4px 8px;
    border-radius: var(--radius-lg);
    margin-left: 10px;
    font-size: 0.9em;
}

.sample-notice {
    background-color: #fff3cd;
    color: #856404;
    padding: 10px 15px;
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
    border: 1px solid #ffeeba;
}

.markdown-content {
    line-height: 1.6;
}

.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4,
.markdown-content h5,
.markdown-content h6 {
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}

.markdown-content p {
    margin-top: 0.5em;
    margin-bottom: 1em;
}

.markdown-content ul,
.markdown-content ol {
    margin-bottom: 1em;
}

.markdown-content blockquote {
    border-left: 4px solid #ddd;
    padding-left: 1em;
    margin-left: 0;
    color: #666;
}

.markdown-content pre {
    background-color: #f5f5f5;
    padding: 1em;
    border-radius: var(--radius-lg);
    overflow-x: auto;
}

.markdown-content code {
    background-color: #f5f5f5;
    padding: 2px 4px;
    border-radius: var(--radius-lg);
}

.loading-message {
    font-style: italic;
    color: #666;
    text-align: center;
    padding: 2em;
}

.error-message {
    color: #dc3545;
    background-color: #f8d7da;
    padding: 15px;
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
}

/* Course form styles */
.form-check {
    margin-bottom: 0.5rem;
    display: flex;
    align-items: flex-start;
}

.form-check-input {
    margin-top: 0.3rem;
    margin-right: 0.5rem;
}

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

.conditional-fieldset {
    display: none;
}

.conditional-fieldset.show {
    display: block;
}

.other-field {
    display: none;
}

.other-field.show {
    display: block;
}

/* Ensure proper spacing in fieldsets */
.card-body {
    padding: 1.25rem;
}

/* Scrollable content card bodies for artifact generation */
.glossary-card-body,
.rewrite-card-body,
.recommendations-card-body {
    padding: 1.25rem;
    max-height: 300px;
    overflow-y: auto;
}

.card-header h5 {
    margin-bottom: 0;
}

/* Fix for radio buttons and checkboxes alignment */
input[type="radio"],
input[type="checkbox"] {
    margin-right: 0.5rem;
    vertical-align: middle;
}

/* Ensure proper spacing between form elements */
.form-control,
.form-select {
    margin-bottom: 0.5rem;
    border-radius: var(--radius-sm);
}

/* Fix for label alignment */
label {
    display: block;
    margin-bottom: 0.5rem;
}

/* Fix for help text */
.form-text {
    display: block;
    margin-bottom: 0.5rem;
    margin-top: 0;
}

/* Checkbox options container */
.checkbox-options {
    margin-top: 0.5rem;
    margin-bottom: 1rem;
}

/* Radio options container */
.radio-options {
    margin-top: 0.5rem;
    margin-bottom: 1rem;
}

/* Card styling for fieldsets */
.card {
    margin-bottom: 1.5rem;
    border: 1px solid rgba(0,0,0,.125);
    border-radius: var(--radius-lg);
}

.card-header {
    padding: 0.75rem 1.25rem;
    background-color: rgba(0,0,0,.03);
    border-bottom: 1px solid rgba(0,0,0,.125);
}

/* Generate Document button styling */
.btn-generate-document {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.btn-generate-document i {
    display: inline-block;
}

/* Logo styling */
.vortex-logo {
    max-width: 300px;
    margin: 0 auto 20px;
    display: block;
}

/* Title suggestion popup styling */
.field-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
}

.title-suggestion-popup {
    position: absolute;
    border: 1px solid #ced4da;
    border-radius: var(--radius-lg);
    padding: 0.4rem 0.7rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
    background-color: #fff;
    z-index: 1000;
    cursor: pointer;
    left: 0;
    top: 100%;
    width: 100%;
    box-sizing: border-box;
    font-size: 0.95rem;
}

.title-suggestion-popup[hidden] {
    display: none;
}

.suggestion-option {
    cursor: pointer;
    padding: 0.5rem;
    border-bottom: 1px solid #f8f9fa;
}

.suggestion-option:hover {
    background-color: #f8f9fa;
}

/* Clickable course card styles */
.course-card-clickable {
    cursor: pointer;
    transition: border-color 0.2s ease;
    position: relative;
    border: 1px solid #dee2e6;
}

.course-card-clickable:hover {
    border-color: #0056b3;
}

.course-card-clickable.active {
    border-color: #007bff;
    background-color: #f8f9fa;
    color: black;
}

.course-dropdown-menu {
    position: absolute;
    z-index: 1000;
    display: none;
}

/* =============================================
   Multi-step Wizard Form Styles
   Reusable pattern for all long input forms
   ============================================= */

.wizard-hidden {
    display: none !important;
}

/* Progress indicator */
.wizard-progress {
    margin-bottom: 1.5rem;
}

.wizard-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: #555;
}

.wizard-progress-label {
    font-weight: 500;
}

.wizard-progress-count {
    color: #888;
}

.wizard-progress-bar {
    width: 100%;
    height: 8px;
    background-color: #e0e0e0;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.wizard-progress-fill {
    height: 100%;
    background: #17a2b8;
    border-radius: var(--radius-lg);
    transition: width 0.4s ease;
}

/* Section header card */
.wizard-section-header {
    border-left: 4px solid #5c4d7a;
    border-right: 4px solid #5c4d7a;
    background-color: #f8f9fa;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
}

.wizard-section-header h4 {
    margin-bottom: 0.25rem;
    font-size: 1.25rem;
}

.wizard-section-header p {
    margin-bottom: 0;
    font-size: 0.9rem;
}

/* Fieldset cards in wizard */
.wizard-fieldset {
    border: 1px solid #e0e0e0;
    border-radius: var(--radius-lg);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.10);
}

.wizard-fieldset-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.wizard-field-label {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.wizard-select-hint {
    font-size: 0.85rem;
    color: #888;
    font-style: italic;
    margin-bottom: 0.75rem;
    margin-top: 0;
}

/* Character counter ("142 / 150") under text fields that have a length limit */
.wizard-char-counter {
    font-size: 0.75rem;
    color: #888;
    text-align: right;
    margin-top: 0.25rem;
}

.wizard-char-counter-over {
    color: #dc3545;
}

/* Free-text inputs inside the wizard should match the option-pill styling */
.wizard-fieldset input[type="text"],
.wizard-fieldset input[type="email"],
.wizard-fieldset input[type="tel"],
.wizard-fieldset textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1.5px solid #d0d0d0;
    border-radius: var(--radius-sm);
    background-color: #fff;
    font-size: 0.95rem;
    color: #1a1a2e;
    transition: border-color 0.2s ease;
}

.wizard-fieldset input[type="text"]:focus,
.wizard-fieldset input[type="email"]:focus,
.wizard-fieldset input[type="tel"]:focus,
.wizard-fieldset textarea:focus {
    outline: 2px solid #17a2b8;
    outline-offset: 1px;
    border-color: #17a2b8;
}

/* Clickable option pills */
.wizard-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.wizard-option {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    border: 1.5px solid #d0d0d0;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: #fff;
    margin-bottom: 0;
}

.wizard-option:hover {
    border-color: #17a2b8;
    background-color: #f0fafb;
}

.wizard-option input[type="checkbox"],
.wizard-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.wizard-option-text {
    flex: 1;
    font-size: 0.95rem;
}

.wizard-option-check {
    font-size: 1.25rem;
    color: transparent;
    transition: color 0.2s ease;
    margin-left: 0.5rem;
}

/* Selected state */
.wizard-option.selected {
    border-color: #17a2b8;
    background-color: #e6f7fa;
}

.wizard-option.selected:hover {
    border-color: #17a2b8;
    background-color: #e6f7fa;
}

.wizard-option.selected .wizard-option-check {
    color: #17a2b8;
}

/* Dropdown-style single-select (Cohort wizard) */
.wizard-dropdown {
    position: relative;
}

.wizard-dropdown-select {
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    padding: 0.75rem 2.5rem 0.75rem 2.75rem;
    border: 1.5px solid #d0d0d0;
    border-radius: var(--radius-sm);
    background-color: #fff;
    font-size: 0.95rem;
    color: #1a1a2e;
    cursor: pointer;
}

.wizard-dropdown-select:focus {
    outline: 2px solid #17a2b8;
    outline-offset: 1px;
    border-color: #17a2b8;
}

.wizard-dropdown-icon {
    position: absolute;
    left: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #6c757d;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    pointer-events: none;
}

.wizard-dropdown-chevron {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #888;
    font-size: 0.85rem;
    pointer-events: none;
}

/* Multi-select checkbox tile grid (Cohort wizard) */
.wizard-options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
}

@media (max-width: 640px) {
    .wizard-options-grid {
        grid-template-columns: 1fr;
    }
}

/* Form-grouped section cards (Cohort wizard) */
.cohort-section-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    padding: 24px 28px;
    margin-bottom: 24px;
}

/* =============================================
   Settings — profile banner
   ============================================= */
.settings-banner {
    background: linear-gradient(90deg, #664277 0%, #65497C 7%, #645080 14%, #635785 21%, #615E89 29%, #5F658E 36%, #5D6C92 43%, #597397 50%, #55799C 57%, #5080A0 64%, #4B87A5 71%, #438EAA 79%, #3A94AE 86%, #2D9BB3 93%, #17A2B8 100%);
    border-radius: 4px 4px 0 0;
    padding: 48px 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.settings-banner-avatar {
    width: 96px;
    height: 96px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.settings-banner-avatar i {
    font-size: 48px;
    color: #663166;
}

.settings-banner-name {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 30px;
    line-height: 120%;
    text-align: center;
    letter-spacing: -0.02em;
    color: #fff;
    margin: 0;
}

.settings-banner-title {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 120%;
    text-align: center;
    color: #B2E4E2;
    margin: 0;
}

.settings-form-card {
    border-radius: 0 0 4px 4px;
    box-shadow: 0px 4px 6px -1px rgba(0, 0, 0, 0.1), 0px 2px 4px -2px rgba(0, 0, 0, 0.1);
}

/* =============================================
   Generate Teaching Set — numbered profile picker
   ============================================= */
.ts-section-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    padding: 24px 28px;
    margin-bottom: 24px;
}

.ts-section-header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding-bottom: 16px;
    margin-bottom: 16px;
    border-bottom: 1px solid #eee;
}

.ts-section-badge {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #663166;
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ts-section-heading h5 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 2px;
}

.ts-section-heading p {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 0;
}

.ts-option-list {
    gap: 0.75rem;
}

.wizard-option-rich {
    align-items: center;
    padding: 14px 18px;
    gap: 16px;
}

.ts-option-icon {
    width: 40px;
    height: 40px;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.ts-option-body {
    flex: 1;
    min-width: 120px;
    display: flex;
    flex-direction: column;
}

.wizard-option-rich .wizard-option-check {
    font-size: 1.4rem;
    align-self: center;
}

.ts-review-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.ts-review-list .wizard-option {
    pointer-events: none;
}

.ts-review-spacer {
    height: 12px;
}

/* =============================================
   Generate Cluster Set — teal badges, violet selection
   ============================================= */
.cs-wizard .ts-section-badge {
    background-color: #07a8a3;
}

.cs-wizard .wizard-option:hover {
    border-color: #663166;
    background-color: #f7f4f7;
}

.cs-wizard .wizard-option.selected,
.cs-wizard .wizard-option.selected:hover {
    border-color: #663166;
    background-color: #f0eaf0;
}

.cs-wizard .wizard-option.selected .wizard-option-check {
    color: #07a8a3;
}

/* Review step: Generate button stacked above Back, both full-width */
.wizard-nav.ts-review-nav {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
}

.wizard-nav.ts-review-nav #wizard-submit-btn {
    order: 1;
    width: 100%;
    margin-left: 0;
    border-radius: 10px;
    font-size: 1.05rem;
}

.wizard-nav.ts-review-nav #wizard-back-btn {
    order: 2;
    width: 100%;
    background: #fff;
    border: 1.5px solid #d0d0d0;
    border-radius: 10px;
    color: #6c757d;
    padding: 0.75rem 0;
}

.wizard-nav.ts-review-nav #wizard-back-btn:hover {
    background: #f5f5f5;
    color: #1a1a2e;
}

.cohort-section-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #07a8a3;
    text-transform: none;
    margin-bottom: 16px;
}

.cohort-intro-card {
    background: #fff;
    border-left: 4px solid #663166;
    border-right: 4px solid #663166;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    padding: 20px 24px;
    margin-bottom: 24px;
}

.cohort-intro-card h4 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.cohort-intro-card p {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 0;
}

.cohort-progress-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: #555;
    margin-bottom: 8px;
}

/* Cohort review/summary screen */
.cohort-review-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    padding: 20px 24px;
    margin-bottom: 20px;
}

.cohort-review-card .cohort-section-title {
    margin-bottom: 10px;
}

.cohort-review-q {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 3px;
}

.cohort-review-a {
    font-size: 0.9rem;
    color: #1a1a2e;
    margin-bottom: 14px;
}

.cohort-review-a.not-filled {
    font-style: italic;
    color: #999;
}

/* Intro card (Your Class/Cohort) */
.cohort-review-intro {
    background: #fff;
    border-left: 4px solid #663166;
    border-right: 4px solid #663166;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    padding: 20px 24px;
    margin-bottom: 24px;
}

.cohort-review-intro .cohort-section-title {
    margin-bottom: 4px;
}

.cohort-review-intro h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: #663166;
    margin-bottom: 4px;
}

.cohort-review-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 4px;
}

.cohort-review-title-row h2 {
    margin-bottom: 0;
}

.cohort-review-intro > p {
    font-size: 0.85rem;
    color: #6c757d;
    margin-bottom: 10px;
}

.cohort-review-count {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: #1a1a2e;
    margin-bottom: 4px;
}

.cohort-review-tagline {
    font-size: 0.85rem;
    color: #6c757d;
    margin-bottom: 14px;
}

.cohort-review-subheading {
    font-size: 1rem;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 4px;
}

/* Profile / Unit / Cohort detail page (read-only view) */
.profile-detail-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.profile-detail-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.profile-detail-actions-right {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
    flex-wrap: wrap;
}

.profile-detail-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 48px;
    padding: 0 1.5rem;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
}

.profile-detail-btn-outline-teal {
    background: #fff;
    border: 1.5px solid #07a8a3;
    color: #07a8a3;
}

.profile-detail-btn-outline-teal:hover {
    background: rgba(7, 168, 163, 0.08);
    color: #07a8a3;
}

.profile-detail-btn-outline-purple {
    background: #fff;
    border: 1.5px solid #663166;
    color: #663166;
}

.profile-detail-btn-outline-purple:hover {
    background: rgba(102, 49, 102, 0.08);
    color: #663166;
}

.profile-detail-btn-solid {
    background: #4a2040;
    border: none;
    color: #fff;
}

.profile-detail-btn-solid:hover {
    background: #3a1830;
    color: #fff;
}

.profile-detail-delete-link {
    color: #fb2c36;
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
}

.profile-detail-delete-link:hover {
    color: #c81e2c;
    text-decoration: underline;
}

/* Help notes under fields (e.g. unit code lookup) */
#unit-wizard-form .form-text.text-muted,
#cohort-wizard-form .form-text.text-muted,
#profile-wizard-form .form-text.text-muted {
    color: #888 !important;
    font-style: italic;
}

.cohort-help-note {
    font-size: 0.8rem;
    font-style: italic;
    color: #663166;
    margin: 8px 0 4px;
}

.cohort-help-note-list {
    font-size: 0.8rem;
    font-style: italic;
    color: #663166;
    margin: 0 0 8px;
    padding-left: 1.1rem;
}

/* Unit code check result under the code field (soft check: never blocks) */
.unit-code-status {
    font-size: 0.85rem;
    margin: 8px 0 4px;
}

.unit-code-status-loading {
    color: #663166;
}

.unit-code-status-success {
    color: #2e7d32;
}

.unit-code-status-warning {
    color: #8a5a00;
}

.unit-code-spinner {
    width: 0.9rem;
    height: 0.9rem;
    border-width: 0.15em;
    margin-right: 8px;
    vertical-align: -0.1em;
}

.wizard-nav-next:disabled,
.wizard-nav-next.is-busy {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Wizard navigation — Back and Next/Save always share the same shape */
.wizard-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    margin-bottom: 2rem;
    padding-top: 1rem;
}

.wizard-nav-back,
.wizard-nav-next {
    height: 48px;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.wizard-nav-next {
    min-width: 152px;
    padding: 0 1.5rem;
}

.wizard-nav-back {
    background: none;
    border: none;
    color: #888;
    padding: 0 1rem;
}

.wizard-nav-back:hover {
    color: #555;
}

.wizard-nav-review .wizard-nav-back {
    background: #fff;
    border: 1.5px solid #d0d0d0;
    color: #1a1a2e;
    padding: 0 1.5rem;
}

.wizard-nav-review .wizard-nav-back:hover {
    background: #f5f5f5;
    color: #1a1a2e;
}

.wizard-nav-next {
    background-color: #4a2040;
    color: #fff;
    border: none;
    margin-left: auto;
}

.wizard-nav-review .wizard-nav-next {
    margin-left: 0;
}

.wizard-nav-next:hover {
    background-color: #3a1830;
    color: #fff;
}

.wizard-nav-next.wizard-nav-save {
    background-color: #07a8a3;
}

.wizard-nav-next.wizard-nav-save:hover {
    background-color: #069793;
}

.btn-icon-svg {
    width: 20px;
    height: 20px;
    vertical-align: middle;
    margin-right: 4px;
}

/* Review step: Edit Again / Save fill the row as an equal-width pair */
.wizard-nav-review {
    gap: 10px;
}

.wizard-nav-review .wizard-nav-back,
.wizard-nav-review .wizard-nav-next {
    flex: 1;
}

/* Wizard radio card for selection lists */
.wizard-radio-card {
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.wizard-radio-card:has(input:checked) {
    border-color: #17a2b8;
    background-color: #e6f7fa;
}

/* =============================================
   Teacher Profiles List View
   Matches dashboard card aesthetic
   ============================================= */

.profiles-container {
    margin: 0 auto;
}

.profiles-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.profiles-header h1 {
    font-size: 1.8rem;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 4px;
}

.profiles-header p {
    font-size: 0.95rem;
    color: #6c757d;
    margin-bottom: 0;
}

.profiles-grid {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-bottom: 24px;
}

.profile-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.10);
    padding: 24px 28px;
    transition: box-shadow 0.2s;
    position: relative;
}

.profile-card:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.profile-card-row {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.profile-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.1rem;
    background-color: #663166;
    flex-shrink: 0;
}

.profile-card-icon.profile-card-icon-svg {
    background-color: transparent;
}

.profile-card-icon-svg img {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 4px;
}

.profile-card-body {
    flex: 1;
    min-width: 0;
}

.profile-card-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 2px;
    overflow-wrap: break-word;
}

.profile-card-subject {
    font-size: 0.85rem;
    font-weight: 500;
    color: #07a8a3;
    margin-bottom: 4px;
}

.ts-section-card .profile-card-subject {
    color: #663166;
}

.profile-card-description {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 0;
}

.profile-card-meta {
    font-size: 0.85rem;
    color: #6c757d;
    margin-bottom: 0;
}

.profile-card-meta-subject {
    color: #07a8a3;
    font-weight: 500;
}

.profile-card-meta span + span::before {
    content: "\2022";
    margin: 0 6px;
    color: #ccc;
}

.profile-card-info-row {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 0.85rem;
    color: #6c757d;
    margin: 6px 0 0;
}

.unit-status-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 999px;
    white-space: nowrap;
    flex-shrink: 0;
    margin-top: 8px;
}

.unit-status-active {
    background-color: #e6f7f6;
    color: #1a1a2e;
}

.unit-status-draft {
    background-color: #FFFF86;
    color: #1a1a2e;
}

.profile-card-icon-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
    padding-top: 4px;
}

.profile-card-icon-actions a {
    display: flex;
    align-items: center;
    transition: opacity 0.2s;
    font-size: 0;
    line-height: 0;
}

.profile-card-icon-actions a:hover {
    opacity: 0.65;
}

.profile-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid #eee;
    margin-top: 20px;
    padding-top: 16px;
}

.profile-card-date {
    font-size: 0.85rem;
    color: #999;
}

.profile-card-view-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #663166;
    text-decoration: none;
}

.profile-card-view-link i {
    font-size: 0.8rem;
    transition: transform 0.2s;
}

.profile-card-view-link:hover i {
    transform: translateX(3px);
}

.profile-card-view-link-teal {
    color: #07a8a3;
}

.profile-card-view-link:hover {
    color: #4a2040;
    text-decoration: underline;
}

.profile-card-view-link-teal:hover {
    color: #069793;
}

.profiles-back-btn {
    display: block;
    width: 100%;
    text-align: center;
    background: transparent;
    color: #07a8a3;
    border: 2px solid #07a8a3;
    border-radius: 10px;
    padding: 12px;
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.profiles-back-btn:hover {
    background-color: rgba(7, 168, 163, 0.08);
    color: #07a8a3;
}

.btn-purple,
.profiles-add-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: #663166;
    color: #fff;
    border: none;
    border-radius: var(--radius-lg);
    padding: 12px 20px;
    font-size: 0.95rem;
    font-weight: 500;
    white-space: nowrap;
    transition: background-color 0.2s ease;
}

.btn-purple:hover,
.profiles-add-btn:hover {
    background-color: #4a2040;
    color: #fff;
}

.profiles-add-btn-teal {
    background-color: #07a8a3;
}

.profiles-add-btn-teal:hover {
    background-color: #069793;
}

.profile-card-icon-teal {
    background-color: #07a8a3;
}

.profiles-add-btn[data-limit-reached="true"] {
    background-color: #b8b8b8;
    cursor: pointer;
}

.profiles-add-btn[data-limit-reached="true"]:hover {
    background-color: #a8a8a8;
}

/* Limit-reached error modal */
.limit-modal-content {
    border: none;
    border-radius: var(--radius-lg, 16px);
    padding: 12px 8px;
}

.limit-modal-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 32px 24px 8px;
}

.chomp-icon-wrap {
    width: 110px;
    height: 110px;
    margin-bottom: 24px;
}

.chomp-icon-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.limit-modal-message {
    color: #f95c5c;
    font-weight: 600;
    font-size: 1.05rem;
    margin-bottom: 0;
}

.limit-modal-footer {
    border-top: none;
    justify-content: center;
    padding: 20px 24px 28px;
}

.limit-modal-ok-btn {
    width: 100%;
    background-color: #fff;
    color: #07a8a3;
    border: 2px solid #07a8a3;
    border-radius: 10px;
    padding: 10px;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.limit-modal-ok-btn:hover {
    background-color: rgba(7, 168, 163, 0.08);
    color: #07a8a3;
}

a.profile-card-link {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.teaching-set-card-details {
    margin-top: 8px;
    padding-left: 52px;
}

/* Teaching Set Detail Page */
.ts-detail-cards {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 32px;
}

.ts-detail-card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: var(--radius-lg);
    padding: 20px 24px;
}

.ts-detail-card-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.15rem;
    background-color: #663166;
    flex-shrink: 0;
}

.ts-detail-card-body {
    flex: 1;
    min-width: 0;
}

.ts-detail-card-label {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #888;
    margin-bottom: 4px;
}

.ts-detail-card-value {
    font-size: 1.05rem;
    font-weight: 500;
    color: #333;
    margin-bottom: 0;
}

.ts-output-section {
    margin-bottom: 32px;
}

.ts-output-heading {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ts-output-description {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 12px;
}

.ts-output-textarea {
    width: 100%;
    min-height: 400px;
    padding: 16px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.85rem;
    line-height: 1.5;
    border: 1px solid #dee2e6;
    border-radius: var(--radius-sm);
    background-color: #f8f9fa;
    color: #333;
    resize: vertical;
}

.ts-stale-alert {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffc107;
    border-radius: var(--radius-lg);
    padding: 12px 16px;
    font-size: 0.9rem;
    margin-bottom: 24px;
}

.ts-stale-alert i {
    margin-right: 6px;
}

.ts-detail-actions {
    display: flex;
    gap: 12px;
}

@media (max-width: 768px) {
    .profiles-header {
        flex-direction: column;
        align-items: stretch;
    }

    .profiles-header h1 {
        font-size: 1.4rem;
    }

    .top-bar-title-center {
        left: 50%;
    }
}

/* =============================================
   Profile Completion / Onboarding Page
   ============================================= */

.profile-completion-bg {
    background-color: #f8f9fa;
}

.onboarding-wrapper {
    max-width: 640px;
    margin: 0 auto;
    padding: 20px 16px 40px;
}

.onboarding-breadcrumb {
    font-size: 0.85rem;
    color: #9ca3af;
    margin-bottom: 16px;
}

.onboarding-card {
    background: #fff;
    padding: 40px 36px;
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

.onboarding-card .form-control {
    border: 1px solid #d1d5db;
    border-radius: var(--radius-sm);
    padding: 10px 14px;
}

.onboarding-card .form-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #333;
}

.btn-teal {
    background-color: #07a8a3;
    color: #fff;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 1rem;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.btn-teal:hover {
    background-color: #069793;
    color: #fff;
}

@media (max-width: 520px) {
    .onboarding-card {
        padding: 28px 20px;
    }
}

/* =============================================
   Onboarding Tour (Driver.js overrides)
   ============================================= */
.driver-popover {
    max-width: 420px;
    padding: 20px 22px;
    border-radius: 18px;
    box-shadow: 0 12px 32px rgba(102, 49, 102, 0.22);
}

.driver-popover-title {
    color: #663166;
    font-size: 1.05rem;
    font-weight: 600;
}

.driver-popover-description {
    color: #444;
    font-size: 0.95rem;
    line-height: 1.5;
}

.driver-popover-next-btn,
.driver-popover-close-btn {
    background-color: #663166;
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 6px 18px;
    font-size: 0.9rem;
    text-shadow: none;
}

.driver-popover-next-btn:hover,
.driver-popover-close-btn:hover {
    background-color: #4a2040;
}

.driver-popover-prev-btn {
    color: #663166;
    border: 1px solid #663166;
    border-radius: 999px;
    padding: 6px 18px;
    font-size: 0.9rem;
}

.driver-popover-prev-btn:hover {
    background-color: #f3e8f3;
}

button.driver-popover-skip-btn {
    background: none;
    border: none;
    color: #888;
    font-size: 0.85rem;
    padding: 4px 8px;
    cursor: pointer;
}

button.driver-popover-skip-btn:hover {
    color: #555;
}

/* =============================================
   Teaching Set Generation — Loading Overlay
   ============================================= */
.ts-generating-overlay {
    position: fixed;
    inset: 0;
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(247, 247, 250, 0.2);
    pointer-events: auto;
    animation: charlie-overlay-in 0.2s ease-out;
}

@keyframes charlie-overlay-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.wizard-generating-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.charlie-chomp-loader {
    width: 200px;
    height: 200px;
}

.charlie-chomp-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.wizard-generating-loader-text {
    color: #6c757d;
    font-size: 0.95rem;
    margin: 0;
}

/* =============================================
   Teaching Set Generation — Ready Screen
   ============================================= */
.ts-ready-screen {
    max-width: 960px;
    margin: 0 auto;
}

.ts-ready-header {
    margin-bottom: 20px;
}

.ts-ready-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 4px;
}

.ts-ready-header p {
    color: #6c757d;
    margin-bottom: 0;
}

.ts-ready-card {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 20px;
}

.ts-ready-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.ts-ready-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 4px;
}

.ts-ready-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
    font-size: 0.85rem;
    color: #6c757d;
}

.ts-ready-meta strong {
    color: #1a1a2e;
    font-weight: 500;
}

.ts-ready-meta a {
    color: #6c757d;
    text-decoration: none;
}

.ts-ready-meta a:hover {
    color: #663166;
    text-decoration: underline;
}

.ts-ready-badge {
    flex-shrink: 0;
    background-color: #e3f7ec;
    color: #1a8a4c;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 999px;
    white-space: nowrap;
}

.ts-ready-stats {
    display: flex;
    gap: 20px;
    font-size: 0.85rem;
    color: #6c757d;
    margin-bottom: 16px;
}

.ts-ready-stats i {
    margin-right: 6px;
}

.ts-ready-list {
    list-style: none;
    padding: 0;
    margin: 0 0 20px;
    font-size: 0.9rem;
    color: #333;
}

.ts-ready-list li {
    padding: 4px 0;
}

.ts-ready-list li::before {
    content: '\2022';
    color: #663166;
    font-weight: 700;
    display: inline-block;
    width: 1em;
}

.ts-ready-download-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 48px;
    border: none;
    border-radius: var(--radius-lg);
    background-color: #4a2040;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 500;
}

.ts-ready-note {
    text-align: center;
    font-size: 0.8rem;
    color: #999;
    margin: 12px 0 0;
}

/* ---- Generation progress ---- */

.gen-section {
    text-align: center;
    padding: 20px 0 0;
}

.gen-section h2 {
    font-size: 1.15rem;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 20px;
}

.gen-progress-wrap {
    position: relative;
    height: 72px;
    background: #eee;
    border-radius: 36px;
    overflow: visible;
    margin-bottom: 12px;
}

.gen-progress-fill {
    position: absolute;
    inset: 0;
    width: 0%;
    background: linear-gradient(90deg, #663166, #07A8A3);
    border-radius: 36px;
    transition: width 0.6s ease;
    overflow: hidden;
    z-index: 2;
}

.gen-progress-chomp {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    z-index: 3;
    transition: left 0.6s ease;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,0.15));
}

.gen-progress-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 600;
    color: #888;
    z-index: 1;
    pointer-events: none;
}

.gen-progress-text-filled {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
    z-index: 2;
    pointer-events: none;
    clip-path: inset(0 100% 0 0);
    transition: clip-path 0.6s ease;
}

.gen-hint {
    font-size: 0.85rem;
    color: #6c757d;
    margin-top: 4px;
}

.gen-generate-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 48px;
    border: none;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, #663166, #07A8A3);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s;
}

.gen-generate-btn:hover {
    opacity: 0.9;
}

.gen-generate-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.gen-download-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 48px;
    border: none;
    border-radius: var(--radius-lg);
    background-color: #07a8a3;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s;
}

.gen-download-btn:hover {
    opacity: 0.9;
}

.gen-download-purple {
    background-color: #663166;
}

.gen-download-mint {
    background-color: #07a8a3;
}

/* Pop-up after clicking "Download ZIP" (templates/includes/download_started_dialog.html).
   Sizes and colours follow the Figma frame "Pop Up After clicking the download button". */
.download-dialog {
    box-sizing: border-box;
    width: min(92vw, 800px);
    max-width: none;
    padding: 32px;
    border: 1px solid #f3f4f6;
    border-radius: 4px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
}

.download-dialog[open] {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 24px;
}

.download-dialog::backdrop {
    background: rgba(26, 26, 46, 0.45);
}

.download-dialog-copy {
    width: 100%;
    text-align: center;
}

.download-dialog-title {
    margin: 0 0 8px;
    font-size: 1rem;
    font-weight: 500;
    color: #663166;
}

.download-dialog-text {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.5;
    color: #6b7280;
}

.download-dialog-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 100%;
    height: 40px;
    border-radius: 4px;
    background: #07a8a3;
    color: #fff;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    transition: opacity 0.2s;
}

.download-dialog-btn:hover {
    color: #fff;
    opacity: 0.9;
}

.download-dialog-btn:focus-visible {
    outline: 2px solid #17a2b8;
    outline-offset: 2px;
}

.gen-cancel-link {
    display: inline-block;
    font-size: 0.82rem;
    color: #6c757d;
    text-decoration: underline;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
}

.gen-cancel-link:hover {
    color: #dc3545;
}

@keyframes gen-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.gen-progress-fill.gen-active {
    animation: gen-pulse 2s ease-in-out infinite;
}
