/*
 * SignHub design system — approved D2 tokens and components.
 * Violet accent, no teal/green. Light theme only (live call is the
 * one dark screen and has its own styles).
 */
:root {
	--sh-ink: #241933;
	--sh-ink-soft: #6E647E;
	--sh-paper: #F7F5FB;
	--sh-card: #FFFFFF;
	--sh-line: #EAE6F2;
	--sh-neutral: #EFECF4;
	--sh-violet: #DCD2F7;
	--sh-violet-deep: #5B3FA0;
	--sh-violet-text: #3E2A73;
	--sh-amber: #F6A93E;
	--sh-amber-deep: #7A4E0A;
	--sh-amber-text: #5C3A05;
	--sh-pink: #F6BFD4;
	--sh-pink-deep: #8C3A5B;
	--sh-ink-btn: #1C1526;
	--sh-danger: #A5482F;
	--sh-danger-tint: rgba(200, 93, 69, 0.14);
	--sh-t-violet: rgba(92, 63, 160, 0.12);
	--sh-t-amber: rgba(246, 169, 62, 0.2);
	--sh-t-pink: rgba(246, 191, 212, 0.35);
	--sh-shadow: rgba(36, 25, 51, 0.1);
	--sh-font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
	color-scheme: light;
}

.sh-body { margin: 0; background: var(--sh-paper); color: var(--sh-ink); font-family: var(--sh-font); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
.sh-body *, .sh-body *::before, .sh-body *::after { box-sizing: border-box; min-width: 0; }
.sh-body h1, .sh-body h2, .sh-body h3, .sh-body h4 { margin: 0; font-weight: 800; letter-spacing: -0.01em; text-wrap: balance; }
.sh-body p { margin: 0; }
.sh-body a { color: var(--sh-ink); font-weight: 800; }
.sh-body :focus-visible { outline: 3px solid var(--sh-violet-deep); outline-offset: 2px; }
.sh-i { display: inline-flex; width: 18px; height: 18px; flex-shrink: 0; }
.sh-i svg { width: 100%; height: 100%; display: block; }
.sh-body [hidden] { display: none !important; }
.sh-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- auth pages ---------- */
.sh-auth { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 32px 16px; }
.sh-auth-card { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 14px; }
.sh-auth-head { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; margin-bottom: 6px; }
.sh-auth-head h1 { font-size: 1.45rem; margin-top: 10px; }
.sh-auth-head p { color: var(--sh-ink-soft); font-weight: 600; font-size: 0.9rem; max-width: 32ch; }
.sh-mark { width: 58px; height: 58px; border-radius: 18px; background: linear-gradient(155deg, var(--sh-amber), var(--sh-pink-deep)); display: flex; align-items: center; justify-content: center; color: #fff; overflow: hidden; }
.sh-mark img { width: 100%; height: 100%; object-fit: contain; }
/* Uploaded logo: its own full shape, no box or background. */
.sh-auth-logo { display: flex; justify-content: center; margin-bottom: 4px; }
.sh-auth-logo .sh-logo img { max-height: 90px; max-width: min(325px, 85vw); } /* 25% bigger than before (owner 2026-10-15). */
.sh-logo { display: flex; align-items: center; justify-content: center; animation: sh-pop 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.sh-logo img { display: block; max-width: min(260px, 80vw); max-height: 96px; width: auto; height: auto; }
.sh-mark .sh-i { width: 26px; height: 26px; }
.sh-badge-ic { width: 66px; height: 66px; border-radius: 20px; display: flex; align-items: center; justify-content: center; background: var(--sh-violet); color: var(--sh-violet-text); }
.sh-badge-ic .sh-i { width: 30px; height: 30px; }
.sh-badge-ic.is-amber { background: var(--sh-amber); color: var(--sh-amber-text); }
.sh-badge-ic.is-danger { background: var(--sh-danger-tint); color: var(--sh-danger); }
.sh-foot { text-align: center; font-size: 0.86rem; color: var(--sh-ink-soft); font-weight: 600; }
.sh-right { text-align: right; font-size: 0.84rem; }
.sh-right a { color: var(--sh-ink-soft); }

/* ---------- form fields (icon-paired, approved "modern field") ---------- */
.sh-field { display: flex; align-items: center; gap: 12px; background: var(--sh-card); border: 1.5px solid var(--sh-line); border-radius: 14px; padding: 10px 14px; }
.sh-field:focus-within { border-color: var(--sh-violet-deep); box-shadow: 0 0 0 3px rgba(92, 63, 160, 0.14); }
.sh-field.is-error { border-color: var(--sh-danger); }
.sh-field.is-locked { background: var(--sh-paper); }
.sh-field .sh-fi { width: 38px; height: 38px; border-radius: 11px; background: var(--sh-t-violet); color: var(--sh-violet-deep); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.sh-field .sh-fb { flex: 1; min-width: 0; }
.sh-field label { display: block; font-size: 0.66rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.03em; color: var(--sh-ink-soft); margin-bottom: 2px; }
.sh-field input { border: none; outline: none; width: 100%; padding: 0; font: inherit; font-size: 0.95rem; font-weight: 600; color: var(--sh-ink); background: transparent; }
.sh-field input::placeholder { color: #B3ABBF; }
.sh-hint { font-size: 0.78rem; color: var(--sh-ink-soft); font-weight: 600; padding-left: 4px; }
.sh-err { font-size: 0.8rem; font-weight: 700; color: var(--sh-danger); padding-left: 4px; }
.sh-label { font-size: 0.72rem; font-weight: 800; color: var(--sh-ink-soft); text-transform: uppercase; letter-spacing: 0.04em; }
.sh-upload { display: flex; align-items: center; gap: 12px; border: 1.5px dashed var(--sh-line); background: var(--sh-card); border-radius: 14px; padding: 12px 14px; cursor: pointer; }
.sh-upload input[type=file] { font: inherit; font-size: 0.8rem; max-width: 100%; }
.sh-check { display: flex; align-items: center; gap: 8px; font-size: 0.86rem; font-weight: 600; color: var(--sh-ink-soft); }
.sh-check input { width: 18px; height: 18px; accent-color: var(--sh-violet-deep); }

/* ---------- role / choice pills ---------- */
.sh-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.sh-pill { position: relative; }
.sh-pill input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.sh-pill span { display: inline-block; border: 1.5px solid var(--sh-line); background: var(--sh-card); color: var(--sh-ink); padding: 9px 16px; border-radius: 999px; font-size: 0.86rem; font-weight: 700; }
.sh-pill input:checked + span { background: var(--sh-violet-deep); border-color: var(--sh-violet-deep); color: #fff; }
.sh-pill input:focus-visible + span { outline: 3px solid var(--sh-violet-deep); outline-offset: 2px; }

/* ---------- code boxes ---------- */
.sh-otp { width: 100%; text-align: center; letter-spacing: 0.5em; font: inherit; font-size: 1.7rem; font-weight: 800; padding: 14px 10px 14px 20px; border-radius: 16px; border: 2px solid var(--sh-violet-deep); background: var(--sh-card); color: var(--sh-ink); font-variant-numeric: tabular-nums; }
.sh-otp:focus { outline: none; box-shadow: 0 0 0 4px rgba(92, 63, 160, 0.15); }

/* ---------- buttons ---------- */
.sh-btn { border: none; border-radius: 999px; padding: 14px 18px; font: inherit; font-weight: 800; font-size: 0.92rem; display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; cursor: pointer; text-decoration: none; }
.sh-btn-dark { background: var(--sh-ink-btn); color: #fff !important; }
.sh-btn-outline { background: var(--sh-card); border: 1.5px solid var(--sh-line); color: var(--sh-ink) !important; }
.sh-btn-danger { background: var(--sh-danger); color: #fff !important; }
.sh-btn-link { background: none; border: none; padding: 4px; color: var(--sh-ink); font: inherit; font-weight: 800; text-decoration: underline; cursor: pointer; }
.sh-btn[disabled] { opacity: 0.4; cursor: not-allowed; }

/* ---------- banners and status ---------- */
.sh-banner { border-radius: 14px; padding: 11px 14px; display: flex; gap: 10px; align-items: flex-start; font-size: 0.86rem; font-weight: 700; }
.sh-banner .sh-i { margin-top: 1px; }
.sh-banner.is-info { background: var(--sh-t-violet); color: var(--sh-violet-text); }
.sh-banner.is-error { background: var(--sh-danger-tint); color: var(--sh-danger); }
.sh-banner.is-warn { background: var(--sh-t-amber); color: var(--sh-amber-text); }
.sh-status { display: inline-block; font-size: 0.66rem; font-weight: 800; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.sh-status.is-ok { background: var(--sh-t-violet); color: var(--sh-violet-deep); }
.sh-status.is-pending { background: var(--sh-t-amber); color: var(--sh-amber-deep); }
.sh-status.is-error { background: var(--sh-danger-tint); color: var(--sh-danger); }
.sh-status.is-past { background: var(--sh-line); color: var(--sh-ink-soft); }

/* ---------- device screen ---------- */
.sh-device { display: flex; align-items: center; gap: 12px; background: var(--sh-card); border: 1.5px solid var(--sh-line); border-radius: 16px; padding: 12px 14px; }
.sh-device.is-new { border-color: var(--sh-violet-deep); }
.sh-device .sh-di { width: 42px; height: 42px; border-radius: 12px; background: var(--sh-neutral); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.sh-device .sh-dt { flex: 1; min-width: 0; }
.sh-device b { display: block; font-size: 0.9rem; }
.sh-device small { color: var(--sh-ink-soft); font-weight: 600; font-size: 0.76rem; }
.sh-dots { display: flex; gap: 6px; justify-content: center; }
.sh-dots span { width: 36px; height: 8px; border-radius: 999px; background: var(--sh-line); }
.sh-dots span.is-used { background: var(--sh-violet-deep); }

@media (prefers-reduced-motion: reduce) {
	.sh-body *, .sh-body *::before, .sh-body *::after { transition: none !important; animation: none !important; }
}

/* ==================================================================
 * Motion (owner request 2026-09-25): small, quick, purposeful.
 * Everything below is switched off by prefers-reduced-motion above.
 * ================================================================== */
@keyframes sh-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes sh-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes sh-pop { 0% { transform: scale(0.85); opacity: 0; } 70% { transform: scale(1.04); opacity: 1; } 100% { transform: scale(1); } }
@keyframes sh-shake { 0%, 100% { transform: translateX(0); } 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
@keyframes sh-drop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* Auth pages: card rises in, pieces follow one after another. */
.sh-auth-card > * { animation: sh-rise 0.45s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.sh-auth-card > *:nth-child(2) { animation-delay: 0.05s; }
.sh-auth-card > *:nth-child(3) { animation-delay: 0.1s; }
.sh-auth-card > *:nth-child(4) { animation-delay: 0.15s; }
.sh-auth-card > *:nth-child(5) { animation-delay: 0.2s; }
.sh-auth-card > *:nth-child(n+6) { animation-delay: 0.25s; }
.sh-mark, .sh-badge-ic { animation: sh-pop 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) both; }

/* Buttons respond to hover and press. */
.sh-btn { transition: transform 0.12s ease, box-shadow 0.2s ease, filter 0.2s ease, background-color 0.2s ease, border-color 0.2s ease; }
.sh-btn:active:not([disabled]) { transform: scale(0.97); }
@media (hover: hover) {
	.sh-btn-dark:hover:not([disabled]) { box-shadow: 0 8px 20px rgba(28, 21, 38, 0.25); filter: brightness(1.15); }
	.sh-btn-outline:hover:not([disabled]) { border-color: var(--sh-ink-soft); }
	.sh-btn-danger:hover:not([disabled]) { box-shadow: 0 8px 20px rgba(165, 72, 47, 0.25); }
}

/* Fields, pills and choices ease between states. */
.sh-field { transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease; }
.sh-field .sh-fi { transition: transform 0.2s ease, background-color 0.2s ease; }
.sh-field:focus-within .sh-fi { transform: scale(1.06); background: var(--sh-violet); }
.sh-pill span { transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.12s ease; }
.sh-pill input:active + span { transform: scale(0.96); }
.sh-otp { transition: border-color 0.2s ease, box-shadow 0.2s ease; }

/* Messages slide in; a wrong code shakes the field. */
.sh-banner { animation: sh-drop 0.3s ease both; }
.sh-err { animation: sh-fade 0.25s ease both; }
.sh-shake { animation: sh-shake 0.4s ease both; border-color: var(--sh-danger); }
.sh-field.is-error { animation: sh-shake 0.4s ease both; }

/* Accept invite: organization badge (Phase 8). */
.sh-invite-org { width: 64px; height: 64px; border-radius: 20px; display: flex; align-items: center; justify-content: center; overflow: hidden; background: var(--sh-violet); color: var(--sh-violet-text); font-size: 28px; font-weight: 800; }
.sh-invite-org.is-amber { background: var(--sh-amber); color: var(--sh-amber-text); }
.sh-invite-org.is-pink { background: var(--sh-pink); color: var(--sh-pink-deep); }
.sh-invite-org img { width: 100%; height: 100%; object-fit: cover; }
/* Public sign spot page (QR code). */
.sh-signspot-video { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: 18px; overflow: hidden; background: #1C1526; margin: 6px 0 14px; }
.sh-signspot-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
/* Continue with Google (owner 2026-10-04). */
.sh-btn-google { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; background: #fff; color: var(--sh-ink); border: 1.5px solid var(--sh-line); text-decoration: none; }
.sh-btn-google:hover { border-color: var(--sh-ink-soft); }
.sh-or { display: flex; align-items: center; gap: 12px; margin: 14px 0 4px; color: var(--sh-ink-soft); font-weight: 700; font-size: 0.8rem; }
.sh-or::before, .sh-or::after { content: ""; flex: 1; height: 1px; background: var(--sh-line); }

/* ---------- form builder forms (/form/{slug}/, owner 2026-10-06) ---------- */
.sh-auth-card.is-wide { max-width: 600px; }
.sh-auth-card.is-wide .sh-auth-head p { max-width: 52ch; }
.sh-ff { display: flex; flex-direction: column; gap: 16px; }
.sh-ff-step { border: 0; margin: 0; padding: 0; min-width: 0; }
.sh-ff-steptitle { font-size: 0.72rem; font-weight: 800; color: var(--sh-violet-deep); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 12px; padding: 0; }
.sh-ff-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.sh-q { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.sh-q.is-half { grid-column: span 1; }
@media (max-width: 520px) { .sh-q.is-half { grid-column: 1 / -1; } }
.sh-q[hidden] { display: none; }
.sh-ff-label { font-size: 0.9rem; font-weight: 800; color: var(--sh-ink); padding: 0; }
.sh-req { color: var(--sh-danger); font-style: normal; }
.sh-ff-group { border: 0; margin: 0; padding: 0; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.sh-in { width: 100%; box-sizing: border-box; background: var(--sh-card); border: 1.5px solid var(--sh-line); border-radius: 14px; padding: 12px 14px; font: inherit; font-size: 0.95rem; font-weight: 600; color: var(--sh-ink); outline: none; }
.sh-in:focus { border-color: var(--sh-violet-deep); box-shadow: 0 0 0 3px rgba(92, 63, 160, 0.14); }
textarea.sh-in { resize: vertical; min-height: 96px; }
select.sh-in { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--sh-ink-soft) 50%), linear-gradient(135deg, var(--sh-ink-soft) 50%, transparent 50%); background-position: calc(100% - 20px) 52%, calc(100% - 15px) 52%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
.sh-q.is-error .sh-in, .sh-q.is-error .sh-upload, .sh-q.is-error .sh-choice span { border-color: var(--sh-danger); }
.sh-choices { display: flex; flex-direction: column; gap: 8px; }
.sh-choice { position: relative; display: block; cursor: pointer; }
.sh-choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.sh-choice span { display: flex; align-items: center; gap: 10px; border: 1.5px solid var(--sh-line); background: var(--sh-card); border-radius: 14px; padding: 11px 14px; font-size: 0.92rem; font-weight: 700; color: var(--sh-ink); transition: background-color 0.18s ease, border-color 0.18s ease; }
.sh-choice span::before { content: ""; width: 18px; height: 18px; flex-shrink: 0; border: 2px solid #B3ABBF; border-radius: 50%; box-sizing: border-box; background: #fff; }
.sh-choice input[type=checkbox] + span::before { border-radius: 6px; }
.sh-choice input:checked + span { border-color: var(--sh-violet-deep); background: var(--sh-t-violet); }
.sh-choice input:checked + span::before { border-color: var(--sh-violet-deep); background: var(--sh-violet-deep); box-shadow: inset 0 0 0 3px #fff; }
.sh-choice input[type=checkbox]:checked + span::before { box-shadow: none; background: var(--sh-violet-deep) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/12px no-repeat; }
.sh-choice input:focus-visible + span { outline: 3px solid var(--sh-violet-deep); outline-offset: 2px; }
.sh-choice.is-consent span { font-weight: 600; }
.sh-ff-h { font-size: 1.05rem; font-weight: 800; margin: 6px 0 0; }
.sh-ff-p { color: var(--sh-ink-soft); font-weight: 600; font-size: 0.88rem; margin: 0; }
.sh-ff-upic { width: 38px; height: 38px; border-radius: 11px; background: var(--sh-t-violet); color: var(--sh-violet-deep); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.sh-ff-progress { display: none; }
.sh-ff.is-js .sh-ff-progress { display: flex; flex-direction: column; gap: 10px; }
.sh-ff-dots { display: flex; gap: 6px; }
.sh-ff-dot { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.sh-ff-dot b { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.8rem; background: var(--sh-card); border: 1.5px solid var(--sh-line); color: var(--sh-ink-soft); }
.sh-ff-dot small { font-size: 0.7rem; font-weight: 700; color: var(--sh-ink-soft); text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.sh-ff-dot.is-on b { background: var(--sh-amber); border-color: var(--sh-amber); color: var(--sh-amber-text); }
.sh-ff-dot.is-done b { background: var(--sh-violet-deep); border-color: var(--sh-violet-deep); color: #fff; }
.sh-ff-dot.is-on small { color: var(--sh-ink); }
.sh-ff-bar { height: 6px; border-radius: 999px; background: var(--sh-line); overflow: hidden; }
.sh-ff-bar i { display: block; height: 100%; background: var(--sh-violet-deep); border-radius: 999px; transition: width 0.3s ease; }
.sh-ff-nav { display: flex; gap: 10px; }
.sh-ff-nav .sh-btn[hidden] { display: none; }
.sh-btn-ghost { background: var(--sh-card); color: var(--sh-ink); border: 1.5px solid var(--sh-line); }
.sh-ff-done { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; padding: 18px 8px; font-weight: 600; }
@media (prefers-reduced-motion: reduce) { .sh-ff-bar i, .sh-choice span { transition: none; } }

/* Privacy agreement (owner 2026-10-06): the "I agree" box on sign-up and in the app. */
.sh-agree { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: 16px; border: 1px solid var(--sh-line); background: var(--sh-card); font-weight: 600; cursor: pointer; }
.sh-agree input { width: 22px; height: 22px; margin: 0; accent-color: var(--sh-violet-deep); flex-shrink: 0; }
.sh-agree a { color: var(--sh-violet-deep); font-weight: 800; }
.sh-privacy h3 { margin-top: 0; }
.sh-privacy h4 { margin: 14px 0 6px; }
.sh-privacy ul { padding-left: 20px; margin: 0; }
.sh-privacy li { margin: 4px 0; }
.sh-privacy-gate { display: flex; flex-direction: column; gap: 12px; }

/* Phone numbers with a country list (owner 2026-10-07). */
.sh-phone { display: flex; align-items: center; gap: 8px; width: 100%; }
.sh-phone-cc { flex: 0 0 auto; width: 104px; min-height: 36px; border: 1.5px solid var(--sh-line); border-radius: 10px; background: var(--sh-paper); color: var(--sh-ink); font: inherit; font-weight: 700; font-size: 0.86rem; padding: 0 6px; cursor: pointer; }
.sh-phone-cc:focus-visible { outline: 3px solid var(--sh-violet-deep); outline-offset: 1px; }
.sh-phone input { flex: 1; min-width: 0; }

/* Login page: install the app (owner 2026-10-15). */
.sh-install { display: flex; align-items: center; gap: 12px; margin-top: 18px; padding: 14px; border-radius: 18px; background: var(--sh-violet, #DCD2F7); color: var(--sh-ink, #241933); }
.sh-install[hidden] { display: none; }
.sh-install-ic { flex: 0 0 40px; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 12px; background: #fff; color: var(--sh-violet-deep, #5B3FA0); }
.sh-install-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; text-align: left; }
.sh-install-txt small { color: #4A3F5C; line-height: 1.35; }
.sh-install-steps { margin: 6px 0 0; padding-left: 18px; font-size: 13px; line-height: 1.4; }
p.sh-install-steps { padding-left: 0; }
.sh-install-btn { flex: 0 0 auto; width: auto; padding: 10px 18px; }
