/* auth.css — sign-in / create-account / verify overlay. It floats over whatever
   screen is open (the app shell stays visible behind a dimmed, blurred scrim)
   instead of replacing the page. Reads the --sv-* tokens, so the active theme
   (html[data-sv-theme], see deep-ink.css) retints it. */

#sv-auth { position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center;
  padding: max(20px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  overflow-y: auto; scrollbar-width: none; color: var(--sv-text); font-family: var(--sv-font-body); }
#sv-auth::-webkit-scrollbar { display: none; }
#sv-auth[hidden], #sv-auth .sva-close[hidden], #sv-auth .sva-tabs[hidden], #sv-auth .sva-guest-row[hidden] { display: none; }
.sva-scrim { position: fixed; inset: 0; background: radial-gradient(ellipse at 50% 45%, rgba(var(--sv-ground-rgb),.45), rgba(var(--sv-ground-rgb),.82) 75%);
  -webkit-backdrop-filter: blur(6px) saturate(.85); backdrop-filter: blur(6px) saturate(.85); animation: sva-fade var(--sv-t-med) ease both; }

/* the card: square codex frame with a double inset border and gem corners */
.sva-card { position: relative; width: min(420px, 100%); margin: auto; padding: 34px 34px 28px; box-sizing: border-box;
  background: linear-gradient(180deg, var(--sv-panel-strong, rgba(var(--sv-plum-rgb),.78)), rgba(var(--sv-ground-rgb),.94));
  border: 1px solid var(--sv-line-strong); box-shadow: var(--sv-card-inset), var(--sv-shadow-pop), 0 0 80px -30px var(--sv-violet);
  animation: sva-rise .45s var(--sv-ease-out) both; }
.sva-gem { position: absolute; width: 7px; height: 7px; transform: rotate(45deg); background: var(--sv-violet-bright); box-shadow: 0 0 10px var(--sv-violet-bright); }
.sva-gem--tl { top: -4px; left: -4px; } .sva-gem--tr { top: -4px; right: -4px; }
.sva-gem--bl { bottom: -4px; left: -4px; } .sva-gem--br { bottom: -4px; right: -4px; }
.sva-close { position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; display: grid; place-items: center; padding: 0;
  border: 1px solid transparent; border-radius: var(--sv-r-pill); background: none; cursor: pointer; color: var(--sv-text-dim); font-size: 18px; line-height: 1;
  transition: color var(--sv-t-fast), border-color var(--sv-t-fast); }
.sva-close:hover { color: var(--sv-text); border-color: var(--sv-line-2); }
.sva-close:focus-visible { outline: none; box-shadow: var(--sv-glow-focus); }

.sva-head { text-align: center; margin-bottom: 22px; }
.sva-eyebrow { font-family: var(--sv-font-mono); font-size: 10px; letter-spacing: .32em; text-transform: uppercase; color: var(--sv-violet); }
.sva-title { margin: 10px 0 6px; font-family: var(--sv-font-display); font-weight: 600; font-size: clamp(22px, 2.2vw, 28px); line-height: 1.15; letter-spacing: .04em;
  background: linear-gradient(110deg, var(--sv-violet) 20%, #ffffff 45%, var(--sv-violet-bright) 55%, var(--sv-violet-deep) 80%); background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; animation: sv-home-sheen 7s linear infinite; }
.sva-sub { margin: 0; font-size: 17px; font-style: italic; color: var(--sv-text-muted); }
.sva-sub b { font-style: normal; font-weight: 600; color: var(--sv-text-soft); }

/* Sign in | Create account switch (hidden on the verify step) */
.sva-tabs { display: grid; grid-template-columns: 1fr 1fr; margin: 0 0 22px; border: 1px solid var(--sv-line-2); border-radius: var(--sv-r-sm); overflow: hidden; }
.sva-tab { padding: 10px 8px; border: 0; background: transparent; cursor: pointer; font-family: var(--sv-font-mono); font-size: 10px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--sv-text-dim); transition: color var(--sv-t-fast), background var(--sv-t-fast); }
.sva-tab + .sva-tab { border-left: 1px solid var(--sv-line-2); }
.sva-tab:hover { color: var(--sv-text); }
.sva-tab[aria-selected="true"] { background: var(--sv-fill-hover); color: var(--sv-violet-bright); }
.sva-tab:focus-visible { outline: none; box-shadow: inset var(--sv-glow-focus); }

.sva-pane[hidden] { display: none; }
.sva-field { margin-bottom: 14px; }
.sva-field .sv-input { font-size: 17px; padding: 11px 14px; }
.sva-hint { margin: 6px 2px 0; font-family: var(--sv-font-mono); font-size: 9.5px; letter-spacing: .08em; color: var(--sv-text-dim); }
.sva-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 2px 0 18px; }
.sva-check { display: inline-flex; align-items: flex-start; gap: 9px; cursor: pointer; font-family: var(--sv-font-mono); font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--sv-text-muted); }
.sva-check--prose { font-family: var(--sv-font-body); font-size: 15.5px; letter-spacing: 0; text-transform: none; line-height: 1.35; margin: 4px 0 16px; }
.sva-check input { appearance: none; flex: 0 0 auto; width: 16px; height: 16px; margin: 0; border: 1px solid var(--sv-line-strong); border-radius: 4px; background: rgba(var(--sv-ground-rgb),.6);
  display: inline-grid; place-items: center; cursor: pointer; }
