/* Sign-in page (login.html): the join card's look from style.css on a page of its own, with no 3D scene behind it.
   Tokens only (UI_STYLE.md); nothing here hard-codes a colour, font or duration. */

/* style.css locks the game's page in place; this one scrolls on short or narrow screens */
html, body { height: auto; min-height: 100%; overflow: auto; }
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 28px 16px 44px;
  background: radial-gradient(var(--line-faint) 1.3px, transparent 1.6px) 0 0 / 22px 22px, linear-gradient(180deg, var(--join-top), var(--join-bottom)); }
.login-card { position: relative; }
.login-card .join-hero { margin-bottom: 4px; }

.login-view > * { transform-origin: center top; }
.login-h { margin: 14px 0 2px; font: 900 19px/1.2 var(--font); color: var(--ink); }
.login-lead { margin: 2px 0 4px; color: var(--text-muted); font-weight: 700; line-height: 1.45; text-wrap: pretty; }
.login-help, .notice .login-lead, .join-status { text-wrap: balance; }
.login-lead b { color: var(--ink); }
.login-help { margin: 12px 0 0; text-align: center; font-size: var(--fs-caption); font-weight: 700; color: var(--text-muted); }
.login-loading { display: flex; align-items: center; gap: 10px; margin: 18px 0 4px; color: var(--text-muted); font-weight: 800; }

/* fields */
.field-hint { margin: 5px 0 0; font: 700 var(--fs-caption)/1.35 var(--font); color: var(--text-muted); }
.field-hint .mono { display: inline-block; min-width: 14px; padding: 0 3px; border-radius: 4px; background: var(--cream); color: var(--ink); text-align: center; }
.field-err { display: flex; align-items: flex-start; gap: 5px; margin: 5px 0 0; font: 800 var(--fs-caption)/1.3 var(--font); color: var(--coral-text); }
.field-err:empty { display: none; }
.field-err .ico { width: 15px; height: 15px; margin-top: -1px; }
input[aria-invalid="true"] { border-color: var(--coral-dark); }
input[aria-invalid="true"]:focus { border-color: var(--coral-dark); box-shadow: 0 0 0 3px var(--coral-tint); }
.token-input { letter-spacing: .08em; text-transform: uppercase; }
.token-input::placeholder { letter-spacing: .08em; }

/* password field with its show/hide eye */
.pw { position: relative; }
.pw input { padding-right: 42px; }
.pw-toggle { position: absolute; top: 2px; right: 2px; color: var(--text-muted); }
.pw-toggle:hover, .pw-toggle[aria-pressed="true"] { color: var(--ink); }
.caps { display: inline-flex; align-items: center; margin: 6px 0 0; padding: 2px 8px; border: 1.5px solid var(--sun-dark); border-radius: var(--r-pill);
  background: var(--sun-tint); color: var(--sun-text); font: 800 var(--fs-tiny)/1.4 var(--font); }

/* new-password checklist: each rule ticks over to mint with a little pop */
.pw-rules { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 8px 0 0; padding: 0; font: 800 var(--fs-caption)/1.2 var(--font); color: var(--text-muted); }
.pw-rules li { display: inline-flex; align-items: center; gap: 6px; transition: color var(--dur-fade); }
.pw-rules li::before { content: ''; width: 16px; height: 16px; flex: none; border-radius: 50%; border: 2px solid var(--line-strong); background: var(--paper) no-repeat center / 10px;
  transition: background-color var(--dur-fade), border-color var(--dur-fade); }
.pw-rules li.ok { color: var(--ink); }
.pw-rules li.ok::before { border-color: var(--ink); background-color: var(--mint); animation: pop-in var(--dur-celebrate) var(--ease-celebrate);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232b2d42' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5.5 12.5l4.2 4.2 8.8-9.2'/%3E%3C/svg%3E"); }

/* who invited you, as what */
.invite-from { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 14px 0 0; font-weight: 800; font-size: 13px; }
.invite-from + .login-h { margin-top: 8px; }
.badge.role { text-transform: capitalize; background: var(--primary); }
.badge.role-owner { background: var(--sun); }
.badge.role-admin { background: var(--lavender); }
.badge.role-member { background: var(--primary); }
.badge.role-guest { background: var(--cream); }

/* locked out: a sun pill that counts down while its bar drains */
.lock-bar { position: relative; display: flex; align-items: center; gap: 8px; margin: 14px 0 0; padding: 8px 12px 12px; overflow: hidden;
  background: var(--sun-tint); border: var(--stroke-sm) solid var(--ink); border-radius: 10px; font-weight: 800; font-size: 13px; }
.lock-bar b { font-weight: 900; }
.lock-ico { width: 18px; height: 18px; display: inline-grid; place-items: center; color: var(--sun-text); }
.lock-fill { position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: var(--cream-deep); }
.lock-fill i { display: block; height: 100%; width: 100%; background: var(--sun); transform-origin: left center; }
.lock-bar ~ .cta { margin-top: 12px; }

/* the call-to-action breathes (style.css); a refusal still flashes it */
.login-card .cta.nope-flash { animation: nope-flash .3s ease-out; }
/* the call-to-action after a success */
.login-card button.is-success { --fill: var(--mint); --lip: var(--mint-dark); animation: none; }
.login-card button[aria-busy="true"] { cursor: progress; }
.login-card button[aria-busy="true"] .cta-arrow { display: none; }
.btn-dots { display: inline-flex; gap: 3px; }
.btn-dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--ink); animation: dot 1.1s ease-in-out infinite; }
.btn-dots i:nth-child(2) { animation-delay: .15s; }
.btn-dots i:nth-child(3) { animation-delay: .3s; }

/* notices: expired invite, open office, can't reach the server */
.notice { text-align: center; padding-top: 6px; }
.notice-art { --c: var(--primary); --visor: var(--sun); margin: 12px auto 0; display: grid; }
.notice.is-error .notice-art { --c: var(--coral); --visor: var(--paper); }
.notice.is-info .notice-art { --c: var(--mint); --visor: var(--sun); }
.notice .login-lead { max-width: 330px; margin-left: auto; margin-right: auto; }
.notice-alt { display: block; margin: 8px auto 0; }

.join-status { display: flex; align-items: center; justify-content: center; gap: 6px; }
.join-status.ok { color: var(--ink); }
.join-status .ico { width: 16px; height: 16px; }
.join-status.ok .ico { color: var(--mint-dark); }

/* reduce motion: nothing pops or bounces; fades stay */
.reduce-motion .pw-rules li.ok::before, .reduce-motion .btn-dots i { animation: none !important; }

@media (max-width: 420px) {
  .login-wrap { padding: 14px 10px 28px; place-items: start center; }
  .login-card { padding: 18px 16px 14px; }
  .login-card .display { font-size: 26px; }
}
