/* The signed-out screens: Sign in with Google, admin use only, no account, sign-in errors, finish setting
   up in the app and restoring (SPEC addendum A.2), plus the email/password screens of SPEC § 9 that
   the signin-password script keeps (unreachable from the site). Prefix .si- plus the shared .glass /
   .press; tokens only (SPEC § 1.4). */

.si {
  position: relative; flex: 1 1 auto; width: 100%; height: 100%; min-height: 100%;
  display: grid; place-items: center; overflow: auto; isolation: isolate;
  background: var(--bg); color: var(--label);
}

/* two very soft, static accent blobs behind the card */
.si-blob { position: absolute; z-index: -1; border-radius: 50%; pointer-events: none; filter: blur(90px); }
.si-blob-a { width: 620px; height: 620px; left: -180px; top: -220px; background: color-mix(in srgb, var(--accent) 10%, transparent); }
.si-blob-b { width: 560px; height: 560px; right: -160px; bottom: -200px; background: color-mix(in srgb, var(--indigo) 8%, transparent); }

.si-main { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 40px 16px; }
.si-main[hidden] { display: none; }

.si-card {
  width: 400px; max-width: calc(100vw - 32px); border-radius: 28px; padding: 32px;
  background: var(--glass-fill); box-shadow: var(--glass-rim), var(--pop-shadow);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  overflow: hidden;
}
.si-card.si-pop { animation: siPopIn 520ms var(--spring-pop) both; }
@keyframes siPopIn { from { opacity: 0; transform: scale(0.94) translateY(8px); } to { opacity: 1; transform: none; } }

.si-screen { display: flex; flex-direction: column; gap: 14px; margin: 0; }

/* header */
.si-head { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-bottom: 8px; text-align: center; }
/* the Domaselo mark, as the app draws it (SignInDomaseloMark): a heavy rounded "d" in the page colour on
   a label-colour square, no orange (addendum B keeps the accent for primary actions) */
.si-logo {
  width: 56px; height: 56px; border-radius: 15px; margin-bottom: 10px;
  display: grid; place-items: center; background: var(--label); color: var(--bg);
  font-family: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-size: 35px; font-weight: 800; line-height: 1; padding-bottom: 3px; box-sizing: border-box;
}
.si-title { margin: 0; font-size: 24px; line-height: 1.2; font-weight: 700; letter-spacing: -0.2px; color: var(--label); }
.si-title-l { font-size: 26px; }
.si-sub, .si-intro, .si-body { margin: 0; font-size: 15px; line-height: 1.4; color: var(--label-2); }
.si-managers { align-items: center; text-align: center; }
.si-managers .si-btn { align-self: stretch; margin-top: 6px; }
.si-tile {
  width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center;
  background: var(--fill); color: var(--label); margin-bottom: 4px;
}

/* back chevron */
.si-back {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; margin: -6px 0 2px -4px;
  padding: 4px 6px; border-radius: 8px; font-size: 15px; color: var(--accent-text);
}
.si-back:hover { background: var(--fill-subtle); }

.si-as { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 15px; color: var(--label-2); min-width: 0; }
.si-as span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* fields */
.si-field { display: flex; flex-direction: column; gap: 6px; }
.si-label { font-size: 13px; font-weight: 600; color: var(--label-2); }
.si-input {
  width: 100%; height: 44px; border: 0; border-radius: 12px; padding: 0 14px;
  background: var(--fill); color: var(--label); font: inherit; font-size: 15px; outline: none;
  transition: box-shadow 160ms ease, background-color 160ms ease;
}
.si-input::placeholder { color: var(--label-2); }
.si-input:hover { background: var(--fill-strong); }
.si-input:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }
.si-pw { position: relative; display: flex; }
.si-pw .si-input { padding-right: 46px; }
.si-eye {
  position: absolute; right: 4px; top: 4px; width: 36px; height: 36px; border-radius: 10px;
  display: grid; place-items: center; color: var(--label-2);
}
.si-eye:hover { color: var(--label); background: var(--fill-subtle); }

.si-check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--label-2); cursor: pointer; user-select: none; }
.si-check input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }

/* rules */
.si-rules { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.si-rules li { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--label-2); transition: color 200ms ease; }
.si-rule-icon { display: inline-grid; place-items: center; width: 14px; height: 14px; color: var(--label-2); }
.si-rules li.si-ok { color: var(--label); }
.si-rules li.si-ok .si-rule-icon { color: var(--green); }

