/*!
 * Career DNA System — Tests CSS (dashboard, listing, landing, runner, result)
 */

/* ============================================================
 * SIDEBAR SHELL LAYOUT (participant + manager dashboards)
 * Flex-based (not grid) so collapse works reliably on desktop.
 * ============================================================ */
.cds-has-sidebar {
    display: flex;
    align-items: stretch;
    min-height: 100vh;
    background: var(--cds-bg);
    position: relative;
}

.cds-sidebar {
    width: 240px;
    flex: 0 0 240px;
    background: #fff;
    border-right: 1px solid var(--cds-border);
    padding: 18px 0 0;
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100dvh; /* bounds by dynamic viewport on mobile browsers */
    display: flex;
    flex-direction: column;
    transition: width 0.25s ease, flex-basis 0.25s ease, transform 0.25s ease;
    z-index: 40;
    overflow: hidden; /* outer sidebar never scrolls — only .cds-sidebar-nav does */
}
.cds-has-sidebar.is-collapsed .cds-sidebar {
    width: 72px;
    flex-basis: 72px;
}

.cds-sidebar-brand {
    padding: 0 18px 18px;
    border-bottom: 1px solid var(--cds-border);
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--cds-text);
    min-height: 32px;
    overflow: hidden;
}
.cds-sidebar-brand img { max-height: 28px; width: auto; flex-shrink: 0; }
.cds-sidebar-brand .cds-brand-mark {
    display: none;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--cds-primary);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    letter-spacing: 0.5px;
}
.cds-sidebar-brand .cds-wordmark {
    font-size: 17px;
    font-weight: 700;
    color: var(--cds-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}
.cds-has-sidebar.is-collapsed .cds-sidebar-brand { padding: 0 0 18px; justify-content: center; }
.cds-has-sidebar.is-collapsed .cds-sidebar-brand img { max-height: 24px; }
.cds-has-sidebar.is-collapsed .cds-sidebar-brand .cds-brand-mark { display: flex; }
.cds-has-sidebar.is-collapsed .cds-sidebar-brand .cds-wordmark { display: none; }

.cds-sidebar-nav {
    flex: 1 1 auto;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-height: 0;
    overflow-y: auto;
}
.cds-sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--cds-text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
    overflow: hidden;
    min-width: 0;
}
.cds-sidebar-link:hover { background: var(--cds-bg); color: var(--cds-primary); }
.cds-sidebar-link.is-active { background: #EFF6FF; color: var(--cds-primary); font-weight: 600; }
.cds-sidebar-link svg { width: 20px; height: 20px; flex-shrink: 0; }
.cds-sidebar-link span {
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    flex: 1 1 auto;
}
.cds-has-sidebar.is-collapsed .cds-sidebar-link {
    justify-content: center;
    padding: 10px;
    gap: 0;
}
.cds-has-sidebar.is-collapsed .cds-sidebar-link span { display: none; }

.cds-sidebar-footer {
    flex: 0 0 auto;
    padding: 12px;
    border-top: 1px solid var(--cds-border);
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: #fff;
}
.cds-sidebar-logout {
    color: #B91C1C;
}
.cds-sidebar-logout:hover {
    background: #FEF2F2;
    color: #991B1B;
}
.cds-sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 9px;
    background: transparent;
    border: 1px solid var(--cds-border);
    border-radius: 8px;
    color: var(--cds-muted);
    cursor: pointer;
    transition: all 0.15s;
    flex-shrink: 0;
}
.cds-sidebar-toggle:hover { background: var(--cds-bg); color: var(--cds-text); }
.cds-sidebar-toggle svg { width: 16px; height: 16px; transition: transform 0.25s; }
.cds-has-sidebar.is-collapsed .cds-sidebar-toggle svg { transform: rotate(180deg); }

