/* Shared Nota Justa brand roles from resources/css/app.css. Assets stay local. */
@font-face {
    font-family: 'Noto Sans';
    font-style: normal;
    font-weight: 100 900;
    font-stretch: normal;
    font-display: swap;
    src: url('/brand/NotoSans-Variable.ttf') format('truetype');
}

:root {
    color-scheme: light;
    --ink: #092E44;
    --primary: #0079C9;
    --primary-hover: #006CB4;
    --amber: #FFB900;
    --muted: #3F5968;
    --line: #D8E1E7;
    --control-border: #3F5968;
    --paper: #FFFFFF;
    --bg: #F5F7F9;
    --danger: #9B2C2C;
    font-family: 'Noto Sans', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--ink);
    background: var(--bg);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 280px; }
a { color: var(--primary-hover); }
button, input, textarea, select { font: inherit; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
[hidden] { display: none !important; }

.skip-link {
    position: absolute;
    top: -5rem;
    left: 1rem;
    z-index: 10;
    padding: .75rem 1rem;
    border-radius: 8px;
    background: var(--ink);
    color: var(--paper);
}
.skip-link:focus { top: .75rem; }

header { background: var(--paper); border-bottom: 3px solid var(--amber); }
.header-content {
    width: min(100%, 1200px);
    min-height: 78px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.brand { display: inline-flex; align-items: center; flex-shrink: 0; }
.brand img { display: block; width: 216px; height: auto; }
.header-label { font-size: .875rem; font-weight: 600; color: var(--muted); }

main { width: min(100%, 1056px); margin: 3rem auto; padding: 0 2rem; }
main:focus { outline: none; }
h1, h2, legend { color: var(--ink); }
h1 {
    font-size: clamp(1.75rem, 3.5vw, 2.5rem);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -.025em;
    margin: .75rem 0 1rem;
    overflow-wrap: anywhere;
}
h2 { margin: 0 0 .75rem; font-size: 1.25rem; line-height: 1.4; }
p { line-height: 1.65; }
.eyebrow {
    margin: 0;
    color: var(--primary-hover);
    font-size: .75rem;
    font-weight: 700;
    line-height: 1.5;
    letter-spacing: .12em;
    text-transform: uppercase;
}
.card {
    margin-bottom: 1.5rem;
    padding: clamp(1.25rem, 4vw, 2rem);
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--paper);
    box-shadow: 0 2px 6px rgb(9 46 68 / 3%);
}
#admission { width: min(100%, 640px); margin: 3.5rem auto; }
.admission-card { border-top: 4px solid var(--amber); }
.intro { margin: 0 0 1.75rem; color: var(--muted); }
label { display: block; margin: .75rem 0 .5rem; font-size: .875rem; font-weight: 600; }
input:not([type=radio]):not([type=checkbox]), textarea, select {
    width: 100%;
    max-width: 100%;
    min-height: 44px;
    border: 1px solid var(--control-border);
    border-radius: 8px;
    padding: .75rem;
    background: var(--paper);
    color: var(--ink);
    font-size: 1rem;
}
textarea { resize: vertical; line-height: 1.65; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
input[type=radio], input[type=checkbox] { accent-color: var(--primary); width: 20px; height: 20px; }
#credential { margin: 0; }
.field-help { margin: .625rem 0 1.25rem; color: var(--muted); font-size: .875rem; }
button {
    min-height: 44px;
    margin: .25rem .25rem .25rem 0;
    border: 1px solid var(--primary);
    border-radius: 10px;
    padding: .75rem 1.25rem;
    color: var(--paper);
    background: var(--primary);
    font-size: .875rem;
    font-weight: 600;
    line-height: 1.5;
    cursor: pointer;
    transition: background-color .15s, border-color .15s;
}
button:hover:not(:disabled) { border-color: var(--primary-hover); background: var(--primary-hover); }
button.secondary { border-color: var(--control-border); color: var(--ink); background: var(--paper); }
button.secondary:hover:not(:disabled) { border-color: var(--primary-hover); color: var(--primary-hover); background: var(--bg); }
button:disabled { opacity: .55; cursor: default; }
#entry button, #resume { width: 100%; margin: 0; }
.resume-section { margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.resume-section p { margin: 0 0 .75rem; color: var(--muted); font-size: .875rem; }
.shared-device-note { margin: 1.5rem 0 0; color: var(--muted); font-size: .8125rem; }

.exam-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1.5rem; margin-bottom: 1.5rem; }
.exam-heading h1 { margin-bottom: 0; }
.clock { flex-shrink: 0; border: 1px solid var(--amber); border-radius: 12px; padding: .75rem 1rem; background: #FFF6DB; white-space: nowrap; }
.clock span { display: block; font-size: .75rem; font-weight: 600; }
.clock strong { font-size: 1.75rem; line-height: 1.4; font-variant-numeric: tabular-nums; }
#save-status { margin: 0 0 1.5rem; border-left: 3px solid var(--primary); border-radius: 0 8px 8px 0; padding: .875rem 1rem; color: var(--ink); background: #EAF4FB; font-size: .875rem; }
#notice { border: 1px solid #E5B4B4; border-radius: 10px; padding: 1rem; color: var(--danger); background: #FFF4F4; white-space: pre-wrap; overflow-wrap: anywhere; }
#notice:empty { display: none; }
#conflict, #confirmation { border-top: 4px solid var(--amber); }

fieldset { min-width: 0; margin: 0; border: 0; padding: 0; }
legend { width: 100%; margin-bottom: 1rem; padding: 0; font-size: 1.125rem; font-weight: 700; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.option { display: flex; align-items: flex-start; gap: .75rem; min-height: 44px; margin: .5rem 0; border: 1px solid var(--line); border-radius: 10px; padding: .875rem; font-size: 1rem; font-weight: 400; line-height: 1.5; }
.option input { flex-shrink: 0; margin: .125rem 0 0; }
.option span { min-width: 0; overflow-wrap: anywhere; }
.option:has(input:checked) { border-color: var(--primary); background: #EAF4FB; }
.content { white-space: pre-wrap; overflow-wrap: anywhere; }
.math { font-family: monospace; }
li { line-height: 1.7; }
.actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .5rem; margin: 1.5rem 0; }
.actions button { margin: 0; }
#logout { margin-right: auto; }
.scroll { max-width: 100%; overflow-x: auto; }
table { width: 100%; margin: 1rem 0; border-collapse: collapse; }
th, td { border: 1px solid var(--line); padding: .75rem; text-align: left; vertical-align: top; }
th { background: var(--bg); font-size: .875rem; }
td input:not([type=radio]):not([type=checkbox]) { min-width: 7rem; }
.order-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: .5rem; margin: .75rem 0; border: 1px solid var(--line); border-radius: 10px; padding: .75rem; }
.order-row span { min-width: 0; overflow-wrap: anywhere; }
.order-row button { margin: 0; padding: .5rem .625rem; font-size: .875rem; border-color: var(--line); color: var(--ink); background: var(--bg); }
.order-row button:hover:not(:disabled) { border-color: var(--primary); color: var(--paper); }
.segment { display: inline; min-width: 24px; min-height: 44px; margin: .125rem; border: 1px solid var(--line); border-radius: 5px; padding: .25rem; color: var(--ink); background: var(--paper); }
.segment[aria-pressed=true] { border-color: var(--primary); color: var(--paper); background: var(--primary); }
.diagram { max-width: 100%; max-height: 520px; object-fit: contain; }
.diagram-map { display: block; width: min(100%, 520px); height: auto; background: var(--bg); }
.diagram-map text { fill: var(--paper); stroke: var(--ink); stroke-width: .7px; paint-order: stroke; dominant-baseline: middle; text-anchor: middle; font-size: 4px; font-weight: 800; }
footer { border-top: 1px solid var(--line); padding: 1.5rem 1rem; color: var(--muted); text-align: center; font-size: .8125rem; }

@media (max-width: 600px) {
    .header-content { min-height: 72px; padding: 1rem 1.25rem; }
    .brand img { width: 176px; }
    .header-label { font-size: .75rem; }
    main { margin: 1.5rem auto; padding: 0 1rem; }
    #admission { margin: 1.5rem auto 2rem; }
    .card { padding: 1.25rem; border-radius: 14px; }
    .exam-heading { gap: .75rem; }
    .clock { padding: .625rem .75rem; }
    .clock strong { font-size: 1.25rem; }
    .actions button { width: 100%; }
    #logout { margin-right: 0; }
    #conflict button, #confirmation button { width: 100%; margin-right: 0; }
}

@media (prefers-reduced-motion: reduce) {
    button { transition: none; }
}
