/*
 * Careeroria Platform Bridge — front end.
 *
 * Colours come from the host plugins' own variables (WP Sell Services'
 * --wpss-*, falling back to the theme's preset palette), so the Careeroria
 * sections sit inside the WP Sell Services account shell without a second
 * design system.
 */

.cpb-section {
	--cpb-accent: var(--wpss-primary, var(--wp--preset--color--primary, #1f4e79));
	--cpb-text: var(--wpss-text, #1f2937);
	--cpb-muted: var(--wpss-text-muted, #5b6472);
	--cpb-border: var(--wpss-border, #e5e7eb);
	--cpb-surface: var(--wpss-white, #fff);
	--cpb-soft: var(--wpss-gray-100, #f3f4f6);
	--cpb-radius: var(--wpss-radius-lg, 12px);
	color: var(--cpb-text);
	display: grid;
	gap: 1.25rem;
	min-width: 0;
}

.cpb-section *,
.cpb-shell * { box-sizing: border-box; }

.cpb-muted { color: var(--cpb-muted); font-size: .9em; }
.cpb-grow { flex: 1 1 auto; min-width: 0; }
.cpb-section p { margin: 0; }
.cpb-section h2, .cpb-section h3 { margin: 0; line-height: 1.3; }
.cpb-section ul { list-style: none; margin: 0; padding: 0; }

/* Welcome + stats */
.cpb-welcome__hello { font-size: 1.35rem; font-weight: 600; }
.cpb-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem; }
.cpb-stat a {
	display: flex; flex-direction: column; gap: .15rem; padding: 1rem 1.1rem;
	border: 1px solid var(--cpb-border); border-radius: var(--cpb-radius);
	background: var(--cpb-surface); color: inherit; text-decoration: none;
	transition: border-color .15s, box-shadow .15s;
}
.cpb-stat a:hover { border-color: var(--cpb-accent); box-shadow: 0 2px 8px rgba(0,0,0,.05); }
.cpb-stat__value { font-size: 1.6rem; font-weight: 700; line-height: 1.1; }
.cpb-stat__label { color: var(--cpb-muted); font-size: .9rem; }
.cpb-stat--alert .cpb-stat__value { color: var(--cpb-accent); }

/* Cards */
.cpb-card {
	background: var(--cpb-surface); border: 1px solid var(--cpb-border);
	border-radius: var(--cpb-radius); padding: 1.1rem 1.2rem; display: grid; gap: .85rem; min-width: 0;
}
.cpb-card--attention { border-color: color-mix(in srgb, var(--cpb-accent) 45%, var(--cpb-border)); background: color-mix(in srgb, var(--cpb-accent) 4%, var(--cpb-surface)); }
.cpb-card__head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.cpb-card__title { font-size: 1.05rem; font-weight: 600; }
.cpb-card__head a { font-size: .9rem; }
.cpb-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 1rem; }

/* Lists */
.cpb-list { display: grid; }
.cpb-list__item {
	display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
	padding: .7rem 0; border-top: 1px solid var(--cpb-border);
}
.cpb-list__item:first-child { border-top: 0; padding-top: 0; }
.cpb-list--compact .cpb-list__item { padding: .5rem 0; }
.cpb-list--cards .cpb-list__item { border: 1px solid var(--cpb-border); border-radius: var(--cpb-radius); padding: 1rem; margin-bottom: .75rem; }
.cpb-list__item.is-unread a { font-weight: 600; }
.cpb-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.cpb-empty, .cpb-empty-state p { color: var(--cpb-muted); }
.cpb-empty-state { display: grid; gap: .75rem; justify-items: start; padding: 1.5rem; border: 1px dashed var(--cpb-border); border-radius: var(--cpb-radius); }

/* Buttons */
.cpb-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: .35rem;
	min-height: 40px; padding: .5rem 1rem; border-radius: 8px;
	border: 1px solid var(--cpb-border); background: var(--cpb-surface); color: var(--cpb-text);
	font: inherit; font-weight: 600; font-size: .92rem; line-height: 1.2; text-decoration: none; cursor: pointer;
	transition: background .15s, border-color .15s, color .15s;
}
.cpb-btn:hover { border-color: var(--cpb-accent); color: var(--cpb-accent); }
.cpb-btn--primary { background: var(--cpb-accent); border-color: var(--cpb-accent); color: #fff; }
.cpb-btn--primary:hover { background: color-mix(in srgb, var(--cpb-accent) 85%, #000); color: #fff; }
.cpb-btn--sm { min-height: 32px; padding: .3rem .7rem; font-size: .85rem; }
.cpb-section a:focus-visible, .cpb-btn:focus-visible, .cpb-section input:focus-visible,
.cpb-section select:focus-visible, .cpb-section button:focus-visible, .cpb-shell a:focus-visible {
	outline: 3px solid color-mix(in srgb, var(--cpb-accent) 55%, transparent); outline-offset: 2px;
}
.cpb-quicklinks { display: flex; gap: .5rem; flex-wrap: wrap; }

/* Badges */
.cpb-badge {
	display: inline-block; padding: .15rem .55rem; border-radius: 999px; font-size: .78rem; font-weight: 600;
	background: var(--cpb-soft); color: var(--cpb-text); white-space: nowrap;
}
.cpb-badge--paid, .cpb-badge--completed, .cpb-badge--cert-active { background: #e7f6ec; color: #166534; }
.cpb-badge--pending, .cpb-badge--pending_payment, .cpb-badge--pending_requirements,
.cpb-badge--pending_approval, .cpb-badge--not_started { background: #fff6e0; color: #8a5a00; }
.cpb-badge--in_progress, .cpb-badge--revision_requested, .cpb-badge--delivered { background: #e8f0fe; color: #1d4ed8; }
.cpb-badge--failed, .cpb-badge--cancelled, .cpb-badge--disputed, .cpb-badge--late,
.cpb-badge--cert-revoked, .cpb-badge--ended { background: #fdecec; color: #9b1c1c; }
.cpb-badge--refunded, .cpb-badge--partially_refunded, .cpb-badge--cert-expired { background: #f1eefe; color: #5b21b6; }

/* Progress */
.cpb-progress { height: 8px; border-radius: 999px; background: var(--cpb-soft); overflow: hidden; margin: .4rem 0 .2rem; }
.cpb-progress span { display: block; height: 100%; background: var(--cpb-accent); border-radius: inherit; }

/* Courses */
.cpb-course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 1rem; }
.cpb-course { display: flex; flex-direction: column; border: 1px solid var(--cpb-border); border-radius: var(--cpb-radius); overflow: hidden; background: var(--cpb-surface); }
.cpb-course[hidden] { display: none; }
.cpb-course__media { display: block; aspect-ratio: 16 / 9; background: var(--cpb-soft); }
.cpb-course__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cpb-course__body { display: grid; gap: .5rem; padding: 1rem; flex: 1; align-content: start; }
.cpb-course__title { font-size: 1rem; }
.cpb-course__title a { color: inherit; text-decoration: none; }
.cpb-course__actions { margin-top: auto; padding-top: .25rem; }
.cpb-meta { display: flex; flex-wrap: wrap; gap: .25rem 1rem; margin: 0; font-size: .85rem; }
.cpb-meta div { display: flex; gap: .3rem; }
.cpb-meta dt { color: var(--cpb-muted); }
.cpb-meta dd { margin: 0; }

/* Filters */
.cpb-filter { display: flex; flex-wrap: wrap; gap: .4rem; }
.cpb-filter button {
	min-height: 36px; padding: .3rem .85rem; border-radius: 999px; border: 1px solid var(--cpb-border);
	background: var(--cpb-surface); color: var(--cpb-text); font: inherit; font-size: .88rem; cursor: pointer;
}
.cpb-filter button.is-active { background: var(--cpb-accent); border-color: var(--cpb-accent); color: #fff; }
.cpb-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .75rem; }
.cpb-filters label { display: grid; gap: .25rem; font-size: .85rem; color: var(--cpb-muted); }

/* Tables */
.cpb-table-wrap { overflow-x: auto; }
.cpb-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.cpb-table th, .cpb-table td { text-align: left; padding: .65rem .5rem; border-bottom: 1px solid var(--cpb-border); vertical-align: top; }
.cpb-table th { font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--cpb-muted); font-weight: 600; }
.cpb-table .num { text-align: right; white-space: nowrap; }
.cpb-table code { font-size: .85em; background: none; padding: 0; }

/* Products */
.cpb-products { display: grid; gap: 1rem; }
.cpb-product__head { display: flex; gap: 1rem; align-items: flex-start; }
.cpb-product__thumb { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; flex: none; }

/* Forms */
.cpb-form { display: grid; gap: 1rem; }
.cpb-form__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem 1rem; }
.cpb-field { display: grid; gap: .3rem; }
.cpb-field--wide { grid-column: 1 / -1; }
.cpb-field label { font-weight: 600; font-size: .9rem; }
.cpb-section input[type="text"], .cpb-section input[type="email"], .cpb-section input[type="tel"],
.cpb-section input[type="password"], .cpb-section select {
	width: 100%; min-height: 42px; padding: .5rem .7rem; border: 1px solid var(--cpb-border);
	border-radius: 8px; background: var(--cpb-surface); color: var(--cpb-text); font: inherit;
}
.cpb-filters select { width: auto; min-width: 160px; }
.cpb-check { display: flex; gap: .6rem; align-items: flex-start; padding: .4rem 0; }
.cpb-check input { margin-top: .25rem; }

/* Notices */
.cpb-notice { padding: .75rem 1rem; border-radius: 8px; border-left: 4px solid; }
.cpb-notice--success { background: #e7f6ec; border-color: #16a34a; color: #14532d; }
.cpb-notice--error { background: #fdecec; border-color: #dc2626; color: #7f1d1d; }
.cpb-notice--warning { background: #fff6e0; border-color: #d97706; color: #78350f; }

.cpb-receipt-nav { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }

/* Fallback shell (only when WP Sell Services is inactive) */
.cpb-shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 2rem; }
.cpb-shell__nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .25rem; }
.cpb-shell__nav a { display: block; padding: .55rem .75rem; border-radius: 8px; text-decoration: none; color: inherit; }
.cpb-shell__nav a[aria-current="page"] { background: var(--wpss-gray-100, #f3f4f6); font-weight: 600; }
.cpb-shell__title { margin-top: 0; }

/* Small screens */
@media (max-width: 700px) {
	.cpb-form__grid { grid-template-columns: 1fr; }
	.cpb-shell { grid-template-columns: 1fr; gap: 1rem; }
	.cpb-shell__nav ul { display: flex; overflow-x: auto; gap: .25rem; }
	.cpb-shell__nav a { white-space: nowrap; }
	.cpb-table thead { display: none; }
	.cpb-table, .cpb-table tbody, .cpb-table tr, .cpb-table td { display: block; width: 100%; }
	.cpb-table tr { border: 1px solid var(--cpb-border); border-radius: var(--cpb-radius); padding: .5rem .75rem; margin-bottom: .75rem; }
	.cpb-table td { border: 0; padding: .3rem 0; text-align: left; display: flex; justify-content: space-between; gap: 1rem; }
	.cpb-table td.num { text-align: right; }
	.cpb-table td[data-label]::before { content: attr(data-label); color: var(--cpb-muted); font-size: .82rem; font-weight: 600; }
	.cpb-list__item .cpb-btn { width: 100%; }
}

/*
 * "Enable Service Reviews: No" — ratings printed by WP Sell Services
 * templates that offer no hook. Submission is refused server-side; this only
 * removes the display.
 */
.cpb-no-reviews .wpss-service-card__star,
.cpb-no-reviews .wpss-service-card__rating-value,
.cpb-no-reviews .wpss-service-card__rating-count,
.cpb-no-reviews .wpss-service-card__rating-new,
.cpb-no-reviews .wpss-meta-rating,
.cpb-no-reviews .wpss-order-section--review,
.cpb-no-reviews .wpss-write-review-btn,
.cpb-no-reviews .wpss-review-cta,
.cpb-no-reviews .wpss-party-info__rating,
.cpb-no-reviews .wpss-vendor-rating,
.cpb-no-reviews .wpss-service-reviews,
.cpb-no-reviews #reviews,
.cpb-no-reviews a[href="#reviews"] { display: none !important; }

/*
 * "Enable Vendor Profile: No" — seller identity, badges and statistics.
 */
.cpb-no-vendor-profiles .wpss-service-card__vendor,
.cpb-no-vendor-profiles .wpss-seller-badge,
.cpb-no-vendor-profiles .wpss-service-card__verified,
.cpb-no-vendor-profiles .wpss-meta-queue,
.cpb-no-vendor-profiles .wpss-vendor-quick-stats,
.cpb-no-vendor-profiles .wpss-party-info__rating,
.cpb-no-vendor-profiles .wpss-vendor-card { display: none !important; }
