/* ==========================================================================
   Checklist Pages — Aligntra Compliance Platform
   All styles for expert-level compliance checklist pages.
   Prefix: .ck-*
   Style guide: outlined, minimal, dots, no fills, no gradients.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Layout & Header
   -------------------------------------------------------------------------- */

.ck-header {
    background: white;
    padding: 24px 40px 16px;
    max-width: 860px;
    margin: 0 auto;
}

.ck-breadcrumb {
    font-size: 13px;
    color: var(--gray-600);
    margin-bottom: 16px;
}

.ck-breadcrumb a {
    color: var(--gray-600);
    text-decoration: none;
}

.ck-breadcrumb a:hover {
    color: var(--primary-600);
}

.ck-header h1 {
    font-size: clamp(1.5rem, 3.5vw, 2rem);
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.ck-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.ck-meta span {
    font-size: 13px;
    color: var(--gray-600);
}

.ck-meta span + span::before {
    content: "\00b7";
    margin-right: 16px;
    color: var(--gray-300);
}

.ck-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.ck-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    background: white;
    color: var(--gray-600);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.15s;
    font-family: var(--font-primary);
}

.ck-btn:hover {
    border-color: var(--primary-300);
    color: var(--primary-600);
}

.ck-btn:focus-visible {
    outline: 2px solid var(--primary-400);
    outline-offset: 2px;
}

/* Primary CTA button (Download PDF) */
.ck-btn-primary {
    background: var(--primary-600);
    color: white;
    border-color: var(--primary-600);
}

.ck-btn-primary:hover {
    background: var(--primary-700);
    border-color: var(--primary-700);
    color: white;
}

/* --------------------------------------------------------------------------
   Progress Strip — thin bar above toolbar
   -------------------------------------------------------------------------- */

.ck-progress-strip {
    max-width: 860px;
    margin: 0 auto;
    padding: 0 40px 8px;
}

.ck-progress {
    background: var(--gray-100);
    border-radius: 6px;
    height: 6px;
    margin-bottom: 4px;
    overflow: hidden;
}

.ck-progress-fill {
    height: 100%;
    background: var(--primary-600);
    border-radius: 6px;
    transition: width 0.3s ease;
    width: 0%;
}

.ck-progress-text {
    font-size: 12px;
    color: var(--gray-600);
    font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   Container
   -------------------------------------------------------------------------- */

.ck-container {
    max-width: 860px;
    margin: 0 auto;
    padding: 0 40px 40px;
}

/* --------------------------------------------------------------------------
   Disclaimer — now at bottom of page
   -------------------------------------------------------------------------- */

.ck-disclaimer {
    max-width: 860px;
    margin: 0 auto;
    padding: 0 40px;
    font-size: 12px;
    color: var(--gray-600);
    line-height: 1.4;
    text-align: center;
}

/* --------------------------------------------------------------------------
   Toolbar — Single sticky bar with toggle + search + filters
   -------------------------------------------------------------------------- */

.ck-toolbar {
    position: sticky;
    top: 64px; /* below navbar */
    z-index: 10;
    background: white;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    padding: 10px 40px;
    margin: 0 -40px 16px;
}

.ck-toolbar.ck-toolbar-stuck {
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.ck-search-input {
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 13px;
    flex: 1;
    min-width: 140px;
    max-width: 220px;
    font-family: var(--font-primary);
    color: var(--gray-800);
    transition: border-color 0.15s;
}

.ck-search-input::placeholder {
    color: var(--gray-300);
}

.ck-search-input:focus {
    border-color: var(--primary-300);
    outline: none;
}

/* --------------------------------------------------------------------------
   Filter Chips
   -------------------------------------------------------------------------- */

.ck-filter-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

.ck-filter-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-600);
    margin-right: 2px;
}

.ck-chip {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--gray-300);
    background: transparent;
    padding: 3px 10px;
    border-radius: 16px;
    font-size: 12px;
    cursor: pointer;
    color: var(--gray-600);
    font-family: var(--font-primary);
    transition: border-color 0.15s, color 0.15s;
}