.sva-check--prose input { margin-top: 2px; }
.sva-check input::before { content: ""; width: 8px; height: 8px; transform: rotate(45deg) scale(0); background: var(--sv-violet-bright); transition: transform var(--sv-t-fast) var(--sv-ease-spring); }
.sva-check input:checked::before { transform: rotate(45deg) scale(1); }
.sva-check input:focus-visible { outline: none; box-shadow: var(--sv-glow-focus); }
/* beat the app-wide input[type="checkbox"] skin (styles.css): violet gem, not an accent tick */
#sv-auth .sva-check input[type="checkbox"] { width: 16px; height: 16px; border: 1px solid var(--sv-line-strong); background: rgba(var(--sv-ground-rgb),.6); box-shadow: none; outline: none; }
#sv-auth .sva-check input[type="checkbox"]:checked { background: rgba(var(--sv-ground-rgb),.6); border-color: var(--sv-line-hover); box-shadow: 0 0 12px -4px var(--sv-violet-bright); }
#sv-auth .sva-check input[type="checkbox"]:checked::after { content: none; }
#sv-auth .sva-check input[type="checkbox"]:focus-visible { box-shadow: var(--sv-glow-focus); }
.sva-link { font-family: var(--sv-font-mono); font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--sv-violet-bright); text-decoration: none; background: none; border: 0; padding: 0; cursor: pointer; }
.sva-link:hover { color: var(--sv-text); }
.sva-link:disabled { opacity: .45; cursor: default; }

.sva-msg { margin: 0 0 14px; padding: 9px 12px; border: 1px solid rgba(220,90,78,.45); background: rgba(220,90,78,.1); color: #f0a399; font-size: 15.5px; line-height: 1.35; }
.sva-msg.is-ok { border-color: rgba(147,181,111,.45); background: rgba(147,181,111,.1); color: #bcd69f; }
.sva-msg[hidden] { display: none; }
.sva-msg b { letter-spacing: .12em; }

.sva-card .sv-btn { width: 100%; }
.sva-or { display: flex; align-items: center; gap: 12px; margin: 16px 0 12px; font-family: var(--sv-font-mono); font-size: 9.5px; letter-spacing: .24em; text-transform: uppercase; color: var(--sv-text-dim); }
.sva-or::before, .sva-or::after { content: ""; flex: 1; height: 1px; background: var(--sv-line-2); }
.sva-google[hidden], .sva-or[hidden] { display: none; }

/* six-rune verification code */
.sva-code { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin: 4px 0 18px; }
.sva-code .sv-input { padding: 12px 0; text-align: center; font-family: var(--sv-font-display); font-size: 22px; font-weight: 600; color: var(--sv-violet-bright); }
.sva-code.is-shaking { animation: sva-shake .38s ease; }
.sva-foot { margin: 16px 0 0; text-align: center; font-size: 16px; color: var(--sv-text-muted); }
.sva-guest-row { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--sv-line-soft); }
.sva-guest-row .sva-link { color: var(--sv-text-muted); }
.sva-guest-row .sva-link:hover { color: var(--sv-violet-bright); }

@keyframes sva-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes sva-rise { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes sva-shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
@media (prefers-reduced-motion: reduce) { .sva-scrim, .sva-card, .sva-code.is-shaking, .sva-title { animation: none; } }
@media (max-width: 430px) {
  .sva-card { padding: 28px 20px 22px; }
  .sva-code { gap: 6px; }
}
