/* Assessments library: a short title with the teacher-code entry, then the exams as large taped covers grouped by edition. */
/* Page shell, title and tokens come from editorial.css; the access and login dialogs keep their structure from simulados.css. */

/* Teacher code: one compact field beside the title. */
.exam-code { display: grid; gap: 10px; width: min(100%, 440px); }
.exam-code-label { display: flex; align-items: center; gap: 8px; font-size: var(--type-kicker); font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--home-blue); }
.exam-code-field { display: flex; align-items: center; gap: 6px; padding: 6px 6px 6px 20px; background: var(--home-surface); border: 1px solid var(--home-line); border-radius: 100px;
  box-shadow: var(--home-card-shadow); transition: border-color .2s, box-shadow .2s; }
.exam-code-field:focus-within { border-color: var(--home-accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--home-accent) 20%, transparent), var(--home-card-shadow); }
.exam-code input { flex: 1; min-width: 0; min-height: 44px; padding: 0; border: 0; outline: 0; background: transparent; color: var(--home-text);
  font: 700 1rem/1 var(--font-title); letter-spacing: .08em; text-transform: uppercase; }
.exam-code input::placeholder { color: var(--home-muted); font-weight: 600; letter-spacing: .02em; text-transform: none; opacity: .75; }
.exam-code button { flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 20px; border: 0; border-radius: 100px; cursor: pointer;
  background: var(--home-button-fill); color: var(--home-button-ink); font-size: .9rem; font-weight: 800; transition: transform .2s; }
.exam-code button:hover { transform: translateX(2px); }
.exam-code button:focus-visible { outline: 3px solid var(--home-accent); outline-offset: 3px; }
.exam-code-status { margin: 0; padding-left: 20px; font-size: var(--type-caption); font-weight: 700; color: var(--home-muted); }
.exam-code-status:empty { display: none; }

/* Editions: the year labels the shelf, the covers carry the page. */
.exam-library { padding: 6px 0 96px; }
.exam-shelf { display: grid; grid-template-columns: 168px minmax(0, 1fr); gap: 36px; align-items: start; padding: 44px 0; }
.exam-shelf:first-child { padding-top: 10px; }
.exam-shelf + .exam-shelf { border-top: 1px dashed var(--home-line); }
.exam-shelf-head { position: sticky; top: 100px; display: grid; gap: 4px; padding-top: 12px; }
.exam-shelf-head h2 { display: grid; margin: 0; }
.exam-shelf-exam { font-size: var(--type-kicker); font-weight: 800; letter-spacing: .2em; color: var(--home-blue); }
.exam-shelf-year { font: 700 clamp(3rem, 5vw, 4.2rem)/1 var(--font-title); letter-spacing: -.06em; color: var(--home-text); }
.exam-shelf-note { margin: 8px 0 0; font: 700 1.45rem/1 var(--home-hand); color: var(--home-pencil); transform: rotate(-4deg); transform-origin: 0 50%; }

.exam-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 26px; margin: 0; padding: 12px 0 0; list-style: none; }

