/* facecheck.css - the face-check sheet (facecheck.js). Full screen on phones, a centred panel on computers.
   Rollback: remove its <link> (and facecheck.js). */
.fc {
  position: fixed; inset: 0; z-index: 70; display: flex; align-items: stretch; justify-content: center;
  background: rgba(14, 12, 24, .72); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  opacity: 0; transition: opacity .25s ease;
}
.fc.on { opacity: 1; }
.fc-box {
  position: relative; width: 100%; max-width: 480px; display: flex; flex-direction: column; overflow-y: auto;
  background: var(--bg); color: var(--t1);
  padding: calc(10px + env(safe-area-inset-top, 0px)) 20px calc(20px + env(safe-area-inset-bottom, 0px));
  transform: translateY(24px); transition: transform .4s cubic-bezier(.22, 1.2, .36, 1); box-sizing: border-box;
}
.fc.on .fc-box { transform: none; }
@media (min-width: 640px) {
  .fc { align-items: center; padding: 24px; }
  .fc-box { max-height: min(860px, 94vh); border-radius: 28px; box-shadow: var(--sh2); }
}
.fc svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* top row: close + label */
.fc-top { display: flex; align-items: center; gap: 12px; min-height: 48px; margin-bottom: 4px; }
.fc-x {
  display: grid; place-items: center; width: 42px; height: 42px; border: 0; border-radius: 50%;
  background: var(--s2); color: var(--t1); cursor: pointer; transition: transform .2s, background .2s;
}
.fc-x:active { transform: scale(.92); }
.fc-x svg { width: 20px; height: 20px; }
.fc-lbl { font: 700 15px var(--font-b); color: var(--t2); }

