/**
 * Tutis Enrolment Wizard — Styles
 *
 * Single-page 4-step wizard: Course → Details → Payment → Confirm
 */

/* ==========================================================================
   Wizard Container
   ========================================================================== */

.tse-wizard {
    max-width: var(--tse-form-max-width, 900px);
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    color: #1e293b;
    -webkit-font-smoothing: antialiased;
}

.tse-wizard *,
.tse-wizard *::before,
.tse-wizard *::after {
    box-sizing: border-box;
}

/* ==========================================================================
   Header — Logo + Stepper
   ========================================================================== */

.tse-wizard-header {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    padding: 20px 28px;
    border-radius: 12px 12px 0 0;
    border-bottom: 1px solid #e2e8f0;
}

.tse-wizard-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
}

.tse-wizard-brand-icon {
    width: 32px;
    height: 32px;
    background: #5b4799;
    color: #fff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
}

/* Stepper */
.tse-wizard-stepper {
    display: flex;
    align-items: center;
    gap: 0;
}

.tse-wizard-step-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 500;
    color: #94a3b8;
    white-space: nowrap;
    cursor: default;
}

.tse-wizard-step-indicator .step-number {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 2px solid #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: #94a3b8;
    background: #fff;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.tse-wizard-step-indicator .step-label {
    transition: color 0.3s ease;
}

/* Connector line between steps */
.tse-wizard-step-connector {
    width: 32px;
    height: 2px;
    background: #e2e8f0;
    transition: background 0.3s ease;
}

