/* =========================================================
   Customer portal page components.
   Same tokens and style as the customer dashboard: white / black / graphite,
   teal as the single accent, flat bordered sections, no hover motion.
   ========================================================= */
.cp {
    /* Dashboard tokens (also usable directly in page styles) */
    --black: #0b0c0d;
    --graphite: #2e3338;
    --graphite-2: #5b6168;
    --graphite-3: #8b9197;
    --soft: #f6f7f8;
    --teal: #0f766e;
    --teal-soft: #e8f5f3;
    /* Older names used by page styles, mapped onto the same tokens */
    --ink: #0b0c0d;
    --ink-soft: #2e3338;
    --ink-muted: #5b6168;
    --line: #e5e7e9;
    --line-soft: #eef0f1;
    --surface: #ffffff;
    --canvas: #f6f7f8;
    --stone: #f6f7f8;
    --sand: #e5e7e9;
    --ok: #0f766e;
    --ok-bg: #e8f5f3;
    --warn: #2e3338;
    --warn-bg: #f6f7f8;
    --radius: 12px;
    --radius-sm: 10px;
    --shadow-1: none;
    --shadow-2: none;
    color: var(--ink);
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0 0 24px;
    box-sizing: border-box;
}
.cp *, .cp *::before, .cp *::after { box-sizing: border-box; }

/* Customer pages use the full content width next to the sidebar */
.customer-page:has(> .cp) { max-width: none; padding: 24px 28px 40px; }
@media (max-width: 640px) { .customer-page:has(> .cp) { padding: 16px 14px 32px; } }

/* Page header: plain text with a rule underneath, like the dashboard */
.cp-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 28px;
}
.cp-eyebrow {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .4px;
    color: var(--graphite-3);
    margin-bottom: 6px;
}
.cp-title {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -.2px;
    margin: 0;
    line-height: 1.2;
    color: var(--ink);
}
.cp-sub { margin: 8px 0 0; font-size: 13.5px; color: var(--ink-muted); max-width: 720px; }
.cp-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* Buttons */
.cp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 16px;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid var(--line);
    color: var(--ink);
    background: var(--surface);
    cursor: pointer;
    transition: border-color .2s, background .2s;
    white-space: nowrap;
}
.cp-btn:hover { border-color: var(--graphite-3); color: var(--ink); }
.cp-btn.primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.cp-btn.primary:hover { background: var(--graphite); color: #fff; }
.cp-btn.sm { padding: 7px 12px; font-size: 12.5px; }
.cp-btn i { color: inherit; }

/* Summary strip: one bordered bar split into columns (same as the dashboard) */
.cp-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); border: 1px solid var(--line); border-radius: 12px; background: #fff; overflow: hidden; }
.cp-sum { padding: 20px 24px; border-left: 1px solid var(--line); margin-left: -1px; margin-top: -1px; border-top: 1px solid var(--line); }
.cp-sum-lbl { font-size: 13px; color: var(--graphite-2); }
.cp-sum-val { font-size: 26px; font-weight: 700; margin-top: 6px; letter-spacing: -.3px; font-variant-numeric: tabular-nums; color: var(--ink); }
.cp-sum-val small { font-size: 14px; font-weight: 600; color: var(--graphite-2); margin-left: 4px; }
.cp-sum-val.teal { color: var(--teal); }
.cp-sum-sub { font-size: 12.5px; color: var(--graphite-3); margin-top: 4px; }
@media (max-width: 520px) { .cp-sum { padding: 16px; } .cp-sum-val { font-size: 21px; } }

/* Panels: bordered section; a panel head reads like the dashboard section head */
.cp-panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
    min-width: 0;
}
.cp-panel + .cp-panel { margin-top: 24px; }
.cp-panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}
/* First thing in a panel: full-bleed head with a rule underneath, like the dashboard sections */
.cp-panel > .cp-panel-head:first-child {
    margin: -20px -20px 18px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--line);
}
@media (max-width: 640px) { .cp-panel > .cp-panel-head:first-child { margin: -16px -16px 16px; padding: 14px 16px; } }
.cp-panel-title { margin: 0; font-size: 15px; font-weight: 700; color: var(--ink); }
.cp-panel-sub { margin: 3px 0 0; font-size: 12.5px; color: var(--ink-muted); }
.cp-link {
    font-size: 13px;
    font-weight: 600;
    color: var(--teal);
    text-decoration: none;
    white-space: nowrap;
}
.cp-link:hover { color: var(--ink); }