.ck-chip:hover {
    border-color: var(--primary-300);
}

.ck-chip:focus-visible {
    outline: 2px solid var(--primary-400);
    outline-offset: 2px;
}

.ck-chip.active {
    border-color: var(--primary-600);
    color: var(--primary-600);
}

/* --------------------------------------------------------------------------
   View Toggle — Text tab underline style (not pill)
   -------------------------------------------------------------------------- */

.ck-view-toggle {
    display: inline-flex;
    gap: 0;
    margin-right: 8px;
}

.ck-view-toggle button {
    padding: 4px 12px;
    border: none;
    background: transparent;
    color: var(--gray-600);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    font-family: var(--font-primary);
    border-bottom: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s;
}

.ck-view-toggle button.active {
    color: var(--primary-600);
    border-bottom-color: var(--primary-600);
}

.ck-view-toggle button:hover:not(.active) {
    color: var(--gray-600);
    border-bottom: 2px solid var(--gray-200);
}

/* --------------------------------------------------------------------------
   Sections
   -------------------------------------------------------------------------- */

.ck-section {
    margin-bottom: 12px;
}

.ck-section-header {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-900);
    padding: 10px 16px;
    border-left: 3px solid var(--primary-600);
    background: var(--gray-50, #f9fafb);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    user-select: none;
    transition: background 0.15s;
    letter-spacing: -0.01em;
}

.ck-section-header:hover {
    background: rgba(21, 96, 188, 0.05);
}

/* Chevron next to title (not far-right pseudo-element) */
.ck-section-chevron {
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid var(--gray-400);
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.ck-section-header[aria-expanded="true"] .ck-section-chevron {
    transform: rotate(180deg);
}

/* Section-level progress counter */
.ck-section-progress {
    font-variant-numeric: tabular-nums;
    font-size: 12px;
    color: var(--gray-600);
    font-weight: 400;
    margin-left: auto; /* push to right edge */
}


/* Section overview */
.ck-section-overview {
    font-size: 13px;
    color: var(--gray-500);
    line-height: 1.6;
    padding: 8px 16px 12px;
    border-left: 3px solid transparent;
}

/* Section body — container for items */
.ck-section-body[hidden] {
    display: none;
}

/* --------------------------------------------------------------------------
   Checklist Items — Click-to-expand accordion
   -------------------------------------------------------------------------- */

.ck-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-100);
    align-items: flex-start;
    flex-wrap: wrap;
}

.ck-item:last-child {
    border-bottom: none;
}

.ck-item.ck-hidden {
    display: none;
}

.ck-item.ck-checked .ck-question {
    color: var(--gray-600);
    text-decoration: line-through;
}

.ck-checkbox {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin-top: 2px;
    accent-color: var(--primary-600);
    cursor: pointer;
}

.ck-item-content {
    flex: 1;
    min-width: 0;
    cursor: pointer;
}

.ck-item-content:hover .ck-question {
    color: var(--primary-700);
}

.ck-item-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.ck-clause {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary-700);
}

/* Item chevron — indicates expandability */
.ck-item-chevron {
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid var(--gray-300);
    transition: transform 0.15s ease;
    margin-left: auto;
}

.ck-item[aria-expanded="true"] .ck-item-chevron {
    transform: rotate(180deg);
}

.ck-question {
    font-size: 14px;
    color: var(--gray-700);
    line-height: 1.5;
    margin-bottom: 2px;
    transition: color 0.15s;
}

/* Inline evidence preview — always visible */
.ck-preview {
    font-size: 12px;
    color: var(--gray-600);
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* --------------------------------------------------------------------------
   Detail Panel — Accordion content (full width below item)
   -------------------------------------------------------------------------- */

.ck-detail-panel {
    width: 100%;
    padding: 16px 0 8px 32px;
    border-top: 1px solid var(--gray-100);
    margin-top: 8px;
}

.ck-detail-panel[hidden] {
    display: none;
}

.ck-detail-panel h4 {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-700);
    margin: 12px 0 6px;
}

