/* ant-interview public portal — small, dependency-free, mobile-first. */

:root {
    --ink: #1c2733;
    --muted: #6b7a8c;
    --line: #d7dee6;
    --accent: #2563eb;
    --accent-ink: #ffffff;
    --error: #b42318;
    --ok: #067647;
    --warn: #b54708;
    --bg: #f4f6f9;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--ink);
    display: flex;
    min-height: 100vh;
    align-items: flex-start;
    justify-content: center;
    padding: 2rem 1rem;
}

.card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 2rem;
    width: 100%;
    max-width: 640px;
}

.card.wide { max-width: 860px; }
.card.center { text-align: center; }

h1 { margin: 0 0 .5rem; font-size: 1.4rem; }
h2 { margin: 1.25rem 0 .5rem; font-size: 1.1rem; }

.muted { color: var(--muted); font-size: .9rem; }

.error, .info, .success {
    border-radius: 8px;
    padding: .65rem .9rem;
    margin: .75rem 0;
    font-size: .92rem;
}
.error   { background: #fef3f2; color: var(--error); border: 1px solid #fecdca; }
.info    { background: #eff8ff; color: #175cd3; border: 1px solid #b2ddff; }
.success { background: #ecfdf3; color: var(--ok); border: 1px solid #abefc6; }

label { display: block; margin: .9rem 0 .3rem; font-weight: 600; font-size: .92rem; }

input[type="text"], input[type="email"], input[type="tel"],
input[type="file"], textarea, select {
    width: 100%;
    padding: .55rem .7rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    font: inherit;
    color: inherit;
    background: #fff;
}

textarea { resize: vertical; }

button, .btn {
    display: inline-block;
    margin-top: 1.2rem;
    background: var(--accent);
    color: var(--accent-ink);
    border: 0;
    border-radius: 8px;
    padding: .65rem 1.4rem;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}

button:disabled { opacity: .45; cursor: not-allowed; }

.field-error { color: var(--error); font-size: .85rem; margin: .25rem 0 0; }

/* post list */
.post-list { list-style: none; margin: 1rem 0 0; padding: 0; }
.post-list li {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: .75rem;
}
.post-list a { color: var(--accent); font-weight: 600; text-decoration: none; }

/* stepper */
.steps { display: flex; gap: .5rem; margin: 0 0 1.25rem; padding: 0; list-style: none; flex-wrap: wrap; }
.steps li {
    font-size: .78rem;
    padding: .25rem .6rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    color: var(--muted);
}
.steps li.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.steps li.done { background: #ecfdf3; border-color: #abefc6; color: var(--ok); }

/* pre-check list */
.check-list { list-style: none; margin: 1rem 0; padding: 0; }
.check-list li {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .6rem .4rem;
    border-bottom: 1px solid var(--line);
    font-size: .95rem;
}
.check-status { font-weight: 700; min-width: 1.4rem; text-align: center; }
.check-status.pass { color: var(--ok); }
.check-status.fail { color: var(--error); }
.check-status.wait { color: var(--muted); }

/* exam */
.exam-topbar {
    position: sticky;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: #fff;
    border-bottom: 1px solid var(--line);
    padding: .6rem 0;
    margin-bottom: 1rem;
    z-index: 5;
}
#timer { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 1.1rem; }
#timer.low { color: var(--error); }
#violations { font-size: .85rem; color: var(--warn); }

.question {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}
.question h3 { margin: 0 0 .6rem; font-size: 1rem; }
.question .opt { display: flex; align-items: center; gap: .5rem; margin: .3rem 0; font-size: .95rem; }
.question .opt input { width: auto; }
.save-state { font-size: .78rem; color: var(--muted); margin-top: .35rem; }

.q-timer {
    float: right;
    font-size: .8rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--warn);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: .1rem .55rem;
}
.q-timer.low { color: var(--error); }
.question.locked { opacity: .65; }
.question.locked .q-timer { color: var(--muted); }

#webcam-wrap {
    position: fixed;
    right: 14px;
    bottom: 14px;
    width: 176px;
    border: 2px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    background: #000;
    z-index: 10;
}
#webcam-wrap video { display: block; width: 100%; }
#webcam-wrap .cam-label {
    background: #111;
    color: #ddd;
    font-size: .7rem;
    text-align: center;
    padding: .15rem 0;
}

.overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .92);
    color: #fff;
    display: none;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
    z-index: 50;
}
.overlay.show { display: flex; }
.overlay .inner h2 { color: #fff; }