/* Active step */
.tse-wizard-step-indicator.active .step-number {
    background: var(--tse-primary, #5b4799);
    border-color: var(--tse-primary, #5b4799);
    color: var(--tse-btn-fg, #fff);
}

.tse-wizard-step-indicator.active .step-label {
    color: var(--tse-primary, #5b4799);
    font-weight: 600;
}

/* Completed step */
.tse-wizard-step-indicator.completed .step-number {
    background: var(--tse-accent, #16a34a);
    border-color: var(--tse-accent, #16a34a);
    color: var(--tse-btn-fg, #fff);
}

.tse-wizard-step-indicator.completed .step-label {
    color: var(--tse-accent, #16a34a);
}

.tse-wizard-step-connector.completed {
    background: var(--tse-accent, #16a34a);
}

/* ── Progress style: bar ── */
.tse-wizard-progress-bar {
    display: flex;
    align-items: center;
    width: 100%;
    background: var(--tse-bg, #fff);
    padding: 16px 28px;
    border-radius: 12px 12px 0 0;
    border-bottom: 1px solid var(--tse-border, #e2e8f0);
}

.tse-wizard-progress-bar::before {
    content: '';
    display: block;
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: var(--tse-border, #e2e8f0);
    position: relative;
    overflow: hidden;
}

.tse-wizard-progress-bar-fill {
    /* Width set dynamically by JS based on current step / total steps */
    height: 6px;
    margin-top: -6px;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--tse-accent, #16a34a), var(--tse-primary, #5b4799));
    transition: width 0.4s ease;
    width: 0;
    pointer-events: none;
    align-self: flex-start;
}

/* ── Progress style: dots ── */
.tse-wizard-stepper-dots {
    gap: 10px;
    justify-content: center;
}

.tse-wizard-step-dot {
    width: 12px;
    height: 12px;
    padding: 0;
    border-radius: 50%;
    background: var(--tse-border, #e2e8f0);
    transition: background 0.2s, transform 0.2s;
}

.tse-wizard-step-dot.active {
    background: var(--tse-primary, #5b4799);
    transform: scale(1.2);
}

.tse-wizard-step-dot.completed {
    background: var(--tse-accent, #16a34a);
}

/* ==========================================================================
   Body — Step Content Card
   ========================================================================== */

.tse-wizard-body {
    background: #f8fafc;
    padding: 32px;
    min-height: 400px;
}

.tse-wizard-step-panel {
    display: none;
}

.tse-wizard-step-panel.active {
    display: block;
}

.tse-wizard-card {
    background: var(--tse-bg, #fff);
    border: 1px solid var(--tse-border, #e2e8f0);
    border-radius: 12px;
    padding: var(--tse-card-padding, 32px 40px);
    max-width: var(--tse-form-max-width, 700px);
    margin: 0 auto;
}

.tse-wizard-card-title {
    text-align: center;
    margin: 0 0 4px;
    font-size: 22px;
    font-weight: 600;
    color: #1e293b;
}

.tse-wizard-card-subtitle {
    text-align: center;
    margin: 0 0 24px;
    font-size: 14px;
    color: #64748b;
}

/* ==========================================================================
   Course Badge
   ========================================================================== */

.tse-wizard-course-badges-wrap {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 24px;
}

.tse-wizard-course-badge {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    font-size: 14px;
    color: #1e293b;
    border-bottom: 1px solid #e2e8f0;
}

.tse-wizard-course-badge:last-of-type {
    border-bottom: none;
}

.tse-wizard-course-badge .badge-label {
    font-weight: 500;
}

.tse-wizard-course-badge .badge-fee {
    color: #5b4799;
    font-weight: 600;
}

.tse-wizard-course-badge .badge-remove {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 18px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    margin-left: 8px;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
}

.tse-wizard-course-badge .badge-remove:hover {
    color: #dc2626;
    background: #fee2e2;
}

.tse-wizard-change-courses {
    display: inline-block;
    margin-top: 8px;
    font-size: 13px;
    color: #5b4799;
    text-decoration: none;
}

.tse-wizard-change-courses:hover {
    text-decoration: underline;
}

.tse-wizard-course-total {
    padding-top: 12px;
    margin-top: 4px;
    border-top: 2px solid #cbd5e1;
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
    text-align: right;
}

/* ==========================================================================
   Step 1 — Login / Create Account
   ========================================================================== */

.tse-wizard-login-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 24px 0;
    color: #94a3b8;
    font-size: 13px;
    font-weight: 500;
}

.tse-wizard-login-divider::before,
.tse-wizard-login-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #e2e8f0;
}

.tse-wizard-login-divider span {
    padding: 0 16px;
}

.tse-wizard-new-student {
    text-align: center;
}

.tse-wizard-new-student-text {
    font-size: 14px;
    color: #64748b;
    margin: 0;
}

.tse-wizard-new-student-link {
    color: #5b4799;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s;
}

.tse-wizard-new-student-link:hover {
    color: #4c3d80;
    text-decoration: underline;
}

#tse-wizard-login-result {
    margin-top: 16px;
}

#tse-wizard-find-account {
    margin-top: 8px;
}

/* ==========================================================================
   Form Fields — Compact Layout
   ========================================================================== */

.tse-wizard-form {
    margin-top: 8px;
}

.tse-wizard-section {
    margin-bottom: 20px;
}

.tse-wizard-section-title {
    font-size: 14px;
    font-weight: 600;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f1f5f9;
}

.tse-wizard-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 0;
}

.tse-wizard-row .tse-wizard-field {
    margin-bottom: 0;
}

.tse-wizard-field {
    margin-bottom: 16px;
}

.tse-wizard-field label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--tse-label, #374151);
    margin-bottom: 4px;
}

.tse-wizard-field .field-required {
    color: #ef4444;
    margin-left: 1px;
}

.tse-wizard-field input[type="text"],
.tse-wizard-field input[type="email"],
.tse-wizard-field input[type="tel"],
.tse-wizard-field input[type="number"],
.tse-wizard-field input[type="date"],
.tse-wizard-field select,
.tse-wizard-field textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--tse-border, #d1d5db);
    border-radius: var(--tse-field-radius, 6px);
    font-size: 14px;
    font-family: inherit;
    color: #1e293b;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.tse-wizard-field input::placeholder,
.tse-wizard-field select::placeholder {
    color: #9ca3af;
}

.tse-wizard-field input:focus,
.tse-wizard-field select:focus,
.tse-wizard-field textarea:focus {
    outline: none;
    border-color: var(--tse-primary, #5b4799);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--tse-primary, #5b4799) 15%, transparent);
}

.tse-wizard-field input.error,
.tse-wizard-field select.error {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.tse-wizard-field .field-error {
    display: none;
    font-size: 12px;
    color: #ef4444;
    margin-top: 3px;
}

.tse-wizard-field.has-error .field-error {
    display: block;
}

.tse-wizard-field .field-help-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    font-size: 14px;
    color: #9ca3af;
    cursor: help;
    margin-left: 4px;
    vertical-align: middle;
    position: relative;
}
.tse-wizard-field .field-help-icon:hover {
    color: #5C4EE5;
}

/* Checkbox */
.tse-wizard-field-checkbox label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.tse-wizard-field-checkbox input[type="checkbox"] {
    width: auto;
    margin: 0;
}

/* Checkbox group */
.tse-wizard-checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.tse-wizard-checkbox-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: normal;
    font-size: 13px;
    cursor: pointer;
}

/* File upload */
.tse-wizard-field input[type="file"] {
    padding: 8px;
    background: #f9fafb;
    border: 2px dashed #d1d5db;
    border-radius: 6px;
    cursor: pointer;
    width: 100%;
}

.tse-wizard-field input[type="file"]:hover {
    border-color: #5b4799;
}

/* ==========================================================================
   Step 1 — Course Selection
   ========================================================================== */

.tse-wizard-courses-loading {
    text-align: center;
    padding: 40px 20px;
    color: #64748b;
}

.tse-wizard-course-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.tse-wizard-course-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    transition: border-color 0.2s, box-shadow 0.2s;
    gap: 12px;
}

.tse-wizard-course-item:hover {
    border-color: #5b4799;
    box-shadow: 0 1px 4px rgba(91, 71, 153, 0.08);
}

.tse-wizard-course-item.selected {
    border-color: #5b4799;
    background: #faf5ff;
}

.tse-wizard-course-info {
    flex: 1;
    min-width: 0;
}

.tse-wizard-course-name {
    font-weight: 600;
    font-size: 14px;
    color: #1e293b;
    margin-bottom: 2px;
}

.tse-wizard-course-meta {
    font-size: 12px;
    color: #64748b;
}

.tse-wizard-course-meta span {
    margin-right: 12px;
}

.tse-wizard-course-price {
    font-weight: 600;
    font-size: 15px;
    color: #1e293b;
    white-space: nowrap;
    margin-right: 12px;
}

.tse-wizard-course-price.free {
    color: #16a34a;
}

.tse-wizard-course-select-btn {
    padding: 6px 16px;
    border: 1px solid #5b4799;
    border-radius: 6px;
    background: #fff;
    color: #5b4799;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.tse-wizard-course-select-btn:hover {
    background: #5b4799;
    color: #fff;
}

.tse-wizard-course-select-btn.selected {
    background: #5b4799;
    color: #fff;
}

/* Selected courses summary */
.tse-wizard-selection-summary {
    background: #f5f0ff;
    border: 1px solid #ddd6fe;
    border-radius: 8px;
    padding: 16px;
    margin-top: 16px;
}

.tse-wizard-selection-summary h4 {
    margin: 0 0 8px;
    font-size: 14px;
    color: #5b4799;
}

.tse-wizard-selection-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 13px;
}

.tse-wizard-selection-item .remove-btn {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    font-size: 16px;
    padding: 0 4px;
    line-height: 1;
}

.tse-wizard-selection-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
    margin-top: 10px;
    border-top: 1px solid #ddd6fe;
    font-weight: 600;
    font-size: 15px;
    color: #1e293b;
}

/* Course filter bar */
.tse-wizard-course-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.tse-wizard-course-filters input,
.tse-wizard-course-filters select {
    padding: 7px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    flex: 1;
    min-width: 140px;
}

.tse-wizard-course-filters input:focus,
.tse-wizard-course-filters select:focus {
    outline: none;
    border-color: #5b4799;
}

.tse-wizard-no-courses {
    text-align: center;
    padding: 32px 16px;
    color: #64748b;
    font-size: 14px;
}

/* ==========================================================================
   Step 3 — Payment
   ========================================================================== */

.tse-wizard-payment-summary {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 24px;
}

.tse-wizard-payment-summary h4 {
    margin: 0 0 12px;
    font-size: 15px;
    font-weight: 600;
}

.tse-wizard-payment-line {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 14px;
    color: #475569;
}

.tse-wizard-payment-discount {
    color: #16a34a;
    font-weight: 500;
}

.tse-wizard-payment-total {
    display: flex;
    justify-content: space-between;
    padding-top: 10px;
    margin-top: 8px;
    border-top: 1px solid #e2e8f0;
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
}

.tse-wizard-stripe-container {
    min-height: 300px;
    margin-bottom: 16px;
}

.tse-wizard-secure-notice {
    text-align: center;
    font-size: 12px;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.tse-wizard-custom-content {
    padding: 12px 0;
    font-size: 14px;
    line-height: 1.6;
    color: #475569;
}

.tse-wizard-terms-notice {
    padding: 12px 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    color: #64748b;
    margin-bottom: 16px;
    line-height: 1.5;
}

.tse-wizard-confirm-header-img {
    display: block;
    margin: 0 auto 16px;
}

/* ==========================================================================
   Step 4 — Confirmation
   ========================================================================== */

.tse-wizard-confirm-success {
    text-align: center;
    padding: 32px 20px;
}

.tse-wizard-confirm-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    margin: 0 auto 16px;
}

.tse-wizard-confirm-icon.success {
    background: #dcfce7;
    color: #16a34a;
}

.tse-wizard-confirm-icon.error {
    background: #fee2e2;
    color: #ef4444;
}

.tse-wizard-confirm-icon.pending {
    background: #f5f0ff;
    color: #5b4799;
}

.tse-wizard-confirm-title {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 8px;
}

.tse-wizard-confirm-message {
    font-size: 14px;
    color: #64748b;
    margin: 0 0 24px;
}

.tse-wizard-confirm-details {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    text-align: left;
    margin-top: 20px;
}

.tse-wizard-confirm-details table {
    width: 100%;
    font-size: 14px;
}

.tse-wizard-confirm-details th {
    text-align: left;
    color: #64748b;
    font-weight: normal;
    padding: 6px 16px 6px 0;
    white-space: nowrap;
}

.tse-wizard-confirm-details td {
    padding: 6px 0;
    font-weight: 500;
}

/* Processing spinner */
.tse-wizard-processing {
    text-align: center;
    padding: 48px 20px;
}

.tse-wizard-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e2e8f0;
    border-top-color: #5b4799;
    border-radius: 50%;
    animation: tse-wizard-spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

@keyframes tse-wizard-spin {
    to { transform: rotate(360deg); }
}

/* ==========================================================================
   Footer — Actions + Help
   ========================================================================== */

.tse-wizard-footer {
    background: #fff;
    padding: 16px 28px;
    border-radius: 0 0 12px 12px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tse-wizard-footer-help {
    font-size: 13px;
    color: #94a3b8;
}

.tse-wizard-footer-help a {
    color: #5b4799;
    text-decoration: none;
    font-weight: 500;
}

.tse-wizard-footer-help a:hover {
    text-decoration: underline;
}

.tse-wizard-footer-actions {
    display: flex;
    gap: 10px;
}

/* Wizard Buttons */
.tse-wizard-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: var(--tse-btn-padding, 10px 24px);
    border: none;
    border-radius: var(--tse-btn-radius, 8px);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    line-height: 1.4;
}

.tse-wizard-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.tse-wizard-btn-primary {
    background: var(--tse-btn-bg, #5b4799);
    color: var(--tse-btn-fg, #fff);
}

.tse-wizard-btn-primary:hover:not(:disabled) {
    filter: brightness(0.9);
}

.tse-wizard-btn-secondary {
    background: #f1f5f9;
    color: #475569;
}

.tse-wizard-btn-secondary:hover:not(:disabled) {
    background: #e2e8f0;
}

/* Error summary */
.tse-wizard-error-summary {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 16px;
}

.tse-wizard-error-summary ul {
    margin: 8px 0 0;
    padding-left: 20px;
}

/* ==========================================================================
   Notice banners (inside wizard)
   ========================================================================== */

.tse-wizard-notice {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 13px;
}

.tse-wizard-notice-warning {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}

.tse-wizard-notice-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.tse-wizard-notice-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

/* ==========================================================================
   Outer wrapper — shadow + rounding
   ========================================================================== */

.tse-wizard-wrap {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.04);
    border: 1px solid #e2e8f0;
    margin: 20px 0;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
    .tse-wizard-header {
        flex-direction: column;
        gap: 12px;
        padding: 14px 16px;
    }

    .tse-wizard-stepper {
        width: 100%;
        justify-content: center;
    }

    .tse-wizard-step-indicator .step-label {
        display: none;
    }

    .tse-wizard-step-connector {
        width: 20px;
    }

    .tse-wizard-body {
        padding: 20px 16px;
    }

    .tse-wizard-card {
        padding: 24px 20px;
    }

    .tse-wizard-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .tse-wizard-row .tse-wizard-field {
        margin-bottom: 16px;
    }

    .tse-wizard-footer {
        flex-direction: column;
        gap: 12px;
        padding: 14px 16px;
    }

    .tse-wizard-footer-actions {
        width: 100%;
    }

    .tse-wizard-btn {
        flex: 1;
        justify-content: center;
    }

    .tse-wizard-course-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .tse-wizard-course-price {
        margin-right: 0;
    }

    .tse-wizard-course-filters {
        flex-direction: column;
    }

    .tse-wizard-course-filters input,
    .tse-wizard-course-filters select {
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .tse-wizard-card-title {
        font-size: 18px;
    }

    .tse-wizard-step-connector {
        width: 12px;
    }

    .tse-wizard-step-indicator {
        padding: 4px 6px;
    }

    .tse-wizard-step-indicator .step-number {
        width: 24px;
        height: 24px;
        font-size: 11px;
    }
}

/* ==========================================================================
   Conditional Fields
   ========================================================================== */

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

.tse-wizard-field-disabled {
    opacity: 0.45;
    pointer-events: none;
}

.tse-wizard-field-disabled input,
.tse-wizard-field-disabled select,
.tse-wizard-field-disabled textarea {
    background-color: #f1f5f9;
    cursor: not-allowed;
}

/* ==========================================================================
   Section Headings & Descriptions (within form pages)
   ========================================================================== */

.tse-wizard-section-heading {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 24px 0 8px;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
}

.tse-wizard-section-heading:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.tse-wizard-section-desc {
    font-size: 14px;
    color: #64748b;
    margin: 0 0 16px;
    line-height: 1.5;
}

/* ==========================================================================
   Identity-First Flow
   ========================================================================== */

.tse-wizard-identity-section {
    padding-bottom: 20px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e2e8f0;
}

.tse-identity-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 20px;
}

.tse-identity-tab {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 0.2s, border-color 0.2s;
    cursor: pointer;
}

.tse-identity-tab:hover {
    color: #374151;
}

.tse-identity-tab.active {
    color: #5b4799;
    border-bottom-color: #5b4799;
}

.tse-wizard-identity-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 16px;
}

.tse-wizard-identity-actions .tse-wizard-btn {
    white-space: nowrap;
}

.tse-wizard-identity-status {
    flex: 1;
}

.tse-wizard-identity-found {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 14px;
}

.tse-identity-search-again {
    margin-left: 8px;
    color: #166534;
    text-decoration: underline;
    font-size: 13px;
}

.tse-identity-search-again:hover {
    color: #14532d;
}

.tse-wizard-identity-new {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 14px;
}

/* Remaining fields — force single-column layout (override theme grid/flex) */
.tse-wizard-remaining-fields {
    position: relative;
    display: flex;
    flex-direction: column;
}

.tse-wizard-remaining-fields > .tse-wizard-field {
    width: 100%;
}

.tse-wizard-fields-locked {
    opacity: 0.4;
    pointer-events: none;
    user-select: none;
}

.tse-wizard-locked-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 40px;
}

.tse-wizard-locked-overlay span {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #64748b;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
}

/* Searchable Select */
.tse-searchable-select {
    position: relative;
}

.tse-searchable-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    color: #1f2937;
    background: #fff;
    box-sizing: border-box;
    transition: border-color 0.15s;
}

.tse-searchable-input:focus {
    outline: none;
    border-color: #5C4EE5;
    box-shadow: 0 0 0 3px rgba(92, 78, 229, 0.1);
}

.tse-searchable-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 220px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #d1d5db;
    border-top: none;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 100;
}

.tse-searchable-option {
    padding: 8px 12px;
    font-size: 14px;
    color: #374151;
    cursor: pointer;
    transition: background 0.1s;
}

.tse-searchable-option:hover {
    background: #f3f4f6;
}

.tse-searchable-option.selected {
    background: #ede9fe;
    color: #5C4EE5;
    font-weight: 500;
}

.tse-searchable-no-results {
    padding: 10px 12px;
    font-size: 13px;
    color: #9ca3af;
    font-style: italic;
}

/* =========================================================================
   Enrolment Code Gate
   ========================================================================= */

.tse-code-gate {
    display: none;
    padding: 48px 24px;
    text-align: center;
}

.tse-code-gate-card {
    max-width: 440px;
    margin: 0 auto;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 40px 32px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.04);
}

.tse-code-gate-icon {
    font-size: 40px;
    margin-bottom: 12px;
}

.tse-code-gate-title {
    font-size: 20px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 8px;
}

.tse-code-gate-desc {
    font-size: 14px;
    color: #64748b;
    margin: 0 0 24px;
    line-height: 1.5;
}

.tse-code-gate-field {
    margin-bottom: 16px;
}

.tse-code-gate-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    text-align: center;
    letter-spacing: 1px;
    color: #1e293b;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.tse-code-gate-input:focus {
    outline: none;
    border-color: #5b4799;
    box-shadow: 0 0 0 3px rgba(91, 71, 153, 0.1);
}

.tse-code-gate-input.error {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.tse-code-gate-error {
    color: #ef4444;
    font-size: 13px;
    margin-top: 8px;
}

.tse-code-gate-btn {
    width: 100%;
    padding: 12px 24px;
    font-size: 15px;
}

/* Shake animation on wrong code */
.tse-code-gate-shake {
    animation: tse-code-shake 0.4s ease;
}

@keyframes tse-code-shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-8px); }
    40% { transform: translateX(8px); }
    60% { transform: translateX(-6px); }
    80% { transform: translateX(6px); }
}

/* Brief green flash on auto-filled fields (used by identity prefill from Tutis lookup) */
.tse-field-autofilled {
    animation: tse-autofill-flash 1.5s ease;
}

@keyframes tse-autofill-flash {
    0%   { background-color: #d1fae5; }
    100% { background-color: transparent; }
}

/* ─── Landing page step ─────────────────────────────────────── */
.tse-wizard-landing-panel .tse-wizard-card {
    max-width: 760px;
}

.tse-wizard-landing-content {
    line-height: 1.6;
    color: #334155;
    font-size: 15px;
}

.tse-wizard-landing-content h1,
.tse-wizard-landing-content h2,
.tse-wizard-landing-content h3,
.tse-wizard-landing-content h4 {
    color: #1e293b;
    margin-top: 1.4em;
}

.tse-wizard-landing-content h1:first-child,
.tse-wizard-landing-content h2:first-child,
.tse-wizard-landing-content h3:first-child {
    margin-top: 0;
}

.tse-wizard-landing-content p {
    margin: 0 0 1em;
}

.tse-wizard-landing-content ul,
.tse-wizard-landing-content ol {
    margin: 0 0 1em 1.5em;
}

.tse-wizard-landing-content img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
}

.tse-landing-course-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 8px;
}

.tse-landing-divider {
    border: none;
    border-top: 1px solid #e2e8f0;
    margin: 24px 0;
}

.tse-wizard-landing-summary {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e2e8f0;
}

.tse-wizard-field-help {
    margin: 6px 0 0;
    font-size: 13px;
    color: #475569;
    line-height: 1.5;
}

.tse-wizard-radio-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tse-wizard-radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: normal;
    cursor: pointer;
    padding: 4px 0;
}

.tse-wizard-radio-label input[type="radio"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    margin: 0;
}

.tse-wizard-course-badge-readonly {
    cursor: default;
}

.tse-wizard-course-badge-readonly .badge-remove {
    display: none;
}