/* error + notice */
.si-err, .si-notice { margin: 0; display: flex; align-items: flex-start; gap: 8px; font-size: 13px; line-height: 1.35; }
.si-err { color: var(--red); }
.si-err[hidden], .si-notice[hidden] { display: none; }
.si-err svg, .si-notice svg { flex: none; margin-top: 1px; }
.si-notice { color: var(--label-2); }

/* primary button */
.si-btn {
  position: relative; width: 100%; height: 44px; border-radius: 12px; margin-top: 4px;
  background: var(--accent); color: var(--on-accent); font-size: 15px; font-weight: 600;
  display: grid; place-items: center;
}
.si-btn:disabled { opacity: 0.4; cursor: default; filter: none; transform: none; }
.si-btn-spin {
  position: absolute; right: 14px; top: 50%; width: 18px; height: 18px; margin-top: -9px; border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--on-accent) 35%, transparent); border-top-color: var(--on-accent);
  opacity: 0; transition: opacity 160ms ease;
}
.si-btn.si-busy { opacity: 0.85; }
.si-btn.si-busy .si-btn-spin { opacity: 1; animation: siSpin 800ms linear infinite; }

.si-link {
  align-self: center; padding: 4px 8px; border-radius: 8px; font-size: 15px; color: var(--accent-text);
}
.si-link:hover { background: var(--fill-subtle); }
.si-link:disabled { opacity: 0.4; cursor: default; }

/* footer + preview tag */
.si-foot { margin: 0; max-width: 400px; text-align: center; font-size: 13px; color: var(--label-2); }
.si-foot[hidden] { display: none; }
.si-tag {
  font-size: 11px; font-weight: 600; letter-spacing: 0.4px; text-transform: uppercase;
  padding: 3px 8px; border-radius: 999px; background: var(--fill); color: var(--label-2);
}

/* restoring: the ground and a spinner, shown only after 300 ms */
.si-restoring { position: absolute; inset: 0; display: grid; place-items: center; }
.si-restoring[hidden] { display: none; }
.si-spin {
  width: 28px; height: 28px; border-radius: 50%;
  border: 3px solid var(--fill-strong); border-top-color: var(--label-2);
  opacity: 0; animation: siSpin 800ms linear infinite, siShow 1ms linear 300ms forwards;
}
@keyframes siSpin { to { transform: rotate(360deg); } }
@keyframes siShow { to { opacity: 1; } }

.si-sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ───── Google sign-in (addendum A.2): a plain --bg page, the mark and one button ───── */
.si-plain { background: var(--bg); }
.si-stage { display: flex; flex-direction: column; align-items: center; }
.si-center { align-items: center; text-align: center; width: 360px; max-width: calc(100vw - 32px); }
.si-google { gap: 28px; }
.si-google .si-logo { width: 64px; height: 64px; border-radius: 17px; font-size: 40px; margin: 0; }
.si-google .si-err { align-self: center; text-align: left; max-width: 320px; }
.si-gsi {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 44px; min-width: 240px; padding: 0 18px; border-radius: 22px;
  background: var(--gsi-fill); color: var(--gsi-text); box-shadow: inset 0 0 0 1px var(--gsi-line);
  font-size: 15px; font-weight: 500; letter-spacing: 0.25px; white-space: nowrap;
}
.si-gsi:hover { filter: brightness(0.97); }
.si-gsi:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.si-gsi:disabled { opacity: 0.45; cursor: default; filter: none; transform: none; }
.si-gsi-g { display: inline-grid; place-items: center; width: 20px; height: 20px; flex: none; }
.si-gsi .si-btn-spin { right: 12px; border-color: color-mix(in srgb, var(--gsi-text) 30%, transparent); border-top-color: var(--gsi-text); }
.si-gsi.si-busy .si-btn-spin { opacity: 1; animation: siSpin 800ms linear infinite; }
.si-note { gap: 12px; }
.si-note .si-tile { margin-bottom: 6px; }
.si-note .si-btn { max-width: 320px; margin-top: 10px; }

@media (prefers-reduced-motion: reduce) {
  .si-gsi.si-busy .si-btn-spin { animation: none; }
  .si-card.si-pop { animation: none; }
  .si-spin { animation: siShow 1ms linear 300ms forwards; border-top-color: var(--label-2); }
  .si-btn.si-busy .si-btn-spin { animation: none; }
  .si-input, .si-rules li { transition: none; }
}
