/* ==========================================================================
   Sign-in & public pages (split screen, as in the mockup)
   ========================================================================== */
.auth { display: flex; min-height: 100dvh; background: var(--page); }
.auth-aside {
  position: relative; display: none; width: 44%; max-width: 620px; flex-shrink: 0; flex-direction: column; justify-content: space-between;
  overflow: hidden; padding: 48px; background: var(--rail); color: var(--rail-ink);
}
.auth-aside::before { content: ""; position: absolute; right: -160px; top: -160px; width: 560px; height: 560px; border-radius: 50%; opacity: .7;
  background: radial-gradient(circle, color-mix(in oklab, var(--olive) 14%, transparent), transparent 68%); pointer-events: none; }
.auth-logo { position: relative; height: 141px; width: auto; align-self: flex-start; }
.auth-hero { position: relative; }
.auth-hero h1 { font-size: 40px; font-weight: 600; line-height: 1.06; letter-spacing: -.03em; text-wrap: balance; max-width: 420px; }
.auth-hero p { margin-top: 16px; max-width: 400px; font-size: 16px; line-height: 1.625; color: var(--rail-muted); }
.auth-note { position: relative; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--rail-muted); }
.auth-main { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px 20px; }
.auth-box { width: 100%; max-width: 400px; animation: auth-in 260ms var(--ease-out); }
@keyframes auth-in { from { opacity: 0; transform: translateX(18px); } }
.auth-mobile-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 32px; }
.auth-mobile-brand .brand-name { color: var(--ink); }
.auth-mobile-brand .brand-tag { color: var(--muted); }
.auth-title { font-size: 36px; font-weight: 600; line-height: 1.08; letter-spacing: -.026em; }
.auth-text { margin-top: 10px; margin-bottom: 28px; font-size: 14.5px; line-height: 1.6; color: var(--muted); }
.auth-row { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; font-size: 13px; }
.auth-row button { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 500; }
.auth-row button:hover { color: var(--ink); }
.auth-submit { margin-top: 28px; }
.auth-back { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 28px; font-size: 13.5px; font-weight: 500; color: var(--muted); }
.auth-back:hover { color: var(--ink); }
.auth-foot { margin-top: 20px; text-align: center; font-size: 13px; color: var(--muted); }
.auth-alert { margin-bottom: 20px; }

.otp { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.otp input { height: 56px; width: 100%; min-width: 0; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface);
  text-align: center; font-size: 22px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums;
  transition: border-color var(--t-base) ease, box-shadow var(--t-base) ease; }
.otp input:focus { border-color: var(--olive); box-shadow: var(--focus-ring); outline: none; }
.otp.is-invalid input { border-color: color-mix(in oklab, var(--danger) 50%, transparent); }
.otp.is-shaking { animation: shake 360ms ease; }
@keyframes shake { 20% { transform: translateX(-8px); } 40% { transform: translateX(7px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(2px); } }

.locked-tile { margin-bottom: 24px; }

/* Public link page */
.public { min-height: 100dvh; display: flex; flex-direction: column; background: var(--page); }
.public-bar { display: flex; align-items: center; gap: 10px; height: 64px; padding: 0 24px; border-bottom: 1px solid var(--line); background: var(--chrome); }
.public-main { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 32px 16px 48px; gap: 20px; }
.public-card { width: min(520px, 100%); padding: 28px; text-align: center; }
.public-card .tile { margin: 0 auto 16px; }
.public-card { min-width: 0; }
.public-name { overflow-wrap: anywhere; text-wrap: balance; }
/* PDF: almost the whole screen height (minus the top bar), so that a full A4 page fits. */
.public-preview.is-pdf { height: calc(100dvh - 64px - 24px); min-height: 560px; max-height: none; }
.public-preview { width: min(1100px, 100%); height: min(78vh, 900px); border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface);
  overflow: hidden; display: grid; place-items: center; }
.public-preview iframe { width: 100%; height: 100%; }
.public-preview img, .public-preview video { max-width: 100%; max-height: 100%; object-fit: contain; }
.public-preview .preview-text { border-radius: 0; height: 100%; max-width: none; }

@media (min-width: 1024px) { .auth-aside { display: flex; } .auth-mobile-brand { display: none; } }
@media (max-width: 639.98px) { .auth-title { font-size: 30px; } .otp { gap: 6px; } .otp input { height: 50px; font-size: 20px; } }