/* Main column (everything to the right of the sidebar) */
.cds-main-col {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* Topbar (replaces the old .cds-dash-header when inside sidebar shell) */
.cds-dash-topbar {
    background: #fff;
    border-bottom: 1px solid var(--cds-border);
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 30;
    gap: 12px;
}
.cds-topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cds-topbar-title { font-size: 16px; font-weight: 600; color: var(--cds-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cds-mobile-toggle {
    display: none;
    background: transparent;
    border: 1px solid var(--cds-border);
    padding: 7px 9px;
    border-radius: 8px;
    cursor: pointer;
    color: var(--cds-text);
    align-items: center;
    justify-content: center;
}
.cds-mobile-toggle svg { width: 20px; height: 20px; }
.cds-topbar-user { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.cds-topbar-user img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.cds-topbar-user .cds-topbar-username { font-size: 14px; font-weight: 500; color: var(--cds-text); }

/* Sidebar overlay for mobile */
.cds-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, 0.45);
    z-index: 35;
    animation: cdsFadeIn 0.2s ease;
}
@keyframes cdsFadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Mobile responsive */
@media (max-width: 900px) {
    .cds-has-sidebar { display: block; }
    .cds-sidebar,
    .cds-has-sidebar.is-collapsed .cds-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        height: 100vh;
        height: 100dvh;
        width: 272px;
        flex-basis: 272px;
        transform: translateX(-100%);
        box-shadow: 2px 0 24px rgba(0,0,0,0.1);
    }
    .cds-has-sidebar.is-mobile-open .cds-sidebar { transform: translateX(0); }
    .cds-has-sidebar.is-mobile-open .cds-sidebar-overlay { display: block; }
    .cds-mobile-toggle { display: flex; }
    /* Keep collapse toggle hidden on mobile, but KEEP logout visible in the footer */
    .cds-sidebar-footer .cds-sidebar-toggle { display: none; }
    .cds-topbar-username { display: none; }
    .cds-dash-topbar { padding: 12px 16px; }
    /* Reset collapsed styling on mobile so full-width drawer text always shows */
    .cds-has-sidebar.is-collapsed .cds-sidebar-brand { padding: 0 18px 18px; justify-content: flex-start; }
    .cds-has-sidebar.is-collapsed .cds-sidebar-brand .cds-wordmark { display: inline; }
    .cds-has-sidebar.is-collapsed .cds-sidebar-brand .cds-brand-mark { display: none; }
    .cds-has-sidebar.is-collapsed .cds-sidebar-link { justify-content: flex-start; padding: 10px 12px; gap: 12px; }
    .cds-has-sidebar.is-collapsed .cds-sidebar-link span { display: inline; }
}

/* ============================================================
 * SHARED DASHBOARD HEADER (dashboard + result)
 * ============================================================ */
.cds-dash-header {
    background: #fff;
    border-bottom: 1px solid var(--cds-border);
    padding: 14px 24px;
    position: sticky;
    top: 0;
    z-index: 50;
}
.cds-dash-header-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 28px;
}
.cds-dash-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--cds-text);
}
.cds-dash-brand img { max-height: 34px; }
.cds-dash-brand .cds-wordmark {
    font-size: 18px;
    font-weight: 700;
    color: var(--cds-primary);
    letter-spacing: -0.3px;
}
.cds-dash-nav {
    flex: 1;
    display: flex;
    gap: 4px;
}
.cds-dash-nav-link {
    padding: 8px 14px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--cds-muted);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.15s;
}
.cds-dash-nav-link:hover { color: var(--cds-primary); background: var(--cds-bg); }
.cds-dash-nav-link.is-active { color: var(--cds-primary); background: #EFF6FF; }

.cds-dash-user {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
}
.cds-dash-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--cds-border);
}
.cds-dash-username { font-weight: 500; color: var(--cds-text); }

/* ============================================================
 * DASHBOARD BODY
 * ============================================================ */
.cds-dashboard-page { background: var(--cds-bg); min-height: 100vh; }
.cds-dash-main { padding: 32px 20px 60px; }
.cds-dash-container { max-width: 1100px; margin: 0 auto; }

.cds-dash-hero {
    background: linear-gradient(135deg, var(--cds-primary), var(--cds-secondary));
    color: #fff;
    border-radius: 16px;
    padding: 32px 36px;
    margin-bottom: 32px;
}
.cds-dash-hero h1 { margin: 0 0 6px; font-size: 26px; font-weight: 600; letter-spacing: -0.3px; }
.cds-dash-hero p   { margin: 0; opacity: 0.9; }

.cds-dash-section { margin-bottom: 40px; }
.cds-dash-section h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--cds-text);
    margin: 0 0 16px;
}

.cds-empty-card {
    background: #fff;
    border: 2px dashed var(--cds-border);
    border-radius: 12px;
    padding: 40px;
    text-align: center;
}
.cds-empty-card h2 { margin: 0 0 8px; font-size: 18px; color: var(--cds-text); }
.cds-empty-card p { color: var(--cds-muted); margin: 0 0 20px; }

/* ============================================================
 * TEST CARD GRID
 * ============================================================ */
.cds-test-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}
.cds-test-card {
    background: #fff;
    border: 1px solid var(--cds-border);
    border-radius: 14px;
    overflow: hidden;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
}
.cds-test-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(17, 24, 39, 0.08);
    border-color: var(--cds-secondary);
}
.cds-test-card.cds-owned { border-color: var(--cds-primary); }

.cds-test-thumb {
    aspect-ratio: 16/9;
    background: var(--cds-bg);
    overflow: hidden;
}
.cds-test-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cds-test-thumb-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    background: linear-gradient(135deg, var(--cds-primary), var(--cds-secondary));
    color: #fff;
}