/* Chips */
.cp-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 600;
    background: var(--soft);
    color: var(--ink-soft);
    white-space: nowrap;
}
.cp-chip.ok { background: var(--ok-bg); color: var(--ok); }
.cp-chip.warn { background: var(--warn-bg); color: var(--warn); }
.cp-chip.dark { background: var(--ink); color: #fff; }

/* Toolbar (search / filters) */
.cp-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 10px;
    margin-bottom: 18px;
}
.cp-search {
    flex: 1 1 240px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 12px;
    border-radius: 10px;
    background: var(--canvas);
    min-height: 42px;
}
.cp-search i { color: #8b9197; }
.cp-search input {
    border: 0;
    background: transparent;
    outline: none;
    width: 100%;
    font-size: 14px;
    color: var(--ink);
}
.cp-select {
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0 34px 0 12px;
    font-size: 13px;
    background-color: #fff;
    color: var(--ink);
    flex: 0 1 200px;
}
.cp-count { font-size: 12.5px; color: var(--ink-muted); padding: 0 6px; white-space: nowrap; }

/* Empty state */
.cp-empty {
    text-align: center;
    padding: 56px 20px;
    color: var(--ink-muted);
    background: var(--surface);
    border: 1px dashed var(--line);
    border-radius: var(--radius);
}
.cp-empty i { font-size: 34px; color: #8b9197; display: block; margin-bottom: 12px; }
.cp-empty h3 { font-size: 17px; font-weight: 700; color: var(--ink); margin: 0 0 6px; }
.cp-empty p { margin: 0; font-size: 13.5px; }

/* ---------- Media cards (announcements & offers) ----------
   Posters are shown in full: the image keeps its own aspect ratio
   and is never cropped. Cards flow in a masonry layout. */
.cp-masonry { column-gap: 18px; columns: 1; }
@media (min-width: 700px) { .cp-masonry { columns: 2; } }
@media (min-width: 1200px) { .cp-masonry { columns: 3; } }
.cp-masonry > * { break-inside: avoid; margin-bottom: 18px; }

.cp-media {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-1);
    transition: box-shadow .2s ease, transform .2s ease;
}
.cp-media:hover { border-color: var(--teal); }
.cp-media-img {
    position: relative;
    background: var(--canvas);
    cursor: zoom-in;
    border: 0;
    padding: 0;
    display: block;
    width: 100%;
}
.cp-media-img img { display: block; width: 100%; height: auto; }
.cp-media-img .cp-chip { position: absolute; top: 12px; left: 12px; box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.cp-media-noimg {
    aspect-ratio: 16 / 9;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8b9197;
    font-size: 34px;
}
.cp-media-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 10px; }
.cp-media-title { margin: 0; font-size: 15.5px; font-weight: 700; line-height: 1.35; }
.cp-media-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-muted); }
.cp-media-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 4px; }

/* Horizontal strip (dashboard) */
.cp-strip {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(260px, 1fr);
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 6px;
    scroll-snap-type: x mandatory;
}
.cp-strip > * { scroll-snap-align: start; }
.cp-strip .cp-media-img { aspect-ratio: 16 / 10; }
.cp-strip .cp-media-img img { height: 100%; object-fit: contain; }

/* Lightbox */
.cp-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(10,10,10,.86);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 3000;
}
.cp-lightbox.show { display: flex; }
.cp-lightbox img { max-width: min(1100px, 100%); max-height: 86vh; border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,.5); background: #fff; }
.cp-lightbox-caption { position: absolute; left: 0; right: 0; bottom: 18px; text-align: center; color: #fff; font-weight: 700; font-size: 14px; padding: 0 24px; }
.cp-lightbox-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 0;
    background: rgba(255,255,255,.14);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
}

