/* Components on top of Tailwind. Colours come from CSS variables set in the admin panel. */
h1, h2, h3, .font-display { font-family: "Bricolage Grotesque", system-ui, sans-serif; letter-spacing: -0.015em; }
:focus-visible { outline: 3px solid rgb(var(--accent) / .55); outline-offset: 2px; }

.logo-mark { width: 30px; height: 30px; border-radius: 9px; background: rgb(var(--ink)); position: relative; display: inline-block; }
.logo-mark::after { content: ""; position: absolute; left: 9px; top: 6px; width: 8px; height: 14px; border: solid rgb(var(--mark)); border-width: 0 3px 3px 0; transform: rotate(40deg); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; font-weight: 600; border-radius: .75rem; padding: .75rem 1.25rem; transition: background .15s, color .15s, border-color .15s; line-height: 1.2; }
.btn-sm { padding: .5rem .9rem; font-size: .875rem; border-radius: .6rem; }
.btn-ink { background: rgb(var(--ink)); color: #fff; }
.btn-ink:hover { background: rgb(var(--ink) / .88); }
.btn-accent { background: rgb(var(--accent)); color: #fff; }
.btn-accent:hover { background: rgb(var(--accent) / .88); }
.btn-ghost { border: 1.5px solid #E3E8F0; color: rgb(var(--ink)); background: #fff; }
.btn-ghost:hover { border-color: rgb(var(--ink) / .4); }
.btn-mark { background: rgb(var(--mark)); color: rgb(var(--ink)); }
.btn[disabled], .btn.is-disabled { opacity: .5; pointer-events: none; }

/* Navigation */
.nav-link { display: inline-flex; align-items: center; gap: .25rem; padding: .5rem .7rem; border-radius: .5rem; color: rgb(var(--ink)); font-weight: 500; }
.nav-link:hover, .nav-link.is-active, .group:focus-within > .nav-link { background: #F5F7FB; }
.dropdown { position: absolute; left: 0; top: calc(100% + 6px); width: 21rem; background: #fff; border: 1px solid #E3E8F0; border-radius: 1rem; padding: 1rem; box-shadow: 0 18px 40px -18px rgb(var(--ink) / .35); opacity: 0; visibility: hidden; transform: translateY(4px); transition: opacity .15s, transform .15s, visibility .15s; }
.dropdown::before { content: ""; position: absolute; left: 0; right: 0; top: -10px; height: 10px; }
.group:hover > .dropdown, .group:focus-within > .dropdown { opacity: 1; visibility: visible; transform: none; }
.dd-item { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .5rem .6rem; border-radius: .5rem; font-size: .9rem; color: #334155; }
.dd-item:hover { background: #F5F7FB; color: rgb(var(--ink)); }

.cat-chip { --c: #1D4ED8; display: inline-grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: .65rem; color: var(--c); background: color-mix(in srgb, var(--c) 12%, white); flex-shrink: 0; }
.cat-chip-sm { width: 1.6rem; height: 1.6rem; border-radius: .45rem; }
.badge-free { font-size: .7rem; font-weight: 700; padding: .1rem .45rem; border-radius: 999px; background: rgb(var(--mark)); color: rgb(var(--ink)); }
.badge { display: inline-flex; align-items: center; gap: .25rem; font-size: .75rem; font-weight: 600; padding: .2rem .55rem; border-radius: 999px; background: #F1F5F9; color: #475569; }

/* Flash */
.flash { padding: .8rem 1rem; border-radius: .75rem; font-size: .925rem; border: 1px solid; }
.flash-success { background: #ECFDF5; border-color: #A7F3D0; color: #065F46; }
.flash-error { background: #FEF2F2; border-color: #FECACA; color: #991B1B; }
.flash-info { background: #EFF6FF; border-color: #BFDBFE; color: #1E40AF; }

/* Pack card: the left rail carries the category colour */
.pack { --c: #1D4ED8; position: relative; background: #fff; border: 1px solid #E3E8F0; border-radius: 1rem; padding: 1.25rem 1.25rem 1.1rem 1.5rem; display: flex; flex-direction: column; gap: .75rem; overflow: hidden; }
.pack::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--c); }
.pack:hover { border-color: color-mix(in srgb, var(--c) 45%, #E3E8F0); }
.pack h3 a::after { content: ""; position: absolute; inset: 0; }
.pack .pack-actions { position: relative; z-index: 1; }

/* Hero question ticket */
.ticket { background: #fff; border-radius: 1.25rem; box-shadow: 0 30px 60px -30px rgb(0 0 0 / .55); overflow: hidden; color: #334155; }
.ticket-head { display: flex; justify-content: space-between; align-items: center; padding: .9rem 1.25rem; border-bottom: 1px dashed #CBD5E1; font-size: .8rem; color: #64748B; }
.opt { width: 100%; text-align: left; display: flex; gap: .75rem; align-items: flex-start; padding: .7rem .9rem; border: 1.5px solid #E3E8F0; border-radius: .75rem; background: #fff; font-size: .95rem; transition: border-color .12s, background .12s; }
.opt:hover:not([disabled]) { border-color: rgb(var(--ink) / .35); }
.opt .key { flex-shrink: 0; width: 1.6rem; height: 1.6rem; border-radius: .45rem; display: grid; place-items: center; font-weight: 700; font-size: .8rem; background: #F1F5F9; color: rgb(var(--ink)); }
.opt.is-picked { border-color: rgb(var(--ink)); background: rgb(var(--ink) / .04); }
.opt.is-picked .key { background: rgb(var(--ink)); color: #fff; }
.opt.is-right { border-color: #10B981; background: #ECFDF5; }
.opt.is-right .key { background: #10B981; color: #fff; }
.opt.is-wrong { border-color: #EF4444; background: #FEF2F2; }
.opt.is-wrong .key { background: #EF4444; color: #fff; }
.explain { border-left: 3px solid rgb(var(--accent)); background: rgb(var(--accent) / .07); padding: .75rem 1rem; border-radius: 0 .6rem .6rem 0; font-size: .9rem; }

/* Forms */
.field { display: block; }
.field > span { display: block; font-size: .85rem; font-weight: 600; color: rgb(var(--ink)); margin-bottom: .35rem; }
.input { width: 100%; border: 1.5px solid #E3E8F0; border-radius: .7rem; padding: .7rem .85rem; background: #fff; font-size: .95rem; }
.input:focus { outline: none; border-color: rgb(var(--accent)); box-shadow: 0 0 0 3px rgb(var(--accent) / .15); }

/* Rich content from the admin editor */
.prose-rr { line-height: 1.75; color: #334155; max-width: 72ch; }
.prose-rr h2 { font-size: 1.5rem; color: rgb(var(--ink)); font-weight: 700; margin: 2rem 0 .75rem; }
.prose-rr h3 { font-size: 1.2rem; color: rgb(var(--ink)); font-weight: 700; margin: 1.5rem 0 .5rem; }
.prose-rr p, .prose-rr ul, .prose-rr ol { margin: 0 0 1rem; }
.prose-rr ul { list-style: disc; padding-left: 1.25rem; }
.prose-rr ol { list-style: decimal; padding-left: 1.25rem; }
.prose-rr a { color: rgb(var(--accent)); text-decoration: underline; }
.prose-rr img { border-radius: .75rem; max-width: 100%; height: auto; }
.prose-rr table { width: 100%; border-collapse: collapse; margin-bottom: 1rem; display: block; overflow-x: auto; }
.prose-rr td, .prose-rr th { border: 1px solid #E3E8F0; padding: .5rem .75rem; }

/* Exam palette */
.pal { width: 2.4rem; height: 2.4rem; border-radius: .55rem; font-size: .85rem; font-weight: 600; border: 1.5px solid #E3E8F0; background: #fff; color: #475569; }
.pal.is-answered { background: rgb(var(--ink)); border-color: rgb(var(--ink)); color: #fff; }
.pal.is-review { background: rgb(var(--mark)); border-color: rgb(var(--mark)); color: rgb(var(--ink)); }
.pal.is-current { box-shadow: 0 0 0 3px rgb(var(--accent) / .45); }

details > summary::-webkit-details-marker { display: none; }
details[open] > summary svg { transform: rotate(180deg); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* "Interview pass" card (Most-taken section): main body + perforated stub */
.pass { --c: #1D4ED8; --notch: #F5F7FB; position: relative; display: grid; grid-template-columns: 1fr; background: #fff; border: 1px solid #E3E8F0; border-radius: 1.25rem; }
.pass-main { padding: 1.35rem 1.35rem 1.1rem; border-top: 4px solid var(--c); border-radius: 1.25rem 1.25rem 0 0; }
.pass-rank { font-family: "Bricolage Grotesque", system-ui, sans-serif; font-weight: 800; font-size: 2.6rem; line-height: .85; color: var(--c); min-width: 1.6ch; }
.pass-topic { font-size: .78rem; padding: .25rem .6rem; border-radius: .5rem; border: 1px solid color-mix(in srgb, var(--c) 25%, #E3E8F0); background: color-mix(in srgb, var(--c) 6%, white); color: #334155; }
.pass-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin-top: 1.1rem; padding-top: .9rem; border-top: 1px solid #EEF2F7; }
.pass-meta dt { font-size: .72rem; color: #64748B; }
.pass-meta dd { font-weight: 700; color: rgb(var(--ink)); font-size: 1rem; }
.pass-stub { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.1rem 1.35rem 1.3rem; border-top: 2px dashed #D5DCE6; background: color-mix(in srgb, var(--c) 5%, white); border-radius: 0 0 1.25rem 1.25rem; }
.pass-stub::before, .pass-stub::after { content: ""; position: absolute; top: -11px; width: 20px; height: 20px; border-radius: 50%; background: var(--notch); border: 1px solid #E3E8F0; }
.pass-stub::before { left: -11px; clip-path: inset(0 0 0 50%); }
.pass-stub::after { right: -11px; clip-path: inset(0 50% 0 0); }
.pass-stub > .grid { max-width: 12rem; }
@media (min-width: 640px) {
  .pass { grid-template-columns: 1fr 13.5rem; }
  .pass-main { border-top: 0; border-left: 4px solid var(--c); border-radius: 1.25rem 0 0 1.25rem; }
  .pass-stub { flex-direction: column; align-items: stretch; justify-content: space-between; border-top: 0; border-left: 2px dashed #D5DCE6; border-radius: 0 1.25rem 1.25rem 0; }
  .pass-stub::before, .pass-stub::after { left: -11px; right: auto; clip-path: none; }
  .pass-stub::before { top: -11px; clip-path: inset(50% 0 0 0); }
  .pass-stub::after { top: auto; bottom: -11px; clip-path: inset(0 0 50% 0); }
  .pass-stub > .grid { max-width: none; }
}