.cds-test-body { padding: 18px 20px; display: flex; flex-direction: column; flex: 1; }
.cds-test-body h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--cds-text);
    margin: 0 0 6px;
    line-height: 1.3;
}
.cds-test-body p { font-size: 13px; line-height: 1.5; margin: 0 0 12px; }
.cds-test-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--cds-muted);
    margin-bottom: 12px;
}
.cds-test-price {
    font-size: 18px;
    font-weight: 700;
    color: var(--cds-primary);
    margin-bottom: 14px;
}
.cds-test-actions {
    margin-top: auto;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.cds-test-actions .cds-btn { flex: 1; min-width: 120px; }

/* ============================================================
 * LISTING PAGE
 * ============================================================ */
.cds-listing-page { min-height: 100vh; background: var(--cds-bg); padding: 40px 20px; }
.cds-listing-shell { max-width: 1100px; margin: 0 auto; }
.cds-listing-header { text-align: center; margin-bottom: 36px; }
.cds-listing-header h1 {
    font-size: 32px;
    font-weight: 700;
    color: var(--cds-text);
    margin: 0 0 8px;
    letter-spacing: -0.5px;
}
.cds-listing-header p { color: var(--cds-muted); font-size: 15px; margin: 0; }
.cds-listing-footer { text-align: center; margin-top: 32px; font-size: 14px; }

/* 1.17.5 — Guest CTA banner shown at the bottom of /cds-tests/.
   Inspired by modern SaaS "connect with us" callouts: gradient background
   with bold/normal text on the left and a high-contrast pill CTA on the right.
   Stacks vertically on mobile (≤640px) so the button stays full-width tappable. */
.cds-listing-cta-banner {
    position: relative;
    overflow: hidden;
    margin: 56px auto 8px;
    max-width: 960px;
    padding: 36px 44px;
    border-radius: 24px;
    background: linear-gradient(135deg, #2563EB 0%, #4338CA 55%, #6366F1 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    box-shadow:
        0 24px 48px -16px rgba(37, 99, 235, 0.45),
        0 8px 24px -8px rgba(67, 56, 202, 0.30);
    isolation: isolate;
}

/* Decorative soft glow + radial highlight overlays. Pure CSS, no images. */
.cds-listing-cta-banner::before,
.cds-listing-cta-banner::after {
    content: "";
    position: absolute;
    pointer-events: none;
    z-index: 0;
}
.cds-listing-cta-banner::before {
    top: -60%;
    left: -10%;
    width: 60%;
    height: 220%;
    background: radial-gradient(ellipse at center, rgba(255,255,255,0.18) 0%, rgba(255,255,255,0) 60%);
    transform: rotate(-12deg);
}
.cds-listing-cta-banner::after {
    bottom: -50%;
    right: -10%;
    width: 55%;
    height: 200%;
    background: radial-gradient(ellipse at center, rgba(99, 102, 241, 0.55) 0%, rgba(99, 102, 241, 0) 60%);
}

/* Extra glowing orb for depth — sits above the gradients but below content. */
.cds-listing-cta-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 280px;
    height: 280px;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(255,255,255,0.12) 0%, rgba(255,255,255,0) 65%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

.cds-listing-cta-content {
    position: relative;
    z-index: 1;
    flex: 1 1 auto;
    min-width: 0;
}
/* Parent-scoped selectors so we beat .cds-app h3 / .cds-app p (specificity
   0,0,1,1) which sets color to var(--cds-text) and font-size to 18px in
   cds-frontend.css. Without this prefix our white + 26px would be silently
   overridden and the text would render dark and small on the gradient. */
.cds-listing-cta-banner .cds-listing-cta-title {
    margin: 0 0 8px;
    font-size: 26px;
    line-height: 1.2;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.01em;
}
.cds-listing-cta-banner .cds-listing-cta-subtitle {
    margin: 0;
    font-size: 15px;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.92);
    font-weight: 400;
    max-width: 540px;
}

.cds-listing-cta-action {
    position: relative;
    z-index: 1;
    flex: 0 0 auto;
}
.cds-listing-cta-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 28px;
    background: #fff;
    color: #2563EB;
    border-radius: 100px;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.15);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}
.cds-listing-cta-btn:hover,
.cds-listing-cta-btn:focus {
    background: #F8FAFC;
    color: #1E40AF;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.22);
}
.cds-listing-cta-btn:active {
    transform: translateY(0);
}
.cds-listing-cta-arrow {
    display: inline-block;
    transition: transform 0.2s ease;
}
.cds-listing-cta-btn:hover .cds-listing-cta-arrow,
.cds-listing-cta-btn:focus .cds-listing-cta-arrow {
    transform: translateX(4px);
}

/* Tablet — slightly tighter padding, smaller title. */
@media (max-width: 900px) {
    .cds-listing-cta-banner {
        padding: 32px 36px;
        gap: 24px;
        margin-top: 48px;
    }
    .cds-listing-cta-banner .cds-listing-cta-title { font-size: 23px; }
    .cds-listing-cta-banner .cds-listing-cta-subtitle { font-size: 14.5px; }
}