.ck-detail-panel h4:first-child {
    margin-top: 0;
}

.ck-detail-panel ul {
    list-style: disc;
    padding-left: 20px;
    font-size: 13px;
    color: var(--gray-600);
    line-height: 1.6;
    margin: 0;
}

/* Two-column detail layout */
.ck-detail-grid {
    display: grid;
    grid-template-columns: 55% 45%;
    gap: 20px;
    margin-bottom: 16px;
}

.ck-detail-left,
.ck-detail-right {
    min-width: 0; /* prevent overflow */
}

.ck-detail-footer {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    padding-top: 12px;
    border-top: 1px solid var(--gray-100);
}

.ck-detail-footer .ck-xrefs {
    flex-shrink: 0;
}

.ck-detail-footer .ck-notes {
    flex: 1;
}

.ck-detail-panel .ck-tips {
    font-size: 13px;
    color: var(--gray-600);
    line-height: 1.6;
    background: rgba(21, 96, 188, 0.03);
    padding: 10px 14px;
    border-radius: 6px;
}

.ck-detail-panel .ck-followup {
    margin-top: 8px;
}

.ck-detail-panel .ck-followup ul {
    list-style: none;
    padding-left: 0;
}

.ck-detail-panel .ck-followup ul li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 6px;
    font-style: italic;
}

.ck-detail-panel .ck-followup ul li::before {
    content: "\2192";
    position: absolute;
    left: 0;
    color: var(--primary-400);
}

.ck-detail-panel .ck-sampling {
    margin-top: 8px;
    font-size: 13px;
    color: var(--gray-600);
    line-height: 1.6;
    border-left: 3px solid var(--primary-300);
    padding-left: 12px;
}

@media (max-width: 768px) {
    .ck-detail-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .ck-detail-footer {
        flex-direction: column;
    }
}

/* --------------------------------------------------------------------------
   Cross-Reference Badge
   -------------------------------------------------------------------------- */

.ck-xref-badge {
    display: inline-flex;
    align-items: center;
    font-size: 11px;
    border: 1px solid var(--gray-200);
    border-radius: 4px;
    padding: 2px 8px;
    margin-right: 6px;
    margin-bottom: 4px;
    color: var(--gray-500);
}

/* --------------------------------------------------------------------------
   Notes Field
   -------------------------------------------------------------------------- */

.ck-notes textarea {
    width: 100%;
    min-height: 40px;
    resize: vertical;
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    font-size: 13px;
    padding: 8px;
    font-family: inherit;
    color: var(--gray-800);
    transition: border-color 0.15s;
    box-sizing: border-box;
}

.ck-notes textarea::placeholder {
    color: var(--gray-300);
}

.ck-notes textarea:focus {
    border-color: var(--primary-300);
    outline: none;
}

/* --------------------------------------------------------------------------
   Gate Boundary + Gated Sections
   -------------------------------------------------------------------------- */

.ck-gate-boundary {
    text-align: center;
    padding: 16px 0;
    margin: 8px 0 16px;
    border-top: 1.5px solid var(--gray-200);
    border-bottom: 1.5px solid var(--gray-200);
}

.ck-gate-boundary span {
    font-size: 12px;
    font-weight: 500;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ck-section-gated .ck-section-locked {
    opacity: 0.55;
    cursor: default;
    background: transparent;
}

.ck-section-gated .ck-section-locked:hover {
    background: transparent;
}

.ck-section-gated .ck-section-locked .ck-section-chevron {
    display: none;
}

.ck-gated-count {
    font-size: 12px;
    font-weight: 400;
    color: var(--gray-600);
    font-variant-numeric: tabular-nums;
}

.ck-lock-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 500;
    color: var(--gray-600);
    border: 1px solid var(--gray-200);
    border-radius: 4px;
    padding: 1px 8px;
    margin-left: 8px;
}

