/* Candidate login + exam instructions pages (index.php, exam-instructions.php).
   Deliberately small and self-contained: no framework, no web fonts, no images beyond the crest,
   so the page loads fast on weak connections even when a thousand candidates arrive at once. */

:root {
    --green: #1b5e20;
    --green-mid: #2e7d32;
    --green-soft: #e8f5e9;
    --ink: #1f2933;
    --muted: #5f6b76;
    --line: #d9dfe4;
    --bg: #eef2f0;
    --danger: #b3261e;
    --danger-bg: #fdecea;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--ink);
    background: var(--bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 16px 40px;
}

a { color: var(--green-mid); }
a:hover { color: var(--green); }

/* ---- header ---- */
.brand {
    text-align: center;
    margin: 8px 0 20px;
}
.brand img {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .15);
    background: #fff;
}
.brand .org {
    margin: 10px 0 0;
    font-size: .8rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--muted);
}
.brand h1 {
    margin: 2px 0 0;
    font-size: 1.5rem;
    color: var(--green);
}

/* ---- cards ---- */
.card {
    width: 100%;
    max-width: 440px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, .08);
    padding: 26px 24px 22px;
}
.card.wide { max-width: 760px; }

.lead {
    margin: 0 0 18px;
    color: var(--muted);
    font-size: .95rem;
}

/* ---- form ---- */
label {
    display: block;
    margin: 0 0 6px;
    font-weight: 600;
    font-size: .92rem;
}
.field { margin-bottom: 16px; }
.hint {
    display: block;
    margin-top: 5px;
    font-size: .82rem;
    color: var(--muted);
}

input[type="email"],
input[type="text"],
input[type="password"] {
    width: 100%;
    padding: 12px 14px;
    font-size: 1rem;
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    transition: border-color .15s, box-shadow .15s;
}
input:focus {
    outline: none;
    border-color: var(--green-mid);
    box-shadow: 0 0 0 3px rgba(46, 125, 50, .18);
}

.with-toggle { position: relative; }
.with-toggle input { padding-right: 68px; }
.toggle {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    padding: 6px 10px;
    font-size: .82rem;
    font-weight: 600;
    color: var(--green-mid);
    background: transparent;
    border: 0;
    border-radius: 6px;
    cursor: pointer;
}
.toggle:hover { background: var(--green-soft); }
.toggle:focus-visible { outline: 2px solid var(--green-mid); }

button.primary {
    width: 100%;
    padding: 13px 16px;
    font-size: 1.02rem;
    font-weight: 700;
    color: #fff;
    background: var(--green-mid);
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    transition: background .15s;
}
button.primary:hover { background: var(--green); }
button.primary:focus-visible { outline: 3px solid rgba(46, 125, 50, .4); outline-offset: 2px; }
button.primary[disabled] { opacity: .65; cursor: wait; }

.alert {
    display: none;
    margin: 0 0 16px;
    padding: 11px 14px;
    font-size: .93rem;
    color: var(--danger);
    background: var(--danger-bg);
    border-radius: 8px;
    border-left: 4px solid var(--danger);
}
.alert.show { display: block; }

.help {
    margin: 18px 0 0;
    padding-top: 16px;
    border-top: 1px solid var(--line);
    text-align: center;
    font-size: .95rem;
}
.help a { font-weight: 600; }

/* ---- instructions page ---- */
.doc h1 { margin: 0 0 10px; font-size: 1.45rem; color: var(--green); line-height: 1.3; }
.doc h2 { margin: 26px 0 8px; font-size: 1.08rem; color: var(--green); }
.doc p  { margin: 0 0 12px; }
.doc ul { margin: 0 0 12px; padding-left: 22px; }
.doc li { margin-bottom: 8px; }
.doc .notice {
    padding: 12px 14px;
    background: var(--green-soft);
    border-left: 4px solid var(--green-mid);
    border-radius: 6px;
}
.doc .sign { margin-top: 26px; }
.doc .sign strong { display: block; }
.doc .sign span { color: var(--muted); }
.topbar { width: 100%; max-width: 760px; margin: 0 0 14px; font-size: .95rem; }
.bottombar { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }

@media (max-width: 480px) {
    body { padding: 16px 12px 32px; }
    .card { padding: 22px 18px 18px; }
    .brand h1 { font-size: 1.3rem; }
}

@media print {
    body { background: #fff; padding: 0; }
    .card { box-shadow: none; max-width: none; }
    .topbar, .bottombar { display: none; }
}