/* Mobile — stack vertically, full-width button, tighter spacing. */
@media (max-width: 640px) {
    .cds-listing-cta-banner {
        flex-direction: column;
        align-items: stretch;
        text-align: left;
        padding: 28px 24px;
        gap: 22px;
        margin-top: 40px;
        border-radius: 20px;
    }
    .cds-listing-cta-glow {
        width: 220px;
        height: 220px;
    }
    .cds-listing-cta-banner .cds-listing-cta-title {
        font-size: 21px;
    }
    .cds-listing-cta-banner .cds-listing-cta-subtitle {
        font-size: 14px;
    }
    .cds-listing-cta-action {
        width: 100%;
    }
    .cds-listing-cta-btn {
        width: 100%;
        padding: 14px 20px;
        font-size: 15px;
    }
}

/* Very small phones — keep everything still readable and tappable. */
@media (max-width: 380px) {
    .cds-listing-cta-banner {
        padding: 24px 20px;
        border-radius: 18px;
    }
    .cds-listing-cta-banner .cds-listing-cta-title { font-size: 19px; }
}

/* ============================================================
 * 1.18.0 — GUEST BUY FORM (test-landing.php, logged-out path)
 * Inline register-and-buy card that replaces the old "Log in to
 * purchase" button. Removes the bounce-to-login friction so a
 * first-time visitor can convert without leaving the landing page.
 * ============================================================ */
.cds-guest-buy-card {
    background: #fff;
    border: 1px solid #E5E7EB;
    border-radius: 18px;
    padding: 28px 28px 22px;
    box-shadow:
        0 1px 3px rgba(15, 23, 42, 0.04),
        0 12px 32px -16px rgba(15, 23, 42, 0.15);
    position: relative;
}
.cds-guest-buy-header {
    margin-bottom: 22px;
    text-align: center;
}
/* Specificity prefix .cds-guest-buy-card so we beat the global
   .cds-app h3 / .cds-app p rules in cds-frontend.css that would
   otherwise override our color and font-size. Same gotcha that
   bit the listing CTA banner in 1.17.6. */