/* --------------------------------------------------------------------------
   Gate CTA — Bottom of page, outside container
   -------------------------------------------------------------------------- */

.ck-gate-cta {
    max-width: 860px;
    margin: 24px auto;
    padding: 32px 40px;
    border-left: 3px solid var(--primary-600);
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.08));
}

.ck-gate-cta h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 8px;
}

.ck-gate-cta > p {
    font-size: 14px;
    color: var(--gray-500);
    margin: 0 0 16px;
    line-height: 1.6;
}

.ck-gate-form {
    max-width: 100%;
    margin: 0;
}

.ck-gate-fields {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.ck-gate-fields input[type="email"],
.ck-gate-fields input[type="text"] {
    flex: 1;
    min-width: 160px;
    padding: 10px 14px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: 14px;
    font-family: var(--font-primary);
}

.ck-gate-fields input:focus {
    border-color: var(--primary-400);
    outline: none;
}

.ck-gate-submit {
    padding: 10px 24px;
    background: var(--primary-600);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    font-family: var(--font-primary);
    white-space: nowrap;
}

.ck-gate-submit:hover {
    background: var(--primary-700);
}

.ck-gate-submit:disabled,
.ck-pdf-submit:disabled,
.ck-btn-primary:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.ck-gate-submit:focus-visible,
.ck-pdf-submit:focus-visible {
    outline: 2px solid var(--primary-400);
    outline-offset: 2px;
}

.ck-gate-subscribe {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    font-size: 13px;
    color: var(--gray-500);
}

.ck-gate-note {
    font-size: 12px;
    color: var(--gray-600);
    margin-top: 8px;
}

@media (max-width: 768px) {
    .ck-gate-fields {
        flex-direction: column;
    }

    .ck-gate-fields input,
    .ck-gate-submit {
        width: 100%;
    }
}

/* --------------------------------------------------------------------------
   FAQ Section
   -------------------------------------------------------------------------- */

.ck-faq-section {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--gray-100);
}

.ck-faq-section h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 16px;
}

.ck-faq-item {
    margin-bottom: 16px;
}

.ck-faq-q {
    font-weight: 600;
    font-size: 14px;
    color: var(--gray-900);
}

.ck-faq-a {
    font-size: 13px;
    color: var(--gray-600);
    line-height: 1.6;
    margin-top: 4px;
}

/* --------------------------------------------------------------------------
   Footer CTA
   -------------------------------------------------------------------------- */

.ck-footer-cta {
    max-width: 860px;
    margin: 0 auto;
    padding: 24px 40px 60px;
}

.ck-footer-cta-box {
    background: white;
    border-radius: 12px;
    padding: 32px;
    text-align: center;
    box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.08));
}

.ck-footer-cta-box h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 8px;
}

.ck-footer-cta-box p {
    color: var(--gray-500);
    font-size: 15px;
    margin-bottom: 20px;
}

.ck-footer-cta-box a {
    display: inline-flex;
    align-items: center;
    padding: 12px 24px;
    background: var(--primary-600);
    color: white;
    border-radius: 8px;
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
    transition: background 0.15s;
}

.ck-footer-cta-box a:hover {
    background: var(--primary-700);
}

/* --------------------------------------------------------------------------
   PDF Email Capture Modal
   -------------------------------------------------------------------------- */

.ck-pdf-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
}

.ck-pdf-modal[hidden] {
    display: none;
}

.ck-pdf-modal-content {
    max-width: 440px;
    width: 90%;
    margin: auto;
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-lg, 0 4px 16px rgba(0,0,0,0.15));
    padding: 32px;
}

.ck-pdf-modal-content h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 8px;
}

.ck-pdf-modal-content p {
    font-size: 14px;
    color: var(--gray-500);
    margin-bottom: 20px;
    line-height: 1.5;
}

.ck-pdf-modal label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 4px;
}