/* ---------- Doctor cards ---------- */
.cp-doctor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 18px;
}
.cp-doctor {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-1);
    transition: box-shadow .2s ease, transform .2s ease;
}
.cp-doctor:hover { border-color: var(--teal); }
/* Portrait frame: faces sit in the upper part of headshots, so anchor the crop to the top */
.cp-doctor-photo {
    position: relative;
    aspect-ratio: 4 / 4.2;
    background: var(--soft);
    overflow: hidden;
}
.cp-doctor-photo img { width: 100%; height: 100%; object-fit: cover; object-position: center 15%; display: block; }
.cp-doctor-initials {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "Playfair Display", Georgia, serif;
    font-size: 54px;
    font-weight: 700;
    color: #8b9197;
}
.cp-doctor-photo .cp-chip { position: absolute; left: 12px; bottom: 12px; background: rgba(11,12,13,.82); color: #fff; }
.cp-doctor-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.cp-doctor-name { font-size: 16px; font-weight: 700; margin: 0; line-height: 1.25; }
.cp-doctor-spec { font-size: 12.5px; color: var(--ink-muted); margin: 2px 0 0; }
.cp-doctor-meta { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--ink-soft); }
.cp-doctor-meta span { display: flex; gap: 8px; align-items: flex-start; }
.cp-doctor-meta i { width: 14px; color: #8b9197; margin-top: 2px; }
.cp-fees {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border: 1px solid var(--line-soft);
    border-radius: 12px;
    overflow: hidden;
    margin-top: auto;
}
.cp-fees > div { padding: 10px 12px; }
.cp-fees > div + div { border-left: 1px solid var(--line-soft); background: var(--stone); }
.cp-fee-lbl { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--ink-muted); }
.cp-fee-val { font-size: 15px; font-weight: 700; }

/* Dialog (services) */
.cp-dialog {
    position: fixed;
    inset: 0;
    background: rgba(10,10,10,.55);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 3000;
}
.cp-dialog.show { display: flex; }
.cp-dialog-box {
    background: #fff;
    border-radius: 12px;
    width: min(620px, 100%);
    max-height: 86vh;
    overflow: auto;
    box-shadow: 0 24px 64px rgba(0,0,0,.3);
    font-family: "Inter", -apple-system, "Segoe UI", sans-serif;
    color: #0b0c0d;
}
.cp-dialog-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 22px;
    border-bottom: 1px solid #e5e7e9;
    position: sticky;
    top: 0;
    background: #fff;
}
.cp-dialog-head h3 { margin: 0; font-size: 17px; font-weight: 700; }
.cp-dialog-head p { margin: 3px 0 0; font-size: 12.5px; color: #5b6168; }
.cp-dialog-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid #e5e7e9;
    background: #fff;
    cursor: pointer;
    flex-shrink: 0;
}
.cp-dialog-note { padding: 12px 22px; font-size: 12.5px; color: #5b6168; background: #f6f7f8; }
.cp-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.cp-table th {
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--graphite-2);
    background: var(--soft);
    padding: 11px 20px;
    white-space: nowrap;
}
.cp-table td { padding: 15px 20px; border-top: 1px solid var(--line); color: var(--graphite); }
.cp-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Quick action tiles (dashboard) */
.cp-quick {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}
@media (max-width: 1080px) { .cp-quick { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.cp-quick a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--ink);
    transition: all .2s ease;
    min-width: 0;
}
.cp-quick a:hover { border-color: var(--teal); }
.cp-quick-ico {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--teal-soft);
    color: var(--teal);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.cp-quick strong { display: block; font-size: 13.5px; }
.cp-quick small { display: block; font-size: 11.5px; color: var(--ink-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Compact doctor list (dashboard) */
.cp-doc-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line-soft); }
.cp-doc-row:first-child { border-top: 0; padding-top: 0; }
.cp-doc-avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; object-position: center 15%; background: var(--stone); flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-weight: 700; color: #8b9197; font-size: 14px; }