.cds-guest-buy-card .cds-guest-buy-title {
    margin: 0 0 6px;
    font-size: 18px;
    line-height: 1.35;
    font-weight: 700;
    color: var(--cds-text, #111827);
    letter-spacing: -0.005em;
}
.cds-guest-buy-card .cds-guest-buy-subtitle {
    margin: 0;
    font-size: 13.5px;
    line-height: 1.5;
    color: var(--cds-muted, #6B7280);
}
.cds-guest-buy-card .cds-guest-buy-footer {
    text-align: center;
    margin: 18px 0 0;
    padding-top: 16px;
    border-top: 1px solid #F3F4F6;
    font-size: 13.5px;
    color: var(--cds-muted, #6B7280);
}
.cds-guest-buy-card .cds-guest-buy-footer .cds-link {
    color: var(--cds-primary, #2563EB);
    font-weight: 600;
    text-decoration: none;
    margin-left: 4px;
}
.cds-guest-buy-card .cds-guest-buy-footer .cds-link:hover {
    text-decoration: underline;
}

/* The submit button shows the price inline; give the label some breathing
   room so the price doesn't crash into the action verb on narrow screens. */
.cds-guest-buy-card #cds-guest-buy-submit .cds-btn-label {
    display: inline-block;
    line-height: 1.3;
}

@media (max-width: 640px) {
    .cds-guest-buy-card {
        padding: 24px 20px 20px;
        border-radius: 16px;
    }
    .cds-guest-buy-card .cds-guest-buy-title {
        font-size: 16.5px;
    }
    .cds-guest-buy-card .cds-guest-buy-subtitle {
        font-size: 13px;
    }
}

/* ============================================================
 * LANDING PAGE
 * ============================================================ */
.cds-landing-page { min-height: 100vh; background: var(--cds-bg); padding: 40px 20px; }
.cds-landing-shell { max-width: 1000px; margin: 0 auto; }
.cds-back-link { display: inline-block; margin-bottom: 20px; font-size: 14px; }

.cds-landing-grid {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 32px;
    background: #fff;
    border-radius: 16px;
    padding: 32px;
    border: 1px solid var(--cds-border);
}
.cds-landing-media img { width: 100%; border-radius: 12px; display: block; }
.cds-landing-thumb-placeholder {
    width: 100%;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 80px;
    background: linear-gradient(135deg, var(--cds-primary), var(--cds-secondary));
    color: #fff;
    border-radius: 12px;
}

.cds-landing-content h1 {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 10px;
    color: var(--cds-text);
    letter-spacing: -0.4px;
}
.cds-landing-short { color: var(--cds-muted); font-size: 15px; margin: 0 0 24px; line-height: 1.6; }

.cds-landing-meta {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    padding: 16px 0;
    border-top: 1px solid var(--cds-border);
    border-bottom: 1px solid var(--cds-border);
    margin-bottom: 24px;
}
.cds-meta-item { font-size: 13px; color: var(--cds-muted); }
.cds-meta-item strong { display: block; font-size: 20px; color: var(--cds-text); font-weight: 600; }
.cds-meta-price strong { color: var(--cds-primary); }

.cds-landing-cta .cds-btn-large { padding: 16px 32px; font-size: 16px; }
.cds-landing-cta { margin-bottom: 28px; }

.cds-landing-long h2 { font-size: 18px; font-weight: 600; margin: 0 0 12px; }
.cds-landing-long p { line-height: 1.7; color: var(--cds-text); }

@media (max-width: 768px) {
    .cds-landing-grid { grid-template-columns: 1fr; padding: 20px; }
}

/* ============================================================
 * RUNNER
 * ============================================================ */
.cds-runner-page { min-height: 100vh; background: var(--cds-bg); display: flex; flex-direction: column; }
.cds-runner-header {
    background: #fff;
    border-bottom: 1px solid var(--cds-border);
    padding: 14px 24px;
}
.cds-runner-header-inner {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}
.cds-runner-brand { display: flex; align-items: center; gap: 16px; }
.cds-runner-brand img { max-height: 30px; }
.cds-runner-test-name { font-size: 13px; color: var(--cds-muted); font-weight: 500; padding-left: 16px; border-left: 1px solid var(--cds-border); }
.cds-runner-status { display: flex; align-items: center; gap: 16px; font-size: 13px; }

.cds-runner-main { flex: 1; padding: 40px 20px; display: flex; justify-content: center; }
.cds-runner-shell { max-width: 700px; width: 100%; }
.cds-runner-card {
    background: #fff;
    border: 1px solid var(--cds-border);
    border-radius: 16px;
    padding: 40px 44px;
    min-height: 400px;
}

.cds-runner-loading { text-align: center; padding: 60px 20px; }
.cds-spinner-large {
    width: 48px;
    height: 48px;
    border: 4px solid var(--cds-border);
    border-top-color: var(--cds-primary);
    border-radius: 50%;
    animation: cds-spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

.cds-runner-intro h1 { font-size: 26px; font-weight: 700; color: var(--cds-text); margin: 0 0 8px; }
.cds-runner-instructions {
    background: var(--cds-bg);
    border-radius: 10px;
    padding: 20px 24px;
    margin: 24px 0 28px;
}
.cds-runner-instructions h3 { font-size: 14px; margin: 0 0 10px; color: var(--cds-text); }
.cds-runner-instructions ul { margin: 0; padding-left: 20px; }
.cds-runner-instructions li { font-size: 14px; color: var(--cds-muted); margin-bottom: 6px; line-height: 1.5; }

.cds-runner-progress { margin-bottom: 32px; }
.cds-runner-progress-text { font-size: 13px; color: var(--cds-muted); margin-bottom: 8px; font-weight: 500; }
.cds-runner-progress-bar {
    height: 8px;
    background: var(--cds-border);
    border-radius: 100px;
    overflow: hidden;
}
.cds-runner-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--cds-primary), var(--cds-secondary));
    width: 0%;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 100px;
}

.cds-runner-question-body h2 {
    font-size: 22px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--cds-text);
    margin: 0 0 10px;
    letter-spacing: -0.2px;
}
.cds-q-helper {
    font-size: 14px;
    line-height: 1.6;
    margin: 0 0 24px;
    padding: 12px 16px;
    background: #F0F9FF;
    border-left: 3px solid var(--cds-secondary);
    border-radius: 6px;
}
.cds-q-helper:empty { display: none; }

.cds-q-options { display: flex; flex-direction: column; gap: 10px; }
.cds-q-option {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    border: 2px solid var(--cds-border);
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    transition: all 0.15s;
    font-size: 15px;
    font-weight: 500;
    color: var(--cds-text);
    text-align: left;
    font-family: inherit;
}
.cds-q-option:hover,
.cds-q-option:focus {
    border-color: var(--cds-secondary);
    background: #F8FAFC;
    color: var(--cds-text) !important;
}
.cds-q-option:hover .cds-q-option-letter,
.cds-q-option:focus .cds-q-option-letter {
    color: var(--cds-muted) !important;
}
.cds-q-option.is-selected {
    border-color: var(--cds-primary);
    background: #EFF6FF;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    color: var(--cds-text) !important;
}
.cds-q-option-letter {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--cds-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    color: var(--cds-muted);
    flex-shrink: 0;
}
.cds-q-option.is-selected .cds-q-option-letter {
    background: var(--cds-primary);
    color: #fff;
}

.cds-runner-nav {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--cds-border);
}
.cds-runner-nav .cds-btn-primary,
.cds-runner-nav .cds-btn-accent { margin-left: auto; min-width: 140px; }

.cds-runner-error { text-align: center; padding: 40px 20px; }
.cds-runner-error h2 { color: var(--cds-error); }