.ck-required { color: var(--error-dark, #991B1B); }
.ck-optional { color: var(--gray-600); font-weight: 400; }

.ck-pdf-modal input[type="email"],
.ck-pdf-modal input[type="text"] {
    width: 100%;
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 14px;
    font-family: var(--font-primary);
    color: var(--gray-800);
    margin-bottom: 12px;
    box-sizing: border-box;
    transition: border-color 0.15s;
}

.ck-pdf-modal input::placeholder {
    color: var(--gray-300);
}

.ck-pdf-modal input:focus {
    border-color: var(--primary-300);
    outline: none;
}

.ck-pdf-subscribe {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 16px;
    font-size: 13px;
    color: var(--gray-500);
}

.ck-pdf-modal .ck-pdf-submit {
    width: 100%;
    padding: 10px 24px;
    background: var(--primary-600);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-primary);
    transition: background 0.15s;
}

.ck-pdf-modal .ck-pdf-submit:hover {
    background: var(--primary-700);
}

.ck-pdf-modal-content {
    position: relative;
}

.ck-pdf-modal .ck-pdf-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    color: var(--gray-600);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    font-family: var(--font-primary);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}

.ck-pdf-modal .ck-pdf-modal-close:hover {
    color: var(--gray-600);
}

/* ==========================================================================
   Responsive — Tablet
   ========================================================================== */

@media (max-width: 768px) {
    .ck-header {
        padding: 24px 20px 16px;
    }

    .ck-progress-strip,
    .ck-container,
    .ck-footer-cta,
    .ck-gate-cta,
    .ck-disclaimer {
        padding-left: 20px;
        padding-right: 20px;
    }

    .ck-toolbar {
        padding-left: 20px;
        padding-right: 20px;
        margin-left: -20px;
        margin-right: -20px;
    }

    .ck-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .ck-meta span + span::before {
        display: none;
    }

    .ck-toolbar {
        flex-wrap: wrap;
        gap: 6px;
    }

    .ck-search-input {
        flex: 1 1 100%;
        max-width: none;
    }

    .ck-detail-panel {
        padding-left: 0;
    }

    .ck-pdf-modal-content {
        padding: 24px;
    }
}

/* ==========================================================================
   Responsive — Mobile
   ========================================================================== */

@media (max-width: 480px) {
    .ck-header { padding: 20px 16px 12px; }

    .ck-progress-strip,
    .ck-container,
    .ck-gate-cta,
    .ck-disclaimer {
        padding-left: 16px;
        padding-right: 16px;
    }

    .ck-toolbar {
        padding-left: 16px;
        padding-right: 16px;
        margin-left: -16px;
        margin-right: -16px;
    }

    .ck-chip {
        min-height: 36px;
    }

    .ck-view-toggle button {
        font-size: 12px;
        padding: 4px 8px;
    }
}

/* ==========================================================================
   Print
   ========================================================================== */

@media print {
    .navbar,
    .footer,
    .announcement-banner,
    .ck-actions,
    .ck-footer-cta,
    .ck-progress-strip,
    .ck-toolbar,
    .ck-disclaimer,
    .ck-view-toggle,
    .ck-item-chevron,
    .ck-notes,
    .ck-pdf-modal,
    .ck-gate-cta,
    .ck-gate-boundary {
        display: none !important;
    }

    .ck-header,
    .ck-container {
        padding-left: 0;
        padding-right: 0;
        max-width: 100%;
    }

    /* Force show all collapsed content */
    .ck-section-body,
    .ck-section-body[hidden] {
        display: block !important;
    }

    .ck-detail-panel,
    .ck-detail-panel[hidden] {
        display: block !important;
    }

    .ck-item.ck-hidden {
        display: flex !important;
    }

    .ck-item {
        page-break-inside: avoid;
    }

    .ck-section {
        page-break-before: auto;
    }

    .ck-section-gated {
        display: none !important;
    }
}

/* ==========================================================================
   Reduced Motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    .ck-progress-fill {
        transition: none;
    }

    .ck-section-chevron,
    .ck-item-chevron {
        transition: none;
    }
}
