/* ============================================================
   Challenge Details page (firms.summary) - rebuilt 2026-06-20
   Replaces the old fake-checkout (checkout.css).
   ============================================================ */

.cd-wrap {
    max-width: 1140px;
    margin: 0 auto;
    padding: 28px 20px 80px;
    font-family: var(--font-family-base, 'Inter', system-ui, sans-serif);
}

/* breadcrumb */
.cd-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    margin-bottom: 18px;
    color: rgba(255, 255, 255, 0.85);
}
.cd-breadcrumb a { color: rgba(255, 255, 255, 0.85); text-decoration: none; }
.cd-breadcrumb a:hover { color: #ffffff; text-decoration: underline; }
.cd-breadcrumb span { color: rgba(255, 255, 255, 0.55); }
.cd-breadcrumb-current { color: #ffffff; font-weight: 600; }

/* layout: content + sticky buy rail */
.cd-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 24px;
    align-items: start;
}

/* ---------- header ---------- */
.cd-header { margin-bottom: 22px; }
.cd-firm { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.cd-firm-logo {
    flex: 0 0 auto;
    width: 60px; height: 60px;
    border-radius: 14px;
    background: #ffffff;
    border: 1px solid var(--color-border-light, #e5e7eb);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
    box-shadow: 0 4px 14px rgba(17, 24, 39, 0.12);
}
.cd-firm-logo img { width: 100%; height: 100%; object-fit: contain; padding: 8px; }
.cd-firm-meta { display: flex; flex-direction: column; gap: 4px; }
.cd-firm-name { font-size: 15px; font-weight: 700; color: #ffffff; text-decoration: none; }
.cd-firm-name:hover { text-decoration: underline; color: #ffffff; }
.cd-firm-sub { display: flex; align-items: center; gap: 10px; }
.cd-flag { width: 22px; height: auto; border-radius: 3px; }
.cd-tp {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 13px; font-weight: 700; color: #ffffff;
    background: rgba(16, 185, 129, 0.95);
    padding: 2px 9px; border-radius: 20px;
}
.cd-tp .fa-star { font-size: 11px; }
.cd-tp-count { font-weight: 500; opacity: 0.9; }

.cd-title {
    font-size: 32px; font-weight: 800; line-height: 1.15;
    color: #ffffff; margin: 0 0 12px;
}
.cd-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.cd-chip {
    font-size: 12.5px; font-weight: 600;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.18); /* bleed-ok: translucent chip on the purple hero gradient */
    border: 1px solid rgba(255, 255, 255, 0.28);
    padding: 5px 12px; border-radius: 20px;
}
.cd-chip-good {
    background: rgba(16, 185, 129, 0.92);
    border-color: transparent;
}

/* ---------- cards ---------- */
.cd-card {
    background: var(--color-surface-card, #ffffff);
    border: 1px solid var(--color-border-light, #e5e7eb);
    border-radius: 16px;
    padding: 22px 24px;
    margin-bottom: 18px;
    box-shadow: 0 8px 28px rgba(91, 76, 178, 0.08), 0 1px 3px rgba(17, 24, 39, 0.04);
}
.cd-h2 {
    font-size: 17px; font-weight: 800;
    color: var(--color-text-primary, #1a1a2e);
    margin: 0 0 16px;
}

/* key facts grid */
.cd-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}
.cd-fact {
    display: flex; flex-direction: column; gap: 3px;
    background: #faf9ff;
    border: 1px solid #efeafb;
    border-radius: 11px;
    padding: 12px 14px;
}
.cd-fact-l { font-size: 11.5px; font-weight: 600; color: #9a93b8; text-transform: uppercase; letter-spacing: 0.4px; }
.cd-fact-v { font-size: 17px; font-weight: 800; color: var(--color-text-primary, #1a1a2e); }

/* phase table */
.cd-phases { overflow-x: auto; }
.cd-phase-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.cd-phase-table thead th {
    text-align: left;
    font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px;
    color: #6a5fb0;
    padding: 10px 14px;
    background: linear-gradient(180deg, #f7f5ff, #efeafb);
    border-bottom: 2px solid #e7e2f7;
}
.cd-phase-table thead th:first-child { border-top-left-radius: 10px; }
.cd-phase-table thead th:last-child { border-top-right-radius: 10px; }
.cd-phase-table tbody td {
    padding: 13px 14px;
    font-size: 14px;
    color: var(--color-text-dark, #333);
    border-bottom: 1px solid #f0eef8;
    vertical-align: top;
}
.cd-phase-table tbody tr:last-child td { border-bottom: none; }
.cd-phase-tag { font-weight: 700; color: #46406b; white-space: nowrap; }
.cd-phase-note { display: block; font-size: 11.5px; color: #9a93b8; margin-top: 3px; line-height: 1.4; }

/* notes */
.cd-notes {
    margin-top: 16px;
    background: #faf9ff;
    border-left: 3px solid #d9d2f2;
    border-radius: 8px;
    padding: 12px 15px;
}
.cd-notes-label { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; color: #9a93b8; }
.cd-notes p { margin: 5px 0 0; font-size: 13.5px; line-height: 1.6; color: var(--color-text-mid, #555); }

/* specs grid */
.cd-specs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1px;
    background: #f0eef8;
    border: 1px solid #f0eef8;
    border-radius: 11px;
    overflow: hidden;
}
.cd-specs-mt { margin-top: 16px; }
.cd-spec {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    background: #ffffff;
    padding: 11px 15px;
}
.cd-spec-l { font-size: 13px; color: var(--color-text-gray, #666); }
.cd-spec-v { font-size: 13.5px; font-weight: 700; color: var(--color-text-primary, #1a1a2e); text-align: right; }

/* payout methods */
.cd-methods { margin-top: 16px; }
.cd-method-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 8px; }
.cd-method-chip {
    font-size: 12.5px; font-weight: 600; color: #46406b;
    background: #f1eefb; border-radius: 7px; padding: 5px 11px;
}

/* trading permission chips */
.cd-perms { display: flex; flex-wrap: wrap; gap: 9px; }
.cd-perm {
    display: inline-flex; align-items: center; gap: 7px;
    font-size: 13px; font-weight: 600;
    padding: 7px 13px; border-radius: 9px;
}
.cd-perm i { font-size: 12px; }
.cd-perm-ok { background: #e9f9f1; color: #0c7a52; }
.cd-perm-no { background: #fdecec; color: #b42318; }

.cd-rule-note { margin: 14px 0 0; font-size: 13px; line-height: 1.6; color: var(--color-text-mid, #555); }

/* back links */
.cd-back-links { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 6px; }
.cd-back-links a { font-size: 14px; font-weight: 600; color: #ffffff; text-decoration: underline; text-underline-offset: 3px; }
.cd-back-links a:hover { opacity: 0.85; }

/* ---------- sticky buy rail ---------- */
.cd-rail { position: sticky; top: 90px; }
.cd-buy {
    background: var(--color-surface-card, #ffffff);
    border: 1px solid var(--color-border-light, #e5e7eb);
    border-radius: 18px;
    padding: 22px;
    box-shadow: 0 12px 40px rgba(91, 76, 178, 0.14), 0 2px 6px rgba(17, 24, 39, 0.05);
}
.cd-save {
    display: inline-block;
    font-size: 12px; font-weight: 800; letter-spacing: 0.4px;
    color: #ffffff; background: linear-gradient(135deg, #10b981, #059669);
    padding: 4px 11px; border-radius: 20px; margin-bottom: 12px;
}
.cd-price { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.cd-price-now { font-size: 38px; font-weight: 800; color: var(--color-text-primary, #1a1a2e); line-height: 1; }
.cd-price-was { font-size: 18px; color: #9a93b8; text-decoration: line-through; }
.cd-price-note { margin: 8px 0 0; font-size: 12px; color: #9a93b8; }

.cd-promo {
    margin: 14px 0 0;
    font-size: 13px; color: var(--color-text-mid, #555);
    background: #f7f5ff; border: 1px dashed #c9bef0;
    border-radius: 9px; padding: 9px 13px; text-align: center;
}
.cd-promo strong { color: #5a49bf; letter-spacing: 0.5px; }

.cd-cta {
    display: flex; align-items: center; justify-content: center; gap: 9px;
    margin-top: 16px;
    width: 100%;
    background: linear-gradient(135deg, #6d5ef0, #5a49bf);
    color: #ffffff !important;
    font-size: 15px; font-weight: 700;
    padding: 15px 18px; border-radius: 12px;
    text-decoration: none;
    box-shadow: 0 6px 18px rgba(90, 73, 191, 0.34);
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
.cd-cta:hover { transform: translateY(-1px); filter: brightness(1.06); box-shadow: 0 8px 24px rgba(90, 73, 191, 0.42); color: #ffffff; }
.cd-cta-sub { margin: 11px 0 0; font-size: 11.5px; color: var(--color-text-light, #999); text-align: center; }
.cd-cta-sub .fa-lock { margin-right: 4px; }

.cd-buy-facts { list-style: none; margin: 18px 0 0; padding: 16px 0 0; border-top: 1px solid #f0eef8; }
.cd-buy-facts li { display: flex; align-items: center; justify-content: space-between; padding: 7px 0; }
.cd-buy-facts span { font-size: 13px; color: var(--color-text-gray, #666); }
.cd-buy-facts strong { font-size: 13.5px; color: var(--color-text-primary, #1a1a2e); }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
    .cd-grid { grid-template-columns: 1fr; }
    .cd-rail { position: static; order: -1; }
    .cd-buy { margin-bottom: 18px; }
    .cd-title { font-size: 26px; }
}