@media (max-width: 640px) {
    .cds-runner-card { padding: 28px 22px; border-radius: 12px; }
    .cds-runner-question-body h2 { font-size: 18px; }
    .cds-runner-test-name { display: none; }
    .cds-runner-nav { flex-wrap: wrap; }
    .cds-runner-nav .cds-btn { flex: 1; min-width: 0; }
}

/* ============================================================
 * RESULT
 * ============================================================ */
.cds-result-page { min-height: 100vh; background: var(--cds-bg); }
.cds-result-main { padding: 40px 20px; }
.cds-result-shell { max-width: 800px; margin: 0 auto; }
.cds-result-card {
    background: #fff;
    border-radius: 16px;
    border: 1px solid var(--cds-border);
    overflow: hidden;
}
.cds-result-hero {
    background: linear-gradient(135deg, var(--cds-primary), var(--cds-secondary));
    color: #fff;
    padding: 48px 40px;
    text-align: center;
}
.cds-result-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 2px;
    opacity: 0.85;
    margin: 0 0 8px;
    font-weight: 500;
}
.cds-result-hero h1 {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 20px;
    letter-spacing: -0.3px;
}
.cds-result-code-display {
    font-size: 72px;
    font-weight: 800;
    letter-spacing: 12px;
    margin: 20px 0 8px;
    font-family: monospace;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.cds-result-hero .cds-muted { color: rgba(255,255,255,0.85); }

.cds-result-body { padding: 40px; }
.cds-result-basic h3 { font-size: 16px; margin: 0 0 12px; }
.cds-score-list { list-style: none; padding: 0; margin: 0; }
.cds-score-list li {
    padding: 10px 14px;
    background: var(--cds-bg);
    border-radius: 8px;
    margin-bottom: 6px;
    font-size: 14px;
}

.cds-result-actions {
    padding: 0 40px 32px;
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}
.cds-result-footer { padding: 0 40px 28px; text-align: center; font-size: 12px; }

@media (max-width: 640px) {
    .cds-result-hero { padding: 36px 24px; }
    .cds-result-code-display { font-size: 52px; letter-spacing: 8px; }
    .cds-result-body { padding: 28px 24px; }
    .cds-result-actions { padding: 0 24px 24px; }
    .cds-dash-nav { display: none; }
}

/* Mobile dashboard header tweaks */
@media (max-width: 768px) {
    .cds-dash-nav { display: none; }
    .cds-dash-username { display: none; }
    .cds-dash-hero { padding: 24px 20px; }
    .cds-dash-hero h1 { font-size: 20px; }
}

/* ============================================================
 * COUPON INPUT (landing page)
 * ============================================================ */
.cds-coupon-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    max-width: 360px;
}
.cds-coupon-row .cds-input { flex: 1; padding: 10px 12px; font-size: 13px; }
.cds-coupon-row .cds-btn { padding: 10px 18px; font-size: 13px; min-width: 80px; }
.cds-coupon-message { font-size: 13px; margin-bottom: 16px; min-height: 18px; font-weight: 500; }

/* ============================================================
 * PAYMENT PAGES (success + failed)
 * ============================================================ */
.cds-payment-page {
    min-height: 100vh;
    background: var(--cds-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}
.cds-payment-shell { width: 100%; max-width: 520px; }
.cds-payment-card {
    background: #fff;
    border: 1px solid var(--cds-border);
    border-radius: 16px;
    padding: 48px 40px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(17, 24, 39, 0.06);
}
.cds-payment-brand { margin-bottom: 24px; }
.cds-payment-brand img { max-height: 44px; }
.cds-payment-brand .cds-wordmark { font-size: 18px; font-weight: 700; color: var(--cds-primary); }

.cds-payment-status { display: flex; justify-content: center; margin: 20px 0 28px; min-height: 80px; align-items: center; }
.cds-payment-status .cds-payment-spinner { display: block; }
.cds-payment-status .cds-payment-check { display: none; color: var(--cds-success); }
.cds-payment-status.is-paid .cds-payment-spinner { display: none; }
.cds-payment-status.is-paid .cds-payment-check { display: block; animation: cds-check-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes cds-check-pop {
    0%   { transform: scale(0); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.cds-payment-x { display: flex; justify-content: center; color: var(--cds-error); margin: 20px 0 28px; }

.cds-payment-card h1 {
    font-size: 22px;
    font-weight: 600;
    color: var(--cds-text);
    margin: 0 0 8px;
}
.cds-payment-card > p { margin: 0 0 20px; font-size: 14px; }

.cds-payment-order-summary {
    background: var(--cds-bg);
    border-radius: 10px;
    padding: 16px 20px;
    margin: 20px 0 24px;
    font-size: 14px;
}
.cds-payment-order-summary div { margin: 2px 0; }

.cds-payment-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 24px;
}

@media (max-width: 480px) {
    .cds-payment-card { padding: 36px 24px; }
    .cds-payment-actions { flex-direction: column; }
    .cds-payment-actions .cds-btn { width: 100%; }
}

/* ============================================================
 * AI REPORT SECTIONS (M6)
 * ============================================================ */
.cds-result-user {
    font-size: 15px;
    opacity: 0.9;
    margin: 0 0 12px;
    font-weight: 500;
}

.cds-ai-section {
    margin: 0 0 36px;
    padding: 0;
}
.cds-ai-section:last-child { margin-bottom: 0; }

.cds-ai-section h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--cds-text);
    margin: 0 0 14px;
    letter-spacing: -0.2px;
}
.cds-ai-section h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--cds-text);
    margin: 0 0 10px;
}