/* intro */
.fc-in { display: flex; flex-direction: column; gap: 14px; animation: fcUp .45s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes fcUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.fc-hero {
  display: grid; place-items: center; width: 72px; height: 72px; margin: 6px auto 0; border-radius: 24px;
  background: var(--tint); color: var(--acc-t); animation: fcPop .6s cubic-bezier(.22, 1.4, .36, 1) both .1s;
}
.fc-hero svg { width: 38px; height: 38px; }
@keyframes fcPop { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
.fc h2 { margin: 0; text-align: center; font: 800 26px/1.2 var(--font-d); }
.fc-lead { margin: 0; text-align: center; color: var(--t2); font-size: 15px; line-height: 1.55; }
.fc-poses { display: flex; justify-content: center; gap: 8px; margin: 4px 0; }
.fc-poses span {
  display: grid; place-items: center; width: 52px; height: 52px; border-radius: 18px; background: var(--s1); color: var(--t2);
  box-shadow: var(--sh1); animation: fcPop .5s cubic-bezier(.22, 1.4, .36, 1) both;
}
.fc-poses span:nth-child(2) { animation-delay: .06s; } .fc-poses span:nth-child(3) { animation-delay: .12s; }
.fc-poses span:nth-child(4) { animation-delay: .18s; } .fc-poses span:nth-child(5) { animation-delay: .24s; }
.fc-poses svg { width: 34px; height: 34px; stroke-width: 2.2; }
.fc-pts { list-style: none; margin: 0; padding: 14px 16px; border-radius: 20px; background: var(--s1); display: grid; gap: 10px; }
.fc-pts li { position: relative; padding-left: 26px; font-size: 14px; line-height: 1.5; color: var(--t2); }
.fc-pts li::before {
  content: "\2713"; position: absolute; left: 0; top: 1px; width: 18px; height: 18px; border-radius: 50%;
  display: grid; place-items: center; font-size: 10px; font-weight: 800; background: rgba(42, 140, 130, .16); color: var(--ok);
}
.fc-ok { display: flex; gap: 12px; align-items: flex-start; padding: 12px 4px; font-size: 14px; line-height: 1.5; cursor: pointer; }
.fc-ok input { flex: none; width: 22px !important; height: 22px; min-height: 0 !important; margin: 1px 0 0; accent-color: var(--acc); }
.fc-go { border-radius: 16px !important; clip-path: none !important; min-height: 52px; text-transform: none; letter-spacing: 0; font: 700 16px var(--font-b); }
.fc-go:disabled { opacity: .45; cursor: not-allowed; }
.fc-left { margin: -4px 0 0; text-align: center; font-size: 13px; color: var(--t3); }
.fc-err { margin: 0; text-align: center; font-size: 14px; color: var(--acc-t); min-height: 1em; }

/* camera */
.fc-cam { flex: 1; display: flex; flex-direction: column; gap: 14px; animation: fcUp .35s ease both; }
.fc-dots { display: flex; justify-content: center; gap: 6px; }
.fc-dots i { width: 28px; height: 5px; border-radius: 3px; background: var(--s3); transition: background .3s, width .3s; }
.fc-dots i.done { background: var(--ok); }
.fc-dots i.on { width: 44px; background: var(--acc); }
.fc-view {
  position: relative; flex: 1; min-height: 300px; max-height: 62vh; aspect-ratio: 3 / 4; align-self: center; width: 100%;
  border-radius: 28px; overflow: hidden; background: #0E0C18;
}
.fc-view video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.fc-oval { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.fc-oval > rect { fill: rgba(14, 12, 24, .55); stroke: none; }
.fc-ring { fill: none; stroke: #fff; stroke-width: .8; stroke-dasharray: 3 2; animation: fcSpin 14s linear infinite; }
@keyframes fcSpin { to { stroke-dashoffset: -100; } }
.fc-count {
  position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none;
  font: 800 96px/1 var(--font-d); color: #fff; text-shadow: 0 4px 24px rgba(0, 0, 0, .4);
}
.fc-count.go { animation: fcCount .75s ease both; }
@keyframes fcCount { 0% { transform: scale(1.6); opacity: 0; } 25% { transform: scale(1); opacity: 1; } 100% { transform: scale(.8); opacity: 0; } }
.fc-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.fc-flash.go { animation: fcFlash .45s ease-out; }
@keyframes fcFlash { 0% { opacity: .9; } 100% { opacity: 0; } }
.fc-ask {
  display: flex; align-items: center; gap: 12px; justify-content: center; padding: 12px 16px; border-radius: 20px;
  background: var(--s1); box-shadow: var(--sh1); animation: fcPop .45s cubic-bezier(.22, 1.4, .36, 1) both;
}
.fc-ask b { font: 700 18px/1.3 var(--font-d); }
.fc-pose { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--tint); color: var(--acc-t); flex: none; }
.fc-pose svg { width: 32px; height: 32px; stroke-width: 2.2; }
.fc-bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; }
.fc-back { justify-self: start; border: 0; background: none; color: var(--t2); font: 600 15px var(--font-b); padding: 10px; cursor: pointer; }
.fc-shut {
  width: 78px; height: 78px; border-radius: 50%; border: 4px solid var(--t1); background: none; padding: 5px; cursor: pointer;
  transition: transform .2s cubic-bezier(.22, 1.2, .36, 1);
}
.fc-shut span { display: block; width: 100%; height: 100%; border-radius: 50%; background: var(--acc); transition: transform .2s; }
.fc-shut:active { transform: scale(.9); }
.fc-shut:active span { transform: scale(.88); }

/* guided live check */
.fc-ask { min-height: 68px; box-sizing: border-box; }
.fc-ask.go { animation: fcPop .45s cubic-bezier(.22, 1.4, .36, 1) both; }
.fc-ask .fc-pose[hidden] { display: none; }
.fc-ask:has(#fc-say:empty) { visibility: hidden; }
.fc-prog2 { fill: none; stroke: var(--acc); stroke-width: 2.2; stroke-dasharray: 100; stroke-dashoffset: 100; opacity: 0; }
.fc-prog2.run { opacity: 1; animation: fcFill linear forwards; }
@keyframes fcFill { to { stroke-dashoffset: 0; } }
.fc-ok2 { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; opacity: 0; }
.fc-ok2 svg { width: 96px; height: 96px; stroke: #fff; stroke-width: 4; filter: drop-shadow(0 4px 14px rgba(0, 0, 0, .35)); }
.fc-ok2.go { animation: fcOk .7s ease both; }
.fc-ok2.go path { stroke-dasharray: 40; stroke-dashoffset: 40; animation: fcDraw .35s ease forwards .05s; }
@keyframes fcOk { 0% { opacity: 0; transform: scale(.7); } 25% { opacity: 1; transform: scale(1); } 75% { opacity: 1; } 100% { opacity: 0; } }
.fc-panel { display: flex; flex-direction: column; gap: 12px; }
.fc-panel:empty { display: none; }
.fc-cs { margin: 0; text-align: center; font-size: 14px; line-height: 1.55; color: var(--t2); }

/* check page */
.fc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.fc-th {
  position: relative; padding: 0; border: 0; border-radius: 18px; overflow: hidden; aspect-ratio: 3 / 4; background: var(--s2); cursor: pointer;
  animation: fcPop .45s cubic-bezier(.22, 1.4, .36, 1) both; transition: transform .2s;
}
.fc-th:nth-child(2) { animation-delay: .05s; } .fc-th:nth-child(3) { animation-delay: .1s; }
.fc-th:nth-child(4) { animation-delay: .15s; } .fc-th:nth-child(5) { animation-delay: .2s; }
.fc-th:active { transform: scale(.95); }
.fc-th img { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.fc-th span {
  position: absolute; left: 6px; right: 6px; bottom: 6px; padding: 4px 6px; border-radius: 10px;
  background: rgba(14, 12, 24, .62); color: #fff; font: 600 11px/1.3 var(--font-b); text-align: left;
}
.fc-prog { height: 6px; border-radius: 3px; background: var(--s3); overflow: hidden; }
.fc-prog i { display: block; width: 4%; height: 100%; background: var(--acc); border-radius: 3px; transition: width .3s ease; }

/* sent */
.fc-done { align-items: center; padding-top: 8vh; }
.fc-tick { width: 92px; height: 92px; color: var(--ok); }
.fc-tick svg { width: 100%; height: 100%; stroke-width: 3; }
.fc-tick circle { stroke-dasharray: 151; stroke-dashoffset: 151; animation: fcDraw .6s ease forwards; }
.fc-tick path { stroke-dasharray: 40; stroke-dashoffset: 40; animation: fcDraw .4s ease forwards .5s; }
@keyframes fcDraw { to { stroke-dashoffset: 0; } }
.fc-done .fc-go { width: 100%; }

/* the card on the Profile page */
.fc-card { border-radius: 18px; }
.fc-rej .muted { color: var(--acc-t); }

@media (prefers-reduced-motion: reduce) {
  .fc *, .fc { animation: none !important; transition: none !important; }
  .fc-tick circle, .fc-tick path { stroke-dashoffset: 0; }
}
/* end of facecheck.css */

/* ---------- phones: one screen, no scrolling ----------
   The camera fills the screen; the close button and the progress dots float on top, the pose instruction floats
   near the bottom, and the consent text and the start button sit at the very bottom, where the thumb is.
   The face oval keeps its shape on any screen (facecheck.js uses preserveAspectRatio="xMidYMid slice"). */
@media (max-width: 639px) {
  .fc-box:has(.fc-cam) { height: 100dvh; padding: 0; overflow: hidden; background: #0E0C18; }
  .fc-box:has(.fc-cam) .fc-top {
    position: absolute; z-index: 3; top: 0; left: 0; right: 0; margin: 0;
    padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 0; color: #fff;
  }
  .fc-box:has(.fc-cam) .fc-x { background: rgba(0, 0, 0, .38); color: #fff; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
  .fc-box:has(.fc-cam) .fc-lbl { color: rgba(255, 255, 255, .9); text-shadow: 0 1px 6px rgba(0, 0, 0, .5); }
  .fc-cam { position: relative; flex: 1; min-height: 0; gap: 0; }
  .fc-cam .fc-view {
    position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; max-height: none; min-height: 0;
    aspect-ratio: auto; border-radius: 0;
  }
  .fc-cam .fc-dots { position: absolute; z-index: 3; left: 0; right: 0; top: calc(64px + env(safe-area-inset-top, 0px)); }
  .fc-cam .fc-dots i { background: rgba(255, 255, 255, .35); }
  .fc-cam .fc-dots i.done { background: #4CD6A0; }
  .fc-cam .fc-dots i.on { background: var(--acc); }
  /* the instruction: dark glass near the bottom, above the button area */
  .fc-cam .fc-ask {
    position: absolute; z-index: 3; left: 16px; right: 16px; bottom: calc(18px + env(safe-area-inset-bottom, 0px));
    background: rgba(14, 12, 24, .62); color: #fff; box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .6);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  }
  .fc-cam .fc-pose { background: rgba(255, 255, 255, .14); color: #fff; }
  .fc-cam:has(.fc-panel:not(:empty)) .fc-ask { bottom: auto; top: calc(86px + env(safe-area-inset-top, 0px)); }
  /* consent, start button, sending bar and errors: pinned to the bottom on a soft dark fade */
  .fc-cam .fc-panel {
    position: absolute; z-index: 3; left: 0; right: 0; bottom: 0; gap: 10px;
    padding: 46px 18px calc(16px + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(to top, rgba(14, 12, 24, .92) 0%, rgba(14, 12, 24, .78) 60%, rgba(14, 12, 24, 0) 100%);
  }
  .fc-cam .fc-panel .fc-cs, .fc-cam .fc-panel .fc-left { color: rgba(255, 255, 255, .86); }
  .fc-cam .fc-panel .fc-err { color: #FFB4A8; }
  .fc-cam .fc-panel .fc-go { width: 100%; min-height: 54px; }
}
