/* Upload dialog: drop zone, hoop court, save step, sign-in step. */
/* ============ Round 6: upload dialog and the paper-ball hoop ============ */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.up [hidden] { display: none !important; }
.linkish { padding: 0; border: 0; background: none; font-weight: 650; text-decoration: underline; text-decoration-color: var(--periwinkle); text-decoration-thickness: 2px; text-underline-offset: 4px; cursor: pointer; min-height: 32px; }
.linkish:hover { text-decoration-color: var(--ink); }
html.up-open { overflow: hidden; }
.up {
  margin: max(12px, 6vh) auto auto;
  width: min(680px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
  color: var(--ink);
}
.up::backdrop { background: rgb(27 33 64 / 0.45); backdrop-filter: blur(4px); }
.up[open] { animation: upIn 420ms var(--spring); }
.up[open]::backdrop { animation: upFade 300ms ease-out; }
@keyframes upIn { from { opacity: 0; transform: translateY(24px) scale(0.96); } }
@keyframes upFade { from { opacity: 0; } }
.up-card {
  position: relative;
  max-height: calc(100dvh - 24px);
  overflow: auto;
  padding: 26px clamp(18px, 4vw, 34px) 28px;
  border-radius: 24px;
  background: linear-gradient(180deg, #eef2ff 0, #fff 140px);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow-card);
}
.up-x { position: absolute; top: 17px; right: 17px; display: grid; place-items: center; padding: 0; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line-2); background: #fff; font-size: 1.375rem; line-height: 1; cursor: pointer; z-index: 3; }
.up-x:hover { background: var(--marigold-soft); }
.up-track { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0 56px 22px 0; font-size: 0.8125rem; font-weight: 650; color: var(--ink-3); }
.up-track li { display: flex; align-items: center; gap: 6px; padding-right: 14px; position: relative; }
.up-track li:not(:last-child)::after { content: ""; width: 22px; height: 2px; margin-left: 8px; background: var(--line); border-radius: 2px; }
.up-track span { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); background: #fff; font-size: 0.6875rem; }
.up-track .is-on { color: var(--ink); }
.up-track .is-on span { border-color: var(--ink); background: var(--marigold); }
.up-track .is-done span { border-color: var(--leaf); background: var(--leaf); color: #fff; }
.up-pane { display: none; }
.up-pane.is-on { display: block; animation: paneIn 380ms var(--ease); }
@keyframes paneIn { from { opacity: 0; transform: translateX(18px); } }
.up-title { margin: 0; font-size: clamp(1.625rem, 3.6vw, 2.125rem); line-height: 1.1; letter-spacing: -0.02em; font-weight: 700; }
.up-sub { margin: 8px 0 0; color: var(--ink-2); font-size: var(--t-16); max-width: 46ch; }
.up-fine { margin-top: 14px; font-size: 0.8125rem; color: var(--ink-3); max-width: 52ch; }
.up-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; }
.up-alt { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 20px; margin-top: 18px; font-size: var(--t-14); color: var(--ink-2); }
.up-demo { margin-top: 8px; font-size: 0.75rem; color: var(--ink-3); font-style: italic; }
.up-card.is-signin .up-track { visibility: hidden; }
.gbtn.is-loading { pointer-events: none; }
.gbtn.is-loading svg { animation: gspin 0.9s linear infinite; }
@keyframes gspin { to { transform: rotate(360deg); } }
.up-error { min-height: 0; margin-top: 10px; color: var(--redpen); font-weight: 650; font-size: var(--t-14); }
.up-error:empty { margin: 0; }

/* drop zone: a paper sheet waiting on a dashed runway */
.drop {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(20px, 5vw, 44px);
  margin-top: 22px;
  padding: 28px clamp(18px, 4vw, 30px);
  min-height: 200px;
  border-radius: 18px;
  border: 2.5px dashed var(--periwinkle);
  background: #f7f8ff;
  cursor: pointer;
  transition: background-color 200ms, border-color 200ms, transform 300ms var(--spring);
}
.drop:hover, .drop.is-over { background: var(--marigold-soft); border-color: var(--ink); }
.drop.is-over { transform: scale(1.015); }
.drop:focus-within { outline: 3px solid var(--periwinkle-ink); outline-offset: 3px; }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.drop-sheet {
  position: relative;
  flex: none;
  width: 112px;
  height: 148px;
  padding: 18px 14px;
  border-radius: 3px;
  background: #fff;
  box-shadow: var(--shadow-paper);
  transform: rotate(-6deg);
  transition: transform 400ms var(--spring);
}
.drop:hover .drop-sheet, .drop.is-over .drop-sheet { transform: rotate(2deg) translateY(-6px); }
.ds-fold { position: absolute; right: 0; top: 0; width: 22px; height: 22px; background: linear-gradient(225deg, #f7f8ff 50%, #e3e6f2 50%); }
.ds-line { display: block; width: var(--w); height: 6px; margin-top: 8px; border-radius: 6px; background: #e3e6f2; }
.ds-line:first-of-type { height: 9px; background: var(--ink); margin-top: 0; }
.ds-pdf { position: absolute; left: -10px; bottom: 14px; padding: 2px 8px; border-radius: 6px; background: var(--redpen); color: #fff; font-size: 0.6875rem; font-weight: 800; letter-spacing: 0.04em; }
.drop-copy { display: grid; gap: 6px; text-align: left; font-size: var(--t-16); color: var(--ink-2); }
.drop-copy b { font-size: var(--t-24); color: var(--ink); letter-spacing: -0.015em; line-height: 1.15; }
.drop-copy u { text-decoration-color: var(--periwinkle); text-decoration-thickness: 2px; text-underline-offset: 4px; color: var(--ink); font-weight: 650; }
/* hand-off: the sheet lifts out of the drop zone; the crunch itself plays on the court */
.drop.is-crumpling .drop-sheet { animation: lift 420ms var(--ease) forwards; }
.drop.is-crumpling .drop-copy { opacity: 0; transition: opacity 200ms; }
@keyframes lift { 40% { transform: rotate(0deg) translateY(-14px) scale(1.06); } 100% { transform: rotate(4deg) translate(60px, -40px) scale(0.7); opacity: 0; } }
@keyframes crumple {
  30% { transform: rotate(10deg) scale(0.9, 0.8); border-radius: 30% 20% 35% 25%; }
  60% { transform: rotate(-20deg) scale(0.55); border-radius: 45%; }
  100% { transform: rotate(160deg) scale(0.32); border-radius: 50%; background: #fdfdff; }
}

/* the court */
.court { position: relative; margin-top: 16px; border-radius: 18px; overflow: hidden; border: 1px solid var(--line-2); background: linear-gradient(180deg, #dde6ff 0%, #f2f5ff 70%); }
.court-canvas { display: block; width: 100%; aspect-ratio: 16 / 10; touch-action: none; cursor: grab; }
.court-canvas:active { cursor: grabbing; }
.court-canvas:focus-visible { outline: 3px solid var(--periwinkle-ink); outline-offset: -5px; border-radius: 16px; }
.court-file { position: absolute; left: 12px; top: 10px; max-width: 46%; padding: 3px 10px; border-radius: 99px; background: #fff; border: 1.5px solid var(--ink); font-size: 0.75rem; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.court-file:empty { display: none; }
.court-shout {
  position: absolute; left: 50%; top: 34%;
  font-family: var(--hand); font-size: clamp(2rem, 6vw, 3.25rem); line-height: 1; color: var(--ink);
  transform: translate(-50%, -50%) rotate(-6deg) scale(0.6); opacity: 0; pointer-events: none; white-space: nowrap;
}
.court-shout.is-on { animation: shout 1.1s var(--spring) forwards; }
.court-shout.is-miss { color: var(--redpen); }
@keyframes shout { 20% { opacity: 1; transform: translate(-50%, -50%) rotate(-6deg) scale(1.1); } 70% { opacity: 1; transform: translate(-50%, -50%) rotate(-6deg) scale(1); } 100% { opacity: 0; transform: translate(-50%, -70%) rotate(-6deg) scale(1); } }

/* save step */
.save-head { display: flex; align-items: center; gap: 16px; }
.filecard { display: flex; align-items: center; gap: 14px; margin-top: 22px; padding: 14px 16px; border-radius: 14px; background: #fff; border: 2px solid var(--line); }
.fc-icon { flex: none; display: grid; place-items: center; width: 42px; height: 50px; border-radius: 4px; background: var(--redpen); color: #fff; font-size: 0.6875rem; font-weight: 800; letter-spacing: 0.04em; }
.fc-icon.is-doc { background: #2b5fd9; }
.fc-body { flex: 1; min-width: 0; }
.fc-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fc-state { font-size: 0.8125rem; color: var(--ink-3); }
.fc-bar { display: block; height: 6px; margin-top: 8px; border-radius: 6px; background: var(--line); overflow: hidden; }
.fc-bar span { display: block; height: 100%; width: 100%; background: var(--leaf); transform: scaleX(0); transform-origin: left; transition: transform 1400ms var(--ease); }
.filecard.is-reading .fc-bar span { transform: scaleX(1); }
.fc-tick { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--leaf); transform: scale(0); transition: transform 400ms var(--spring); position: relative; }
.fc-tick::after { content: ""; position: absolute; left: 9px; top: 6px; width: 7px; height: 12px; border: solid #fff; border-width: 0 3px 3px 0; transform: rotate(45deg); }
.filecard.is-ready { border-color: var(--leaf); }
.filecard.is-ready .fc-tick { transform: scale(1); }
.filecard.is-ready .fc-bar { display: none; }
.gbtn {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  width: 100%; min-height: 56px; margin-top: 18px; padding: 0 24px;
  border-radius: 999px; border: 1px solid var(--line-2); background: #fff;
  font-weight: 700; font-size: var(--t-18); cursor: pointer;
  box-shadow: var(--shadow-card);
  transition: transform 160ms var(--ease), box-shadow 160ms var(--ease), opacity 200ms;
}
.gbtn:hover:not(:disabled) { transform: translate(-2px, -2px); box-shadow: var(--shadow-card); }
.gbtn:disabled { opacity: 0.45; cursor: progress; box-shadow: none; }
.done { display: grid; justify-items: center; text-align: center; gap: 10px; padding: 10px 0 4px; }
.done .up-sub { margin-bottom: 12px; }
@media (max-width: 520px) {
  .up-card { box-shadow: var(--shadow-card); border-radius: 20px; }
  .drop { flex-direction: column; text-align: center; min-height: 0; }
  .drop-copy { justify-items: center; text-align: center; }
  .up-x { right: 12px; }
  .up-alt { flex-direction: column; align-items: flex-start; }
  .up-track { font-size: 0.75rem; }
  .up-track li:not(:last-child)::after { width: 10px; margin-left: 4px; }
  .court-canvas { aspect-ratio: auto; height: min(56svh, 470px); }
  .save-head { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 400px) {
  .up-track { gap: 12px; }
  .up-track li { padding-right: 0; }
  .up-track li:not(:last-child)::after { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .up[open], .up-pane.is-on { animation: none; }
}

/* ---------- ATS check report (save step) ---------- */
.ats { margin-top: 14px; padding: 16px 18px; border-radius: 14px; background: #fff; border: 1px solid var(--line-2); }
/* keep "Continue" in reach when the report makes the step long */
[data-pane="save"] .gbtn { position: sticky; bottom: 0; z-index: 2; }
[data-pane="save"] .gbtn:not(:disabled) { box-shadow: 0 -10px 18px 4px #fff, var(--shadow-card); }

/* Google's own sign-in button (assets/js/app/google-auth.js) */
.gbtn[hidden], .gsi-slot[hidden] { display: none; }
/* left-aligned with the title and text, same width as the text column, pill like the rest of the site */
.gsi-slot { display: flex; justify-content: flex-start; width: 100%; max-width: 400px; min-height: 44px; margin-top: 28px; border-radius: 999px; }
.gsi-slot + .up-error:empty + .up-fine { margin-top: 22px; }
/* our placeholder button (while Google loads / "Continue as …") looks like Google's black pill, so nothing jumps */
.up-pane .gbtn { width: 100%; max-width: 400px; min-height: 44px; margin-top: 28px; padding: 0 20px 0 4px; justify-content: flex-start; gap: 0;
  background: #1f1f1f; border-color: #1f1f1f; color: #fff; font-weight: 500; font-size: 0.9375rem; box-shadow: none; }
.up-pane .gbtn svg { flex: none; box-sizing: content-box; width: 18px; height: 18px; padding: 9px; margin-right: 10px; border-radius: 50%; background: #fff; }
.up-pane .gbtn [data-g-label] { flex: 1; text-align: center; margin-right: 36px; }
.up-pane .gbtn:hover:not(:disabled) { transform: none; background: #333; box-shadow: none; }
[data-pane="save"] .gbtn:not(:disabled) { box-shadow: 0 -10px 18px 4px #fff; }
.up-pane .gbtn.is-me svg { display: none; }
.up-pane .gbtn.is-me [data-g-label] { margin-right: 0; }
.gsi-slot[aria-busy="true"] { opacity: 0.5; pointer-events: none; }
[data-pane="save"] .gsi-slot { position: sticky; bottom: 0; z-index: 2; background: #fff; padding: 6px 0; }
