:root {
  --bg: #0a0a0d; --s1: #15151b; --s2: #1e1e27; --line: #2a2a36;
  --text: #f4f3f8; --muted: #8e8c9c; --accent: #9d8cff; --ok: #6ee7a8; --bad: #ff6b81;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: dark;
}
* { box-sizing: border-box; margin: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  background: var(--bg); color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
[hidden] { display: none !important; }

.glow {
  position: fixed; inset: -30% -20% auto; height: 70vh; pointer-events: none; z-index: 0;
  background: radial-gradient(closest-side, rgba(157, 140, 255, .22), transparent 70%);
  filter: blur(20px); animation: drift 14s ease-in-out infinite alternate;
}
@keyframes drift { to { transform: translate3d(6%, 8%, 0) scale(1.1); } }

.view {
  position: relative; z-index: 1; max-width: 460px; margin: 0 auto; min-height: 100%;
  padding: max(28px, env(safe-area-inset-top)) 22px max(28px, env(safe-area-inset-bottom));
  animation: rise .55s var(--ease) both;
}
.view.leave { animation: sink .25s ease-in both; }
@keyframes rise { from { opacity: 0; transform: translateY(18px) scale(.985); } }
@keyframes sink { to { opacity: 0; transform: translateY(-10px); } }

#login { display: flex; flex-direction: column; justify-content: center; }
h1 { font-size: 30px; font-weight: 700; letter-spacing: -.02em; margin-top: 22px; }
h2 { font-size: 26px; font-weight: 700; letter-spacing: -.02em; overflow-wrap: anywhere; }
.sub { color: var(--muted); font-size: 14px; }
h1 + .sub { margin: 6px 0 30px; }

.mark {
  width: 60px; height: 60px; border-radius: 20px; display: grid; place-items: center;
  background: linear-gradient(145deg, rgba(157, 140, 255, .28), rgba(157, 140, 255, .08));
  border: 1px solid rgba(157, 140, 255, .3);
}
.mark svg { width: 28px; height: 28px; fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

form { display: grid; gap: 14px; }
label > span { display: block; font-size: 13px; color: var(--muted); margin: 0 0 6px 4px; }
input:not([type=file]) {
  width: 100%; height: 54px; padding: 0 16px; border-radius: 16px; font: inherit; color: var(--text);
  background: var(--s1); border: 1px solid var(--line); outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
input:focus { border-color: var(--accent); background: var(--s2); box-shadow: 0 0 0 4px rgba(157, 140, 255, .16); }
.err { color: var(--bad); font-size: 14px; min-height: 20px; margin-left: 4px; }
.shake { animation: shake .4s var(--ease); }
@keyframes shake { 25% { transform: translateX(-7px); } 60% { transform: translateX(5px); } 85% { transform: translateX(-2px); } }

button { font: inherit; border: 0; cursor: pointer; color: inherit; transition: transform .15s var(--ease), opacity .2s, background .2s; }
button:active { transform: scale(.97); }
button:focus-visible, .zone:focus-within { outline: 2px solid var(--accent); outline-offset: 3px; }
.primary { height: 56px; border-radius: 18px; background: var(--accent); color: #0d0b1a; font-weight: 650; font-size: 16px; }
.primary[disabled] { opacity: .6; }
.primary.busy span { display: inline-block; width: 20px; height: 20px; border-radius: 50%; font-size: 0;
  border: 2.5px solid rgba(13, 11, 26, .25); border-top-color: #0d0b1a; animation: spin .7s linear infinite; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
.ghost { background: var(--s1); border: 1px solid var(--line); height: 40px; padding: 0 16px; border-radius: 999px; font-size: 14px; color: var(--muted); }

header { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 22px; }

.zone {
  display: grid; justify-items: center; gap: 8px; padding: 38px 20px; text-align: center; cursor: pointer;
  border-radius: 28px; background: var(--s1); border: 1.5px dashed var(--line);
  transition: transform .25s var(--ease), border-color .2s, background .2s;
}
.zone strong { font-size: 18px; font-weight: 650; margin-top: 10px; }
.zone:active { transform: scale(.985); }
.zone.over { border-color: var(--accent); background: var(--s2); transform: scale(1.015); }
.zone.over .mark { animation: bob .8s var(--ease) infinite alternate; }
@keyframes bob { to { transform: translateY(-6px); } }

.summary { margin-top: 22px; animation: rise .4s var(--ease) both; }
.bar { height: 6px; border-radius: 3px; background: var(--s2); overflow: hidden; margin-bottom: 8px; }
.bar i { display: block; height: 100%; width: 100%; border-radius: 3px; background: var(--accent);
  transform-origin: left; transform: scaleX(0); transition: transform .35s var(--ease), background .3s; }
.bar.done i { background: var(--ok); }

.list { list-style: none; padding: 0; margin-top: 14px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.list li {
  position: relative; aspect-ratio: 1; border-radius: 16px; overflow: hidden; background: var(--s1);
  animation: pop .45s var(--ease) both;
}
@keyframes pop { from { opacity: 0; transform: scale(.8); } }
.list img, .list video { width: 100%; height: 100%; object-fit: cover; display: block; transition: filter .3s, opacity .3s; }
.list li:not(.ok) img, .list li:not(.ok) video { filter: saturate(.6) brightness(.55); }
.list .fill { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: var(--accent);
  transform-origin: left; transform: scaleX(0); transition: transform .2s linear, opacity .4s; }
.list li.ok .fill { opacity: 0; }
.list .badge {
  position: absolute; top: 8px; right: 8px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  transform: scale(0); transition: transform .35s var(--ease);
}
.list li.ok .badge { background: var(--ok); transform: scale(1); }
.list li.bad .badge { background: var(--bad); transform: scale(1); }
.list .badge svg { width: 14px; height: 14px; fill: none; stroke: #08130d; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.list li.bad { outline: 1.5px solid var(--bad); outline-offset: -1.5px; }
.list .why { position: absolute; inset: auto 6px 8px; font-size: 11px; line-height: 1.25; color: #fff; text-align: center; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
.list li.bad img, .list li.bad video, .list li.bad .fill { opacity: 0; }
