/* Sign-in page (.auth) and the "closed" page. Dark by default. */
:root { color-scheme: dark; --bg:#0b0f17; --card:#121826; --line:#243042; --text:#e6ebf2; --muted:#94a3b8; --accent:#3b82f6; --accent-ink:#ffffff; --bad:#f87171; }
* { box-sizing: border-box; }
body { margin:0; min-height:100vh; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:16px; padding:16px;
  background: radial-gradient(1200px 600px at 50% -10%, #1d4ed833, transparent), var(--bg); color:var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color:var(--accent); }
.small { font-size:12px; color:var(--muted); }
.foot { color:var(--muted); font-size:12px; margin:0; }

/* Closed page card */
.card { width:100%; max-width:380px; background:var(--card); border:1px solid var(--line); border-radius:16px; padding:28px; box-shadow:0 20px 60px #0008; }
.brand { display:flex; align-items:center; gap:10px; }
.brand .logo { display:inline-flex; background:#fff; border-radius:9px; padding:5px 9px; }
.brand img { height:22px; display:block; }
h1 { margin:18px 0 4px; font-size:24px; letter-spacing:-.01em; }
.sub { margin:0 0 20px; color:var(--muted); font-size:14px; }

/* App closed notice (with countdown) */
.closed { margin:0 0 18px; padding:14px 16px; border-radius:12px; background:#422006; border:1px solid #92400e; color:#fde68a; font-size:14px; }
.closed b { display:block; color:#fef3c7; font-size:15px; margin-bottom:4px; }
.closed p { margin:4px 0 0; }
.count { font-variant-numeric: tabular-nums; font-size:28px; font-weight:700; letter-spacing:-.01em; color:#fef3c7; margin:10px 0 2px; }

/* ---- sign-in layout: illustration left, form right ---- */
body.auth { display:block; padding:0; background:var(--bg); }
.auth-shell { min-height:100vh; display:grid; grid-template-columns:minmax(0, 1.15fr) minmax(0, 1fr); }
.auth-main { display:flex; flex-direction:column; justify-content:center; align-items:center; gap:24px; padding:40px 24px; }
.auth-box { width:100%; max-width:360px; }
.brand-name { font-weight:700; font-size:16px; letter-spacing:-.01em; }
.auth h1 { margin:36px 0 6px; font-size:28px; }
.auth .sub { margin-bottom:24px; }
.auth form { display:grid; }
.auth label { font-size:13px; font-weight:500; color:var(--muted); margin:14px 0 6px; }
.auth input { width:100%; padding:12px 14px; border-radius:10px; border:1px solid var(--line); background:var(--card); color:var(--text); font:inherit; }
.auth input:focus { outline:2px solid var(--accent); outline-offset:1px; border-color:transparent; }
.pw-field { position:relative; }
.pw-field input { padding-right:68px; }
.pw-toggle { position:absolute; right:6px; top:50%; transform:translateY(-50%); padding:6px 10px; border:0; border-radius:7px; background:transparent; color:var(--muted); font-family:inherit; font-size:13px; font-weight:500; line-height:1; cursor:pointer; }
.pw-toggle:hover { color:var(--text); background:#ffffff0d; }
.submit { margin-top:24px; width:100%; padding:13px; border:0; border-radius:10px; background:var(--accent); color:var(--accent-ink); font-family:inherit; font-size:15px; font-weight:600; line-height:1; cursor:pointer; }
.submit:hover { filter:brightness(1.08); }
.submit[disabled] { opacity:.7; cursor:default; }
.submit { display:flex; align-items:center; justify-content:center; gap:10px; }
.spinner { display:none; width:16px; height:16px; border:2px solid #ffffff59; border-top-color:#ffffff; border-radius:50%; animation:spin .7s linear infinite; }

/* Signing in: spinner on the button, bar across the top, fields faded */
.auth-progress { position:fixed; top:0; left:0; right:0; height:3px; overflow:hidden; pointer-events:none; z-index:10; }
body.signing .auth-progress::before { content:""; position:absolute; top:0; bottom:0; left:0; width:35%; background:var(--accent); border-radius:3px; animation:slide 1s ease-in-out infinite; }
body.signing .spinner { display:inline-block; }
body.signing .submit[disabled] { opacity:1; cursor:progress; }
body.signing .auth form input, body.signing .pw-toggle { opacity:.55; }
@keyframes spin { to { transform:rotate(360deg); } }
@keyframes slide { from { transform:translateX(-100%); } to { transform:translateX(290%); } }
.error, .info { margin:0 0 4px; padding:10px 12px; border-radius:10px; font-size:14px; }
.error { color:#fecaca; background:#450a0a99; border:1px solid #7f1d1d; }
.info { color:#bfdbfe; background:#172554aa; border:1px solid #1e3a8a; }
.help { margin:18px 0 0; font-size:13px; color:var(--muted); }

.auth-art { order:-1; position:relative; overflow:hidden; display:flex; flex-direction:column; justify-content:center; align-items:center; gap:8px; padding:48px;
  background: radial-gradient(700px 500px at 20% 10%, #3b82f655, transparent), linear-gradient(160deg, #0f1f4b 0%, #13307a 55%, #1d4ed8 100%); }
.art { width:100%; max-width:560px; height:auto; }
.art-text { text-align:center; color:#e0e7ff; max-width:420px; }
.art-text h2 { margin:8px 0 6px; font-size:24px; letter-spacing:-.01em; color:#ffffff; }
.art-text p { margin:0; color:#c7d2fe; font-size:15px; }

/* gentle motion: bars grow, the trend draws, cards float */
.art .bar { transform-box:fill-box; transform-origin:50% 100%; animation:grow .8s cubic-bezier(.2,.7,.2,1) both; }
.art .b2 { animation-delay:.08s; } .art .b3 { animation-delay:.16s; } .art .b4 { animation-delay:.24s; } .art .b5 { animation-delay:.32s; }
.art .trend { stroke-dasharray:180; stroke-dashoffset:180; animation:draw 1s .5s ease-out forwards; }
.art .float { animation:float 5s ease-in-out infinite; }
.art .f2 { animation-delay:-2.5s; }
@keyframes grow { from { transform:scaleY(0); } to { transform:scaleY(1); } }
@keyframes draw { to { stroke-dashoffset:0; } }
@keyframes float { 0%, 100% { transform:translateY(0); } 50% { transform:translateY(-6px); } }
@media (prefers-reduced-motion: reduce) { .art .bar, .art .float { animation:none; } .art .trend { animation:none; stroke-dashoffset:0; } .spinner { animation-duration:2s; } body.signing .auth-progress::before { animation:none; width:100%; opacity:.6; } }

@media (max-width: 900px) {
  .auth-shell { grid-template-columns:minmax(0, 1fr); }
  .auth-art { display:none; }
  .auth h1 { margin-top:28px; }
}