@media (max-width: 640px) {
    .cp { padding: 4px 0 32px; }
    .cp-head { flex-direction: column; align-items: stretch; }
    .cp-actions .cp-btn { flex: 1; }
    .cp-panel { padding: 16px; }
    .cp-select { flex: 1 1 100%; }
    .cp-quick { gap: 10px; }
    .cp-quick a { padding: 12px; }
    .cp-quick small { display: none; }
}

/* ---------- Shared motion (used with /js/customer-motion.js) ---------- */
@keyframes cp-rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.cp-reveal { opacity: 0; transform: translateY(16px); }
.cp-reveal.is-in { animation: cp-rise .6s cubic-bezier(.2,.7,.2,1) forwards; animation-delay: var(--cp-delay, 0s); }
@media (prefers-reduced-motion: reduce) {
    .cp-reveal { opacity: 1; transform: none; }
    .cp-reveal.is-in { animation: none; }
}

/* ---------- Learning hub: episodes & player ---------- */
/* Header reads like the dashboard header: plain text, a rule underneath, stats on the right */
.pc-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px; align-items: center; padding-bottom: 24px; border-bottom: 1px solid var(--line, #e5e7e9); color: var(--black, #0b0c0d); }
@media (max-width: 760px) { .pc-hero { grid-template-columns: 1fr; } }
.pc-hero .cp-eyebrow { color: var(--graphite-3, #8b9197); }
.pc-hero h1 { font-size: 24px; font-weight: 700; letter-spacing: -.2px; margin: 0; color: var(--black, #0b0c0d); }
.pc-hero p { margin: 8px 0 0; color: var(--graphite-2, #5b6168); font-size: 13.5px; max-width: 620px; }
.pc-stats { display: flex; gap: 28px; align-items: center; flex-wrap: wrap; }
.pc-stats strong { display: block; font-size: 24px; font-weight: 700; line-height: 1; color: var(--teal, #0f766e); font-variant-numeric: tabular-nums; }
.pc-stats span { font-size: 12.5px; color: var(--graphite-2, #5b6168); }
.pc-eq { display: none; }

.pc-episodes { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 16px; }
.pc-ep { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line, #e5e7e9); border-radius: 12px; overflow: hidden; text-align: left; padding: 0; cursor: pointer; color: #0b0c0d; font: inherit; transition: border-color .2s; }
.pc-ep:hover { border-color: var(--teal, #0f766e); }
.pc-thumb { position: relative; aspect-ratio: 16 / 9; background: #f6f7f8; overflow: hidden; }
.pc-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pc-play { position: absolute; left: 10px; bottom: 10px; width: 34px; height: 34px; border-radius: 50%; background: rgba(11,12,13,.82); color: #fff; display: flex; align-items: center; justify-content: center; z-index: 1; font-size: 11px; }
.pc-play i { margin-left: 2px; }
.pc-ep-no { position: absolute; right: 10px; bottom: 10px; z-index: 1; font-size: 11px; font-weight: 600; color: #fff; background: rgba(11,12,13,.8); border-radius: 999px; padding: 3px 9px; }
.pc-ep-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; }
.pc-ep-title { font-size: 13.5px; font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pc-ep-meta { font-size: 12px; color: #8b9197; }
.pc-noembed { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #5b6168; font-size: 30px; }

/* Player pop-up */
.pc-modal { position: fixed; inset: 0; background: rgba(10,10,10,.88); display: none; align-items: center; justify-content: center; padding: 20px; z-index: 3000; }
.pc-modal.show { display: flex; }
.pc-modal-box { width: min(980px, 100%); }
.pc-modal-frame { position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: #0b0c0d; box-shadow: 0 30px 80px rgba(0,0,0,.6); }
.pc-modal-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.pc-modal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; color: #fff; margin-bottom: 12px; }
.pc-modal-head strong { font-size: 15px; }
.pc-modal-head small { display: block; color: rgba(255,255,255,.6); font-size: 12px; }
.pc-modal-close { width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255,255,255,.14); color: #fff; cursor: pointer; flex-shrink: 0; }