.cds-ai-summary-text {
    font-size: 16px;
    line-height: 1.7;
    color: var(--cds-text);
    margin: 0;
    padding: 20px 24px;
    background: linear-gradient(135deg, #EFF6FF, #F9FAFB);
    border-left: 4px solid var(--cds-primary);
    border-radius: 8px;
}

.cds-ai-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.cds-ai-col {
    background: var(--cds-bg);
    padding: 20px 22px;
    border-radius: 10px;
    border: 1px solid var(--cds-border);
}
.cds-ai-col.cds-ai-strengths { border-left: 3px solid var(--cds-success); }
.cds-ai-col.cds-ai-growth    { border-left: 3px solid var(--cds-accent);  }
.cds-ai-col ul { margin: 0; padding-left: 20px; }
.cds-ai-col li { font-size: 14px; line-height: 1.6; margin-bottom: 6px; color: var(--cds-text); }

@media (max-width: 640px) {
    .cds-ai-two-col { grid-template-columns: 1fr; }
}

.cds-career-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
}
.cds-career-card {
    background: #fff;
    border: 1px solid var(--cds-border);
    border-radius: 10px;
    padding: 16px 18px;
    transition: all 0.15s;
}
.cds-career-card:hover { border-color: var(--cds-primary); box-shadow: 0 4px 12px rgba(37, 99, 235, 0.08); }
.cds-career-card h4 {
    font-size: 15px;
    font-weight: 600;
    color: var(--cds-primary);
    margin: 0 0 6px;
}
.cds-career-desc {
    font-size: 13px;
    color: var(--cds-text);
    margin: 0 0 6px;
    line-height: 1.5;
}
.cds-career-why {
    font-size: 12px;
    color: var(--cds-muted);
    margin: 6px 0 0;
    line-height: 1.5;
}

.cds-chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.cds-chip {
    display: inline-block;
    padding: 8px 14px;
    background: #EFF6FF;
    color: var(--cds-primary);
    border-radius: 100px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid #DBEAFE;
}

.cds-detail-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.cds-detail-list li {
    padding: 14px 16px;
    background: var(--cds-bg);
    border-radius: 8px;
    margin-bottom: 8px;
    font-size: 14px;
    line-height: 1.5;
    border-left: 3px solid var(--cds-secondary);
}

.cds-next-steps-list {
    counter-reset: cds-step;
    list-style: none;
    padding: 0;
    margin: 0;
}
.cds-next-steps-list li {
    position: relative;
    padding: 14px 16px 14px 56px;
    background: #F0FDF4;
    border-radius: 10px;
    margin-bottom: 8px;
    font-size: 14px;
    line-height: 1.5;
    color: #166534;
    counter-increment: cds-step;
}
.cds-next-steps-list li::before {
    content: counter(cds-step);
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--cds-success);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
}

.cds-ai-fallback-notice {
    background: #FEF3C7;
    border: 1px solid #FDE68A;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 13px;
    color: #92400E;
}
.cds-ai-fallback-notice p { margin: 0; }

.cds-addon-report {
    margin-top: 36px;
    padding-top: 28px;
    border-top: 1px solid var(--cds-border);
}

/* ============================================================
 * PRINT MODE (PDF export)
 * ============================================================ */
.cds-print-logo { max-height: 50px; margin-bottom: 12px; }

