/* giris: sign-in over the workspace. The backdrop is the app's own frame (the tool strip, the pasteboard and
   the sample part's white artboard) held behind a dark veil; the card is the only thing that takes input.
   Tokens and controls come from app.css. */

body { min-height: 100vh; min-height: 100svh; overflow: hidden; }
::selection { background: color-mix(in srgb, var(--accent) 22%, transparent); color: inherit; }

/* ---------- the workspace behind the pane ---------- */
.backdrop {
  position: fixed; inset: 0; display: grid; grid-template-columns: var(--strip-w) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr);
  filter: blur(2px);
  transition: filter 520ms var(--ease-out);
}
/* the strip is only its colour here: the names on it were the old rail's, and an icon-less strip says enough */
.backdrop .side { grid-row: 1; height: 100%; }
.backdrop .side > * { display: none; }
.backdrop .side-item { pointer-events: none; }
.desk {
  position: relative; display: grid; place-items: center; padding: 40px 48px; background-color: var(--paste);
  background-image: radial-gradient(circle, #ffffff12 1px, transparent 1px); background-size: 20px 20px;
}
/* the veil lies over the desk, not the strip */
.desk::after { content: ""; position: absolute; inset: 0; background: var(--frame); opacity: .5; transition: opacity 520ms var(--ease-out); }
.sheet {
  display: grid; grid-template-rows: minmax(0, 1fr) auto; width: min(760px, 100%); height: min(760px, calc(100svh - 80px));
  margin: 0; overflow: hidden; border: 0; border-radius: 2px; background: #fff; color: #1a1c1e;
  box-shadow: 0 18px 40px -20px #000000b3;
}
.sheet-drawing {
  min-height: 0; padding: 28px;
  background: #fff;                            /* the artboard: white paper, as on the part screen */
}
.sheet-drawing svg { display: block; width: 100%; height: 100%; }
/* app.css leaves the title block to work.css; the backdrop needs only its shape */
.title-block { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); border-top: 1px solid #1a1c1e24; background: #fff; }
.title-block div { min-width: 0; padding: 8px 11px; border-left: 1px solid #1a1c1e1f; }
.title-block div:first-child { border-left: 0; }
.title-block span { display: block; color: #5d646b; font: var(--label-weight) var(--t-label) var(--font-label); letter-spacing: var(--label-track); text-transform: uppercase; font-variation-settings: var(--label-vary); }
.title-block strong { display: block; overflow: hidden; font-size: var(--t-meta); text-overflow: ellipsis; white-space: nowrap; }

/* The drawing draws itself once: outline and seams trace in, then topstitch and buttons settle. */
.is-drawing #silhouette path, .is-drawing #seams path { stroke-dasharray: 1; stroke-dashoffset: 1; }
.is-drawing #topstitch, .is-drawing #buttons { opacity: 0; }
.is-drawn #silhouette path, .is-drawn #seams path { stroke-dasharray: 1; stroke-dashoffset: 0; transition: stroke-dashoffset 1300ms var(--ease-out); }
.is-drawn #seams path { transition-delay: 250ms; }
.is-drawn #topstitch, .is-drawn #buttons { opacity: 1; transition: opacity 500ms var(--ease-out) 1100ms; }

/* ---------- the pane and the card ---------- */
.pane {
  /* the same columns as the backdrop, so the card centres on the desk, not on the whole window */
  position: fixed; inset: 0; display: grid; grid-template-columns: var(--strip-w) minmax(0, 1fr); place-items: center;
  padding: 24px 16px; overflow-y: auto;
}
.pane > .card { grid-column: 2; }
.card {
  width: min(400px, 100%);
  border: 1px solid var(--line-strong); border-radius: var(--r-2); background: var(--surface);
  box-shadow: var(--shadow-pop);
  transition: opacity 260ms var(--ease-out), transform 260ms var(--ease-out);
}
.card-head { display: grid; justify-items: start; gap: 14px; padding: 24px 24px 0; }
.card-mark { display: block; }
.card-head h1 { font-size: var(--t-head); letter-spacing: -.015em; }
.card-body { display: grid; gap: 14px; padding: 20px 24px 24px; }

.google { width: 100%; height: 40px; gap: 10px; font-size: var(--t-body); }
.google .g-mark { width: 18px; height: 18px; flex: none; }
.google.is-required { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); }

.rule { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; margin: 2px 0; color: var(--ink-muted); font-size: var(--t-meta); }
.rule::before, .rule::after { content: ""; height: 1px; background: var(--line); }
.lead { margin: 0; color: var(--ink-muted); font-size: var(--t-body); }

.input {
  width: 100%; min-width: 0; height: 38px; padding: 0 11px;
  border: 1px solid var(--line-strong); border-radius: var(--r-1); background: var(--surface);
  font-size: var(--t-body); caret-color: var(--accent);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.input:hover { border-color: var(--ink-muted); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); }
.input[aria-invalid="true"] { border-color: var(--danger); }
.hint { color: var(--ink-muted); font-size: var(--t-meta); }
.legal-note { margin: 0; color: var(--ink); font-size: var(--t-small); line-height: 1.5; }
/* the terms links stand out from the sentence (a notice that is easy to miss does not bind: Berman v. Freedom Financial, 2022) */
.legal-note a { color: var(--accent); font-weight: 500; text-underline-offset: 3px; }
.legal-link { padding: 0; border: 0; background: none; color: inherit; font: inherit; text-decoration: underline; cursor: pointer; }

.link {
  justify-self: start; padding: 0; border: 0; background: none; color: var(--accent);
  font-size: var(--t-meta); font-weight: 500; text-decoration: underline; text-decoration-color: #234a6b55; text-underline-offset: 3px;
}
.link:hover { text-decoration-color: currentColor; }
.back { justify-self: center; }

.error { margin: 0; color: var(--danger); font-size: var(--t-small); line-height: 1.45; }
.error.is-done { color: var(--ok); }
.submit { width: 100%; height: 40px; font-size: var(--t-body); }
.btn.is-busy { position: relative; color: transparent !important; }
.btn.is-busy::after {
  content: ""; position: absolute; width: 14px; height: 14px; border-radius: 50%;
  border: 1.5px solid currentColor; border-color: #ffffff66 #fff #fff #fff; animation: spin 700ms linear infinite;
}
.btn:not(.btn-primary).is-busy::after { border-color: #234a6b33 var(--accent) var(--accent) var(--accent); }
@keyframes spin { to { transform: rotate(360deg); } }

.notice h2 { font-size: var(--t-title); }
.notice p { margin: 0; color: var(--ink-muted); font-size: var(--t-body); }
.notice strong { color: var(--ink); font-weight: 700; overflow-wrap: anywhere; }
.notice .link { justify-self: center; }

/* ---------- the pane lifts: signed in, the workspace comes forward ---------- */
.is-entering .card { opacity: 0; transform: translateY(6px) scale(.985); }
.is-entering .desk::after { opacity: 0; }
.is-entering .backdrop .side > * { opacity: 1; }
.is-entering .backdrop { filter: none; }

@media (max-width: 760px) {
  .backdrop { grid-template-columns: minmax(0, 1fr); }
  .desk::after { opacity: .6; }
  .backdrop .side { display: none; }
  .desk { padding: 24px 16px; }
  /* on a phone the card sits low so the jacket's collar, yoke and shoulders stay in view above it */
  .pane { grid-template-columns: minmax(0, 1fr); place-items: end center; padding-bottom: 16px; }
  .pane > .card { grid-column: 1; }
  .sheet { align-self: start; height: calc(100svh - 48px); }
}

@media (prefers-reduced-motion: reduce) {
  .backdrop, .backdrop .side > *, .desk::after, .card, .is-drawn #silhouette path, .is-drawn #seams path, .is-drawn #topstitch, .is-drawn #buttons { transition: none !important; }
}