/* Each exam takes the colour of its booklet: tape, swatch and hover edge. */
.exam { --booklet: #3f7fe0; --tape: rgba(143, 190, 255, .66); min-width: 0; margin: 0; }
.exam[data-booklet="verde"] { --booklet: #2f9e63; --tape: rgba(170, 230, 190, .7); }
.exam[data-booklet="amarelo"] { --booklet: #e8b10e; --tape: rgba(255, 214, 64, .7); }
.exam[data-booklet="branco"] { --booklet: #f4f7fb; --tape: rgba(208, 222, 238, .85); }
.exam[data-booklet="rosa"] { --booklet: #e0567a; --tape: rgba(255, 160, 190, .66); }
.exam[data-booklet="cinza"] { --booklet: #8592a3; --tape: rgba(196, 206, 218, .8); }

.exam-card { position: relative; display: flex; flex-direction: column; height: 100%; color: var(--home-text); background: var(--home-surface);
  border: 1px solid var(--home-line); border-radius: 16px; box-shadow: var(--home-card-shadow); transition: transform .3s cubic-bezier(.2, .7, .3, 1), border-color .3s; }
.exam-card::before { content: ""; position: absolute; z-index: 3; left: 50%; top: -11px; width: 96px; height: 22px; transform: translateX(-50%) rotate(-3deg); background: var(--tape);
  clip-path: polygon(3% 0, 97% 4%, 100% 50%, 96% 100%, 2% 96%, 0 50%); }
.exam:nth-child(even) .exam-card::before { transform: translateX(-50%) rotate(4deg); }
.exam-card:hover { transform: translateY(-6px) rotate(-.4deg); border-color: color-mix(in srgb, var(--booklet) 60%, var(--home-line)); }

.exam-art { display: block; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 15px 15px 0 0; background: color-mix(in srgb, var(--booklet) 18%, var(--home-surface)); }
.exam-art img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2, .65, .3, 1); }
.exam-card:hover .exam-art img { transform: scale(1.04); }

/* Name and launch button share the first row; the details take the full width below, so paired cards stay identical. */
.exam-body { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name open" "meta meta"; align-items: center; gap: 14px 18px; padding: 18px 20px 20px; border-top: 1px solid var(--home-line); }
.exam-info { display: contents; }
.exam-name { grid-area: name; min-width: 0; margin: 0; font: 600 1.6rem/1 var(--font-title); letter-spacing: -.045em; color: var(--home-text); }
.exam-meta { grid-area: meta; display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.exam-meta li { display: inline-flex; align-items: center; gap: 7px; margin: 0; padding: 5px 10px; border-radius: 100px; font-size: var(--type-tag); font-weight: 800; letter-spacing: .07em;
  text-transform: uppercase; white-space: nowrap; color: var(--home-muted); background: color-mix(in srgb, var(--home-text) 7%, transparent); }
/* Where the student stands in this exam; the review link sits above the card-wide launch button. */
.exam-meta .exam-status { color: var(--home-accent); background: color-mix(in srgb, var(--home-accent) 12%, transparent); }
.exam-meta .exam-result { padding: 0; background: none; }
.exam-result a { position: relative; z-index: 5; padding: 5px 4px; color: var(--home-accent); text-decoration: underline; text-underline-offset: 3px; }
.exam-result a:focus-visible { outline: 3px solid var(--home-accent); outline-offset: 2px; border-radius: 4px; }
.exam-booklet::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--booklet); box-shadow: inset 0 0 0 1px rgba(16, 35, 61, .28); }

/* The launch button stretches over the whole card, so the cover is the target too. */
.exam-open { grid-area: open; display: inline-flex; align-items: center; gap: 10px; min-height: 46px; padding: 0 18px 0 22px; border: 0; border-radius: 100px; cursor: pointer;
  background: var(--home-button-fill); color: var(--home-button-ink); font-size: .92rem; font-weight: 800;
  box-shadow: 0 10px 22px -10px color-mix(in srgb, var(--home-accent) 70%, transparent); }
.exam-open::after { content: ""; position: absolute; inset: -1px; z-index: 4; border-radius: 16px; }
.exam-open i { transition: transform .25s; }
.exam-card:hover .exam-open i { transform: translateX(4px); }
.exam-open:focus-visible { outline: 0; }
.exam-open:focus-visible::after { outline: 3px solid var(--home-accent); outline-offset: 4px; }

/* Dialogs follow the editorial surfaces and buttons. */
.exams-page :is(.simulados-access-card, .simulados-login-card) { padding: 32px; border-radius: 20px; background: var(--home-surface); border-color: var(--home-line); box-shadow: var(--home-card-shadow); }
.exams-page :is(.simulados-access-card h2, .simulados-login-card h2) { color: var(--home-text); font-size: 1.6rem; line-height: 1.25; letter-spacing: -.04em; }
.exams-page .simulados-access-dialog, .exams-page .simulados-login-dialog { border-radius: 20px; }
.exams-page .simulados-question-select span { color: var(--home-muted); text-shadow: none; }
.exams-page .simulados-question-select input { min-height: 50px; border-radius: 12px; border-color: var(--home-line); background: var(--home-bg); color: var(--home-text); }
.exams-page .simulados-question-select input:focus { border-color: var(--home-accent); outline: 3px solid color-mix(in srgb, var(--home-accent) 22%, transparent); }
.exams-page .simulados-access-note:empty { display: none; }
.exams-page :is(.simulados-access-actions, .simulados-login-actions) .btn { min-height: 48px; border-radius: 100px; }
.exams-page :is(.simulados-access-actions, .simulados-login-actions) .btn-primary { background: var(--home-button-fill); color: var(--home-button-ink); border-color: transparent; }
.exams-page :is(.simulados-access-actions, .simulados-login-actions) .btn-ghost { background: var(--home-surface); color: var(--home-blue); border-color: var(--home-line); }
.exams-page .simulados-dialog-close { border-radius: 50%; background: color-mix(in srgb, var(--home-text) 6%, transparent); color: var(--home-text); border-color: var(--home-line); }
.exams-page .simulados-login-icon { background: var(--home-cyan-wash); color: var(--home-accent); border-color: transparent; }
.exams-page .simulados-access-card { background: radial-gradient(130% 80% at 0% 0%, var(--home-blue-wash) 0%, transparent 58%), var(--home-surface); }
.exams-page .simulados-access-hint { color: var(--home-muted); }
/* "Fazer sozinho" carries the button fill; the class option stays an outlined card, like the game entry dialog. */
.exams-page .simulados-access-option { background: var(--home-surface); color: var(--home-text); border-color: var(--home-line); }
.exams-page .simulados-access-option:is(:hover, :focus-visible) { background: var(--home-blue-wash); border-color: var(--home-accent); box-shadow: 0 12px 26px color-mix(in srgb, var(--home-accent) 14%, transparent); }
.exams-page .simulados-access-option-icon { background: var(--home-blue-wash); color: var(--home-blue); }
.exams-page .simulados-access-option:is(:hover, :focus-visible) .simulados-access-option-icon { background: var(--home-blue); color: var(--home-surface); }
.exams-page .simulados-access-option-text small { color: var(--home-muted); }
.exams-page .simulados-access-option-arrow { color: var(--home-blue); }
.exams-page .simulados-access-option--primary,
.exams-page .simulados-access-option--primary:is(:hover, :focus-visible) {
  background: var(--home-button-fill); color: var(--home-button-ink); border-color: transparent;
  box-shadow: 0 14px 30px color-mix(in srgb, var(--home-accent) 28%, transparent);
}
.exams-page .simulados-access-option--primary:hover { filter: brightness(1.06); box-shadow: 0 18px 36px color-mix(in srgb, var(--home-accent) 36%, transparent); }
.exams-page .simulados-access-option--primary .simulados-access-option-icon,
.exams-page .simulados-access-option--primary:is(:hover, :focus-visible) .simulados-access-option-icon { background: color-mix(in srgb, var(--home-button-ink) 16%, transparent); color: inherit; }
.exams-page .simulados-access-option--primary :is(.simulados-access-option-text small, .simulados-access-option-arrow) { color: color-mix(in srgb, var(--home-button-ink) 86%, transparent); }

/* Motion: the second cover of a shelf follows the first; everything settles with prefers-reduced-motion (reveal itself: editorial.css). */
.exam.reveal.is-visible + .exam.reveal.is-visible { transition-delay: 90ms; }
@media (prefers-reduced-motion: reduce) {
  .exam-card, .exam-art img, .exam-open i, .exam-code button { transition: none; }
  .exam-card:hover, .exam-card:hover .exam-art img, .exam-card:hover .exam-open i { transform: none; }
}

/* Responsive */
@media (max-width: 960px) {
  .exam-library { padding-bottom: 72px; }
  .exam-shelf { grid-template-columns: minmax(0, 1fr); gap: 18px; padding: 36px 0; }
  .exam-shelf-head { position: static; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px; padding-top: 0; }
  .exam-shelf-head h2 { display: flex; align-items: baseline; gap: 12px; }
  .exam-shelf-year { font-size: 2.6rem; }
  .exam-shelf-note { margin: 0; }
  .exam-grid { gap: 30px 20px; }
}
@media (max-width: 680px) {
  .catalog-intro-inner { align-items: stretch; }
  .exam-code { width: 100%; }
  .exam-grid { grid-template-columns: minmax(0, 1fr); gap: 34px; }
  .exam-library { padding-bottom: 56px; }
  .exams-page :is(.simulados-access-card, .simulados-login-card) { padding: 28px 22px; }
}
@media (max-width: 380px) {
  .exam-code-field { padding-left: 16px; }
  .exam-code button { padding: 0 16px; }
  .exam-body { grid-template-columns: minmax(0, 1fr); grid-template-areas: "name" "meta" "open"; }
  .exam-open { justify-content: center; }
}