@media print {
    /* Hide everything not part of the report */
    .cds-no-print,
    header,
    footer,
    nav,
    .cds-dash-header,
    .cds-result-actions { display: none !important; }

    body { background: #fff !important; font-size: 11pt; }
    .cds-app, .cds-result-page, .cds-result-main { background: #fff !important; }
    .cds-result-shell { max-width: 100% !important; padding: 0 !important; }
    .cds-result-card {
        border: none !important;
        box-shadow: none !important;
        border-radius: 0 !important;
    }

    .cds-result-hero {
        background: var(--cds-primary) !important;
        color: #fff !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        page-break-after: avoid;
    }
    .cds-result-code-display { font-size: 54px !important; letter-spacing: 10px !important; }
    .cds-result-body { padding: 24px 32px !important; }

    .cds-ai-section { page-break-inside: avoid; margin-bottom: 24px !important; }
    .cds-ai-section h2 { font-size: 16pt !important; }
    .cds-ai-summary-text { background: #F9FAFB !important; -webkit-print-color-adjust: exact; }
    .cds-career-card { border: 1px solid #ccc !important; break-inside: avoid; }
    .cds-chip { background: #F0F4FF !important; -webkit-print-color-adjust: exact; }
    .cds-next-steps-list li {
        background: #F9FAFB !important;
        color: #333 !important;
        -webkit-print-color-adjust: exact;
    }
    .cds-next-steps-list li::before { background: #666 !important; }

    @page { margin: 15mm; }
}

.cds-print-mode {
    background: #fff !important;
    padding: 0 !important;
}

/* ============================================================
 * MANAGER DASHBOARD (M7)
 * ============================================================ */
.cds-manager-page .cds-dash-hero { background: linear-gradient(135deg, #1E40AF, #2563EB); }

.cds-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}
.cds-stat-card-big {
    background: #fff;
    border: 1px solid var(--cds-border);
    border-left: 4px solid var(--cds-primary);
    border-radius: 12px;
    padding: 24px 28px;
    box-shadow: 0 1px 3px rgba(17, 24, 39, 0.04);
}
.cds-stat-card-big:nth-child(2) { border-left-color: var(--cds-success); }
.cds-stat-card-big:nth-child(3) { border-left-color: var(--cds-accent); }
.cds-stat-card-big .cds-stat-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--cds-muted);
    font-weight: 600;
    margin-bottom: 6px;
}
.cds-stat-card-big .cds-stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--cds-text);
    line-height: 1.1;
    letter-spacing: -0.5px;
}

.cds-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.cds-section-header h2 { margin: 0 !important; }
.cds-section-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.cds-input-sm {
    padding: 8px 12px;
    border: 1px solid var(--cds-border);
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    min-width: 220px;
    background: #fff;
}
.cds-input-sm:focus { outline: none; border-color: var(--cds-primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1); }
.cds-btn-sm { padding: 8px 14px; font-size: 12px; }

.cds-table-card { padding: 0 !important; }
.cds-table-wrap { overflow-x: auto; }
.cds-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.cds-table thead tr {
    background: var(--cds-bg);
    border-bottom: 1px solid var(--cds-border);
}
.cds-table th {
    text-align: left;
    padding: 12px 16px;
    font-weight: 600;
    color: var(--cds-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.cds-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--cds-border);
    vertical-align: middle;
}
.cds-table tbody tr:hover { background: var(--cds-bg); }
.cds-table tbody tr:last-child td { border-bottom: none; }

.cds-status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.cds-status-pending  { background: #FEF3C7; color: #92400E; }
.cds-status-paid     { background: #DCFCE7; color: #166534; }
.cds-status-failed   { background: #FEE2E2; color: #991B1B; }
.cds-status-refunded { background: #E0E7FF; color: #3730A3; }

/* Modal */
.cds-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, 0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: cds-modal-in 0.2s ease;
}
@keyframes cds-modal-in { from { opacity: 0; } to { opacity: 1; } }
.cds-modal {
    background: #fff;
    border-radius: 16px;
    max-width: 720px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 24px 64px rgba(17, 24, 39, 0.2);
}
.cds-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    background: transparent;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--cds-muted);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}
.cds-modal-close:hover { background: var(--cds-bg); color: var(--cds-text); }
.cds-modal-body { padding: 32px 36px; }
.cds-modal-body h2 { margin: 0 0 4px; font-size: 22px; font-weight: 600; }
.cds-modal-body h3 { margin: 24px 0 12px; font-size: 16px; font-weight: 600; }

.cds-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 20px;
    margin: 20px 0;
    padding: 16px 20px;
    background: var(--cds-bg);
    border-radius: 10px;
}
.cds-detail-row { display: flex; justify-content: space-between; font-size: 13px; }
.cds-detail-label { color: var(--cds-muted); }
.cds-detail-value { color: var(--cds-text); font-weight: 500; text-align: right; }

@media (max-width: 640px) {
    .cds-modal-body { padding: 24px; }
    .cds-detail-grid { grid-template-columns: 1fr; }
    .cds-section-header { flex-direction: column; align-items: stretch; }
    .cds-section-actions { justify-content: stretch; }
    .cds-input-sm { min-width: 0; flex: 1; }
}

/* ============================================================
 * RECOMMENDED / SUPPLEMENTARY TEST CARDS (M7)
 * ============================================================ */
.cds-test-card.cds-recommended {
    position: relative;
    border-color: var(--cds-accent);
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.12);
}
.cds-test-card.cds-recommended::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, var(--cds-accent), var(--cds-primary));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}
.cds-recommended-badge {
    display: inline-block;
    padding: 3px 10px;
    background: linear-gradient(135deg, var(--cds-accent), #D97706);
    color: #fff;
    border-radius: 100px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}
