/* Edupetal Core components — theme-agnostic, overridable via CSS variables */
:root {
	--ep-brand: #b0213b;
	--ep-brand-dark: #7d1328;
	--ep-ink: #17181c;
	--ep-muted: #6b6f78;
	--ep-line: #ececf0;
	--ep-bg: #f6f6f8;
	--ep-card: #fff;
	--ep-radius: 18px;
	--ep-info-bg: #eaf3fc;
	--ep-info-ink: #0d5c8f;
	--ep-ok: #1f8a4c;
	--ep-bad: #c62f3d;
}
.ep-icon { width: 22px; height: 22px; flex: none; }
.ep-card { background: var(--ep-card); border: 1px solid var(--ep-line); border-radius: var(--ep-radius); padding: 22px 24px; margin-bottom: 20px; }
.ep-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.ep-card-head h2, .ep-card-head h3 { margin: 0; display: flex; align-items: center; gap: 10px; }
.ep-card-head h2 { font-size: 1.35rem; }
.ep-muted { color: var(--ep-muted); }
.ep-notice { text-align: center; }
.ep-loading { text-align: center; color: var(--ep-muted); }
.ep-error { color: var(--ep-bad); font-weight: 600; }

.ep-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 18px; border-radius: 999px; border: 1px solid var(--ep-line); background: #fff; color: var(--ep-ink); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; transition: .15s; }
.ep-btn:hover { border-color: var(--ep-ink); }
.ep-btn-primary { background: var(--ep-brand); border-color: var(--ep-brand); color: #fff; }
.ep-btn-primary:hover { background: var(--ep-brand-dark); border-color: var(--ep-brand-dark); color: #fff; }
.ep-btn-dark { background: var(--ep-ink); border-color: var(--ep-ink); color: #fff; }
.ep-btn:disabled { opacity: .6; cursor: wait; }

/* Banners */
.ep-banners { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 34px; }
.ep-banner { display: block; aspect-ratio: 4 / 1; border-radius: 12px; overflow: hidden; text-decoration: none; }
.ep-banner img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ep-banner-text { display: flex; flex-direction: column; justify-content: center; height: 100%; padding: 14px 22px; box-sizing: border-box; }
.ep-banner-text strong { font-size: clamp(1.1rem, 2vw, 1.7rem); line-height: 1.1; }
.ep-banner-text span { font-size: .85rem; margin-top: 6px; opacity: .85; }
.ep-banner-1 .ep-banner-text { background: linear-gradient(135deg, #ffd84d, #ffbf1f); color: #b0213b; }
.ep-banner-2 .ep-banner-text { background: linear-gradient(135deg, #ffe36b, #ffc928); color: #7d1328; }
.ep-banner-3 .ep-banner-text { background: linear-gradient(135deg, #16a34a, #0f7a37); color: #fff; }

/* Take a test */
.ep-test-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.ep-test-card { display: flex; gap: 18px; align-items: flex-start; padding: 26px 24px; border-radius: 12px; text-decoration: none; color: var(--ep-ink); transition: transform .15s, box-shadow .15s; }
.ep-test-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,.06); }
.ep-test-card strong { display: block; font-size: 1.1rem; margin-bottom: 4px; }
.ep-test-card span span { font-size: .95rem; line-height: 1.4; }
.ep-test-badge { flex: none; width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 1.3rem; color: #fff; }
.ep-tone-peach { background: #fdf1ea; } .ep-tone-peach strong, .ep-tone-peach span span { color: #c55a12; } .ep-tone-peach .ep-test-badge { background: #f07c1f; }
.ep-tone-grey { background: #f0f0f2; } .ep-tone-grey .ep-test-badge { background: #1e7f43; }
.ep-tone-lavender { background: #ececf8; } .ep-tone-lavender .ep-test-badge { background: #2b2f86; }
.ep-tone-lime { background: #eef5dc; } .ep-tone-lime strong, .ep-tone-lime span span { color: #4f6b12; } .ep-tone-lime .ep-test-badge { background: #6f9b1c; }
.ep-more { color: var(--ep-ink); text-decoration: none; font-weight: 800; letter-spacing: 2px; }

/* Events */
.ep-events .ep-card-head h3 { font-size: .95rem; letter-spacing: .04em; text-transform: uppercase; color: var(--ep-muted); }
.ep-events .ep-card-head a { color: var(--ep-brand); font-weight: 700; text-decoration: none; }
.ep-event { background: var(--ep-bg); border-radius: 12px; padding: 20px; margin-bottom: 14px; }
.ep-event-main { display: flex; gap: 18px; }
.ep-cal { flex: none; width: 64px; height: 64px; border-radius: 50%; background: var(--ep-brand-dark); display: grid; place-items: center; }
.ep-cal span { background: #fff; width: 30px; height: 28px; border-radius: 4px; border-top: 6px solid #e6e6e6; display: grid; place-items: center; font-weight: 800; font-size: .85rem; color: var(--ep-ink); box-sizing: border-box; }
.ep-tag { display: inline-block; background: #e3eefb; color: var(--ep-info-ink); font-size: .85rem; padding: 2px 10px; border-radius: 8px; margin-bottom: 6px; }
.ep-event-title { display: block; font-weight: 700; font-size: 1.1rem; color: var(--ep-ink); text-decoration: none; line-height: 1.35; }
.ep-event-title:hover { color: var(--ep-brand); }
.ep-event footer { display: flex; align-items: center; gap: 16px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--ep-line); color: var(--ep-muted); font-size: .9rem; }
.ep-pill { border: 1px solid var(--ep-line); border-radius: 999px; padding: 4px 12px; background: #fff; }
.ep-comments { display: inline-flex; align-items: center; gap: 6px; }
.ep-comments .ep-icon { width: 16px; height: 16px; }

/* CBT setup */
.ep-cbt-setup h2 { margin-top: 0; }
.ep-subjects { border: 0; padding: 0; margin: 18px 0; display: flex; flex-wrap: wrap; gap: 10px; }
.ep-subjects legend { font-weight: 700; margin-bottom: 10px; }
.ep-chip input { position: absolute; opacity: 0; }
.ep-chip span { display: inline-block; padding: 8px 16px; border: 1px solid var(--ep-line); border-radius: 999px; cursor: pointer; transition: .15s; }
.ep-chip input:checked + span { background: var(--ep-brand); border-color: var(--ep-brand); color: #fff; }
.ep-chip input:focus-visible + span { outline: 2px solid var(--ep-brand); outline-offset: 2px; }
.ep-chip.is-locked span { opacity: .85; cursor: not-allowed; }
.ep-row { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 18px; }
.ep-row label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: .9rem; }
.ep-row input, .ep-row select, .ep-study-filters select, .ep-study-filters input { padding: 10px 12px; border: 1px solid var(--ep-line); border-radius: 10px; font: inherit; min-width: 160px; background: #fff; }

/* Exam room */
.ep-room-head { display: flex; align-items: center; gap: 16px; position: sticky; top: var(--ept-head, 0px); z-index: 5; background: var(--ep-card); border: 1px solid var(--ep-line); border-radius: var(--ep-radius); padding: 14px 20px; margin-bottom: 14px; }
.ep-room-head h2 { margin: 0; flex: 1; font-size: 1.15rem; }
.ep-clock { font-variant-numeric: tabular-nums; font-weight: 800; font-size: 1.2rem; }
.ep-clock span { font-weight: 500; font-size: .8rem; color: var(--ep-muted); margin-right: 4px; }
.ep-clock.is-low { color: var(--ep-bad); }
.ep-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.ep-tab { padding: 8px 16px; border-radius: 999px; border: 1px solid var(--ep-line); background: #fff; cursor: pointer; font: inherit; font-weight: 600; }
.ep-tab.is-active { background: var(--ep-ink); border-color: var(--ep-ink); color: #fff; }
.ep-room-body { display: grid; grid-template-columns: 1fr 280px; gap: 20px; align-items: start; }
.ep-qnum { font-size: .85rem; font-weight: 700; color: var(--ep-muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 10px; }
.ep-qtext { font-size: 1.1rem; line-height: 1.55; margin-bottom: 18px; }
.ep-qtext p:last-child { margin-bottom: 0; }
.ep-options { display: grid; gap: 10px; }
.ep-option { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border: 1px solid var(--ep-line); border-radius: 12px; cursor: pointer; transition: .12s; }
.ep-option:hover { border-color: var(--ep-ink); }
.ep-option input { position: absolute; opacity: 0; }
.ep-option.is-chosen { border-color: var(--ep-brand); background: #fdf0f2; }
.ep-opt-letter { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--ep-bg); font-weight: 800; }
.ep-option.is-chosen .ep-opt-letter { background: var(--ep-brand); color: #fff; }
.ep-qnav { display: flex; justify-content: space-between; margin-top: 22px; }
.ep-palette h4 { margin: 0 0 12px; }
.ep-pal-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.ep-pal { aspect-ratio: 1; border: 1px solid var(--ep-line); background: #fff; border-radius: 8px; cursor: pointer; font: inherit; font-size: .8rem; font-weight: 600; min-width: 34px; }
.ep-pal.is-done { background: var(--ep-ok); border-color: var(--ep-ok); color: #fff; }
.ep-pal.is-current { outline: 2px solid var(--ep-ink); outline-offset: 1px; }
.ep-keys { font-size: .8rem; text-align: center; }

/* Results */
.ep-result-head { display: flex; justify-content: space-between; align-items: center; }
.ep-result-head h2 { margin: 0; }
.ep-score-ring { --p: 0; width: 110px; height: 110px; border-radius: 50%; background: conic-gradient(var(--ep-brand) calc(var(--p) * 1%), var(--ep-line) 0); display: grid; place-items: center; }
.ep-score-ring span { width: 84px; height: 84px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-weight: 800; font-size: 1.4rem; }
.ep-aggregate { font-size: 1.1rem; }
.ep-bar-row { display: grid; grid-template-columns: 180px 1fr 60px; gap: 14px; align-items: center; margin: 10px 0; }
.ep-bar { height: 10px; background: var(--ep-bg); border-radius: 99px; overflow: hidden; }
.ep-bar i { display: block; height: 100%; background: var(--ep-brand); border-radius: 99px; }
.ep-result-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 24px; }
.ep-review { border-left: 4px solid var(--ep-line); }
.ep-review.is-right { border-left-color: var(--ep-ok); }
.ep-review.is-wrong { border-left-color: var(--ep-bad); }
.ep-review-opts { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 6px; }
.ep-review-opts li { padding: 8px 12px; border-radius: 8px; background: var(--ep-bg); cursor: default; }
.ep-study .ep-review-opts li { cursor: pointer; }
.ep-review-opts li.is-answer { background: #e3f5ea; color: #145c33; font-weight: 600; }
.ep-review-opts li.is-chosen-wrong { background: #fbe5e7; color: #8a1d27; text-decoration: line-through; }
.ep-explain { background: #fff9e6; border-radius: 10px; padding: 10px 14px; margin-top: 12px; font-size: .95rem; }
.ep-explain p { margin: 0; }

/* Study */
.ep-study-filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.ep-study-pager { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.ep-study-pager .ep-pal { width: 40px; }

/* Dashboard */
.ep-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.ep-stat span { display: block; color: var(--ep-muted); font-size: .9rem; }
.ep-stat strong { font-size: 2rem; }
.ep-table { width: 100%; border-collapse: collapse; }
.ep-table th, .ep-table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--ep-line); }
.ep-table th { font-size: .8rem; text-transform: uppercase; color: var(--ep-muted); }

@media (max-width: 900px) {
	.ep-banners { grid-template-columns: 1fr; }
	.ep-room-body { grid-template-columns: 1fr; }
	.ep-palette { order: -1; }
	.ep-pal-grid { grid-template-columns: repeat(10, 1fr); }
}
@media (max-width: 640px) {
	.ep-test-grid, .ep-stats { grid-template-columns: 1fr; }
	.ep-bar-row { grid-template-columns: 1fr 50px; }
	.ep-bar-row .ep-bar { grid-column: 1 / -1; grid-row: 2; }
	.ep-room-head { flex-wrap: wrap; }
	.ep-table { font-size: .85rem; }
}
