@font-face { font-family: Poppins; font-weight: 400; src: url(assets/poppins-1.woff2) format("woff2"); }
@font-face { font-family: Poppins; font-weight: 500; src: url(assets/poppins-2.woff2) format("woff2"); }
@font-face { font-family: Poppins; font-weight: 600; src: url(assets/poppins-3.woff2) format("woff2"); }

/* Colours follow the Niyamit Goa mobile app. */
:root {
  --red: #d92d1b;
  --red-dark: #b92314;
  --amber: #f5a524;
  --navy: #0a0a8c;
  --green: #0b5d0b;
  --ok: #2aa63a;
  --ink: #111;
  --muted: #5b6470;
  --line: #9aa0a6;
  --sky-1: #cfe6f7;
  --sky-2: #eaf5fd;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: Poppins, "Segoe UI", Roboto, sans-serif; color: var(--ink); user-select: none;
  background: linear-gradient(180deg, var(--sky-1) 0%, var(--sky-2) 55%, #f7f1e4 100%) fixed;
}
[hidden] { display: none !important; }
.view { height: 100%; display: flex; flex-direction: column; }
h2, h3, p { margin: 0; }

.mark { display: flex; align-items: center; gap: 8px; }
.mark img { height: 52px; }
.mark div { display: flex; flex-direction: column; line-height: 1; font-weight: 600; font-size: 19px; }
.mark .n1 { color: var(--red); }
.mark .n2 { color: var(--amber); }
.mark.big img { height: 110px; }
.mark.big div { font-size: 34px; }
.credit { text-align: center; font-size: 12.5px; font-weight: 500; padding: 10px; color: #222; }

/* Login */
.login { flex: 1; width: min(400px, 88%); margin: 0 auto; display: flex; flex-direction: column; justify-content: center; }
.emblem { width: 92px; align-self: center; }
.login .mark { align-self: center; margin: 10px 0 14px; }
.pill { display: flex; align-items: center; gap: 0; margin-bottom: 14px; }
.pill::before, .pill::after { content: ""; flex: 1; height: 2px; background: #b9bec4; }
.pill span { background: var(--red); color: #fff; font-weight: 500; padding: 8px 28px; border-radius: 22px; }
label { font-size: 15px; font-weight: 500; margin: 10px 0 6px; }
input, textarea {
  font: inherit; padding: 12px 14px; border: 2px solid #c9ced3; border-radius: 4px; background: #fff; outline: none;
  user-select: text; width: 100%; resize: none;
}
input:focus, textarea:focus { border-color: var(--navy); }
.err { color: var(--red-dark); font-size: 13.5px; font-weight: 500; min-height: 22px; margin: 8px 0 4px; }

button { font: inherit; font-weight: 500; border-radius: 8px; padding: 12px 26px; cursor: pointer; border: 2px solid transparent; }
button:disabled { opacity: .6; cursor: default; }
.primary { background: var(--red); color: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, .25); }
.primary:hover:not(:disabled) { background: var(--red-dark); }
.ghost { background: #fff; border-color: #111; color: #111; padding: 8px 18px; }
.ghost:hover { background: #f1f1f1; }
.wide { width: 100%; }

/* Home */
header { display: flex; align-items: center; gap: 16px; padding: 10px 26px; background: rgba(255, 255, 255, .45); box-shadow: 0 2px 5px rgba(0, 0, 0, .18); }
.hemblem { height: 56px; }
.spacer { flex: 1; }
.timer { font-size: 13.5px; }
.timer b { font-variant-numeric: tabular-nums; }
.timer.low b { color: var(--red); }
main { flex: 1; overflow: auto; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 26px; padding: 24px max(30px, calc((100% - 1040px) / 2)); align-items: start; }
.who { display: flex; align-items: center; gap: 16px; }
.who > div:last-child { min-width: 0; }
.avatar { flex: none; width: 84px; height: 84px; border-radius: 50%; overflow: hidden; background: #fff; border: 3px solid #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .25); display: grid; place-items: center; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar span { font-size: 28px; font-weight: 600; color: var(--navy); }
.welcome { font-size: 17px; }
#u-name { font-size: 28px; font-weight: 600; line-height: 1.2; }
.date { display: inline-block; border-top: 2px solid var(--red); margin-top: 6px; padding-top: 4px; font-weight: 500; }
.meta { color: var(--muted); font-size: 13.5px; margin-top: 6px; }
.today { margin-top: 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 18px 12px; padding: 20px; border-radius: 18px; background: linear-gradient(135deg, #dbe9f6, #a9cce6); box-shadow: 0 3px 8px rgba(0, 0, 0, .15); }
.today div { display: flex; flex-direction: column; }
.today span { font-size: 15px; }
.today b { font-size: 22px; font-weight: 600; letter-spacing: 1px; }
.today b.set { color: var(--ok); letter-spacing: 0; }
.toast { position: fixed; left: 50%; bottom: 46px; transform: translateX(-50%); z-index: 20; max-width: min(520px, 86vw); margin: 0; background: #2e7d32; color: #fff; padding: 12px 22px; border-radius: 26px; font-size: 14.5px; font-weight: 500; text-align: center; box-shadow: 0 6px 18px rgba(0, 0, 0, .3); animation: toast-in .25s ease-out; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 14px); } to { opacity: 1; transform: translate(-50%, 0); } }

.card { background: #fff; border-radius: 18px; padding: 22px 26px; box-shadow: 0 3px 10px rgba(0, 0, 0, .18); display: flex; flex-direction: column; }
.card h3 { font-size: 18px; font-weight: 500; margin-bottom: 8px; }
.card h3 label { font-size: inherit; margin: 0; }
.card hr { border: 0; border-top: 2px solid var(--line); margin: 14px 0; width: 100%; }
.card .primary { align-self: center; }
.radios { display: flex; flex-direction: column; gap: 6px; padding-left: 6px; }
.radios label { display: flex; align-items: center; gap: 10px; font-size: 15.5px; margin: 0; cursor: pointer; }
.radios input { width: 20px; height: 20px; padding: 0; accent-color: #555; flex: none; }
.radios small { color: var(--muted); font-weight: 400; }
.note { color: var(--muted); font-size: 14px; }

/* Camera: white veil with a ring, as on the phone */
#v-cam { background: #fff; align-items: center; justify-content: center; gap: 8px; position: relative; }
#v-cam canvas { height: min(66vh, 560px); aspect-ratio: 4 / 3; background: #f2f2f2; border-radius: 8px; }
.close { position: absolute; top: 16px; right: 20px; width: 44px; height: 44px; padding: 0; border-radius: 50%; border: 2px solid #111; background: #fff; font-size: 20px; line-height: 1; }
.close:hover { background: #eee; }
.cam-msg { font-size: 20px; font-weight: 500; min-height: 30px; text-align: center; color: #111; padding: 0 70px; }
.cam-msg.bad { color: var(--red-dark); }
.cam-msg.good { color: var(--green); }
.cam-dbg { color: #1e7be0; font-size: 14px; min-height: 20px; }
#v-cam .credit { position: absolute; bottom: 0; left: 0; right: 0; }

/* Failure */
#v-done { align-items: center; justify-content: center; }
.center { align-items: center; text-align: center; width: min(420px, 88%); gap: 6px; }
.center .primary { margin-top: 16px; }
.badge { width: 70px; height: 70px; border-radius: 50%; display: grid; place-items: center; font-size: 38px; font-weight: 600; color: #fff; background: var(--red); margin-bottom: 10px; }

@media (max-width: 820px) { main { grid-template-columns: 1fr; } }

/* Punch types that cannot be taken now. */
.radios label.off { opacity: .55; cursor: not-allowed; }
.radios label.off small { color: #8a4b00; }
