/* ── Sign-in experience ───────────────────────────────────────────────── */
.auth {
  position: fixed;
  inset: calc(var(--inset) + 1px);
  z-index: 20;
  --pad: clamp(28px, 5vw, 64px);
  --side-pad: clamp(18px, 4vw, 48px);
  --w: calc(100vw - 2 * var(--inset) - 2px);
  --panel-w: min(430px, calc(0.45 * var(--w) - 2 * var(--side-pad)));
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(380px, 0.9fr);
  /* headline + (cards | panel) sit together, centred top to bottom */
  grid-template-rows: minmax(24px, 1fr) auto auto minmax(auto, 1fr);
  border-radius: var(--radius-frame);
  overflow: hidden auto;
}
/* the darker wash behind the panel runs the full height, under the headline too */
.auth::before { content: ''; grid-column: 2; grid-row: 1 / -1; background: linear-gradient(90deg, rgba(7, 7, 13, 0) 0%, rgba(7, 7, 13, 0.55) 30%); pointer-events: none; }
.auth.is-leaving .auth-panel { animation: unlock 0.7s var(--ease) both; }
.auth.is-leaving .auth-head > *, .auth.is-leaving .auth-hero > *, .auth.is-leaving .auth-brand { animation: fade-out 0.5s var(--ease) both; }
@keyframes unlock { 0% { transform: none; opacity: 1; } 40% { transform: scale(1.02); } 100% { transform: scale(0.94) translateY(10px); opacity: 0; filter: blur(6px); } }
@keyframes fade-out { to { opacity: 0; transform: translateY(-8px); } }

/* wordmark + headline, above the cards and the panel */
.auth-head { grid-column: 1 / -1; grid-row: 2; position: relative; z-index: 1; padding: 0 var(--pad) clamp(28px, 5vh, 52px); }
.auth-head .wordmark { width: 100%; filter: drop-shadow(0 12px 40px rgba(0, 0, 0, 0.6)); animation: rise 1s var(--ease) 0.1s both; }
.auth-head .wordmark-wrap { position: relative; width: min(400px, 60%); }
/* light sweep across the chrome letters only (masked by the wordmark itself) */
.auth-head .wordmark-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 0%, transparent 42%, rgba(255, 255, 255, 0.85) 50%, transparent 58%, transparent 100%) no-repeat;
  background-size: 250% 100%;
  background-position: 150% 0;
  -webkit-mask: url('../assets/silva-tender-wordmark.webp') center / 100% 100% no-repeat;
  mask: url('../assets/silva-tender-wordmark.webp') center / 100% 100% no-repeat;
  mix-blend-mode: soft-light;
  animation: sweep 3.2s var(--ease-io) 1.2s infinite;
}
@keyframes sweep { 0% { background-position: 150% 0; } 55%, 100% { background-position: -60% 0; } }
/* one line that ends no further right than the panel: the panel is centred in
   the right column (45% of the frame), and the text is ~25.4em wide */
.auth-head h1 { font-size: clamp(22px, calc((0.775 * var(--w) + var(--panel-w) / 2 - var(--pad)) / 25.6), 52px); font-weight: 400; line-height: 1.1; white-space: nowrap; margin-top: 26px; animation: rise 1s var(--ease) 0.25s both; }

/* feature cards, vertically centred against the panel */
.auth-hero { grid-column: 1; grid-row: 3; align-self: center; position: relative; padding: 0 var(--pad); }
.auth-feats { display: grid; gap: 10px; max-width: 520px; }
.auth-feat {
  display: flex;
  gap: 14px;
  align-items: center;
  width: 100%;
  padding: 12px 16px;
  border-radius: 16px;
  border: 1px solid var(--hair);
  background: rgba(10, 11, 18, 0.5);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  text-align: left;
  animation: rise 0.9s var(--ease) both;
  animation-delay: calc(0.45s + var(--i) * 0.12s);
}
.auth-feat .f-ic { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; flex-shrink: 0; background: color-mix(in srgb, var(--fc, var(--signal)) 13%, transparent); color: var(--fc, var(--signal)); transition: background-color var(--t-fast); }
.auth-feat .f-text { flex: 1; min-width: 0; }
.auth-feat strong { display: block; color: var(--steel-50); font-weight: 500; font-size: 15px; }
.auth-feat .f-text > span { display: block; color: var(--steel-400); font-size: 13.5px; margin-top: 2px; }
.auth-feat .f-go { flex-shrink: 0; display: grid; place-items: center; color: var(--fc, var(--signal)); opacity: 0; translate: -6px 0; transition: opacity var(--t-fast), translate var(--t) var(--ease); }
/* the rise animation owns `transform`, so the hover nudge uses `translate` */
.auth-feat.is-link { cursor: pointer; transition: border-color var(--t-fast), background-color var(--t-fast), translate var(--t) var(--ease); }
.auth-feat.is-link:hover,
.auth-feat.is-link:focus-visible,
.auth-feat.is-link.is-linked { border-color: color-mix(in srgb, var(--fc) 42%, transparent); background: rgba(22, 25, 38, 0.66); translate: 4px 0; }
.auth-feat.is-link:hover .f-ic,
.auth-feat.is-link:focus-visible .f-ic,
.auth-feat.is-link.is-linked .f-ic { background: color-mix(in srgb, var(--fc) 22%, transparent); }
.auth-feat.is-link:hover .f-go,
.auth-feat.is-link:focus-visible .f-go,
.auth-feat.is-link.is-linked .f-go { opacity: 1; translate: 0 0; }

.auth-brand { grid-column: 1; grid-row: 4; align-self: end; position: relative; z-index: 1; display: flex; align-items: center; gap: 10px; padding: 16px var(--pad) clamp(20px, 2.6vw, 32px); color: var(--steel-500); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; animation: fade 1s var(--ease) 1s both; }
.auth-brand img { width: 24px; }

.auth-side { grid-column: 2; grid-row: 3; position: relative; display: flex; padding: 0 var(--side-pad); }
.auth-panel {
  margin: auto;
  width: min(430px, 100%);
  padding: 30px 28px 24px;
  border-radius: 24px;
  border: 1px solid var(--hair-strong);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.015)), rgba(12, 13, 21, 0.82);
  backdrop-filter: blur(28px) saturate(1.2);
  -webkit-backdrop-filter: blur(28px) saturate(1.2);
  box-shadow: var(--shadow-3), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  animation: panel-in 0.9s var(--ease) 0.15s both;
  overflow: hidden;
}
@keyframes panel-in { from { opacity: 0; transform: translateY(18px) scale(0.98); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }
.auth-panel .wordmark-sm { display: none; }
.auth-body { transition: height var(--t) var(--ease); }
.auth-step { animation: step-in 0.45s var(--ease) both; }
@keyframes step-in { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
.auth-step.is-back { animation-name: step-back; }
@keyframes step-back { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; transform: none; } }
.auth-title { font-size: 25px; font-weight: 500; }
.auth-sub { color: var(--steel-400); font-size: 14.5px; margin-top: 6px; line-height: 1.5; }
.auth-sub strong { color: var(--steel-100); font-weight: 500; }
.auth-tabs { margin: 22px 0 20px; width: 100%; }
.auth-tabs .tab { flex: 1; justify-content: center; }
.auth-form { display: grid; gap: 14px; margin-top: 18px; }
.auth-form .btn-primary { margin-top: 4px; }
.auth-alt { display: grid; gap: 10px; margin-top: 16px; }
.auth-or { display: flex; align-items: center; gap: 12px; color: var(--steel-500); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; margin: 16px 0 4px; }
.auth-or::before, .auth-or::after { content: ''; flex: 1; height: 1px; background: var(--hair); }
.auth-msg { margin-top: 2px; }
.auth-foot { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--hair); display: flex; justify-content: center; gap: 6px; font-size: 13.5px; color: var(--steel-400); flex-wrap: wrap; text-align: center; }
.caps { font-size: 12px; color: var(--warn); display: flex; gap: 6px; align-items: center; }
.qr { display: grid; place-items: center; padding: 14px; border-radius: 16px; background: #f4f5f8; width: fit-content; margin: 6px auto; }
.qr img { width: 180px; height: 180px; image-rendering: pixelated; }
.secret { font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.08em; padding: 8px 10px; border-radius: 9px; background: var(--wash-strong); color: var(--steel-100); word-break: break-all; text-align: center; }
.success-mark { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; margin: 4px auto 14px; background: rgba(169, 203, 185, 0.14); color: var(--ok); animation: pop 0.6s var(--spring) both; }
.success-mark .icon { width: 30px; height: 30px; }

/* ── Welcome (no backend yet: the demo invitation) ────────────────────── */
.welcome { position: relative; }
.welcome::before { content: ''; position: absolute; z-index: -1; left: -28px; right: -28px; top: -30px; height: 210px; background: radial-gradient(75% 100% at 50% 0%, rgba(168, 184, 224, 0.15), transparent 72%); pointer-events: none; }
.welcome-badge { display: inline-flex; align-items: center; gap: 8px; height: 26px; padding: 0 11px 0 10px; border-radius: var(--r-full); font-size: 12px; font-weight: 500; letter-spacing: 0.02em; color: var(--steel-200); background: rgba(169, 203, 185, 0.08); border: 1px solid rgba(169, 203, 185, 0.26); }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); animation: live 2.2s var(--ease) infinite; }
@keyframes live { 0% { box-shadow: 0 0 0 0 rgba(169, 203, 185, 0.6); } 70%, 100% { box-shadow: 0 0 0 7px rgba(169, 203, 185, 0); } }
.welcome-title { margin-top: 16px; font-size: 31px; font-weight: 500; line-height: 1.12; letter-spacing: -0.01em; color: var(--steel-50); }
.welcome .auth-sub { margin-top: 8px; }
.tour { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
.tour-item {
  position: relative;
  display: grid;
  justify-items: start;
  gap: 12px;
  min-width: 0;
  padding: 13px 14px 12px;
  border-radius: 15px;
  border: 1px solid var(--hair);
  background: linear-gradient(160deg, color-mix(in srgb, var(--fc) 7%, transparent), transparent 60%), var(--wash);
  text-align: left;
  animation: rise 0.6s var(--ease) both;
  animation-delay: calc(0.3s + var(--i) * 70ms);
  transition: border-color var(--t-fast), background-color var(--t-fast), translate var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.tour-ic { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; color: var(--fc); background: color-mix(in srgb, var(--fc) 14%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--fc) 22%, transparent); transition: background-color var(--t-fast); }
.tour-ic .icon { width: 18px; height: 18px; }
.tour-name { max-width: 100%; font-size: 14px; font-weight: 500; color: var(--steel-100); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tour-go { position: absolute; top: 14px; right: 13px; color: var(--fc); opacity: 0; translate: -5px 0; transition: opacity var(--t-fast), translate var(--t) var(--ease); }
.tour-item:hover,
.tour-item:focus-visible,
.tour-item.is-linked { translate: 0 -2px; border-color: color-mix(in srgb, var(--fc) 45%, transparent); box-shadow: 0 14px 30px -18px color-mix(in srgb, var(--fc) 60%, transparent); }
.tour-item:hover .tour-ic,
.tour-item:focus-visible .tour-ic,
.tour-item.is-linked .tour-ic { background: color-mix(in srgb, var(--fc) 24%, transparent); }
.tour-item:hover .tour-go,
.tour-item:focus-visible .tour-go,
.tour-item.is-linked .tour-go { opacity: 1; translate: 0 0; }
.welcome-cta { margin-top: 18px; }
.welcome-note { display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 14px; font-size: 12.5px; color: var(--steel-500); }
.welcome-note .icon { width: 13px; height: 13px; }

/* short desktop windows: keep the headline, the cards and the panel on screen */
@media (max-height: 760px) and (min-width: 961px) {
  .auth { --pad: clamp(24px, 3.4vw, 44px); }
  .auth-head { padding-bottom: 24px; }
  .auth-head .wordmark-wrap { width: min(320px, 50%); }
  .auth-head h1 { margin-top: 16px; }
  .auth-feats { gap: 8px; }
  .auth-feat { padding: 9px 14px; }
  .auth-feat .f-ic { width: 32px; height: 32px; }
  .auth-feat .f-text > span { font-size: 13px; }
  .welcome-title { font-size: 27px; margin-top: 12px; }
  .tour { margin-top: 14px; }
  .tour-item { gap: 9px; padding: 10px 12px; }
  .tour-ic { width: 30px; height: 30px; }
}

@media (max-width: 960px) {
  .auth { grid-template-columns: 1fr; grid-template-rows: auto; overflow-y: auto; }
  .auth::before, .auth-head, .auth-hero, .auth-brand { display: none; }
  .auth-side { grid-column: 1; grid-row: auto; padding: calc(var(--safe-t) + 28px) clamp(18px, 4vw, 48px) 28px; }
  .auth-side .auth-panel { margin: 0 auto auto; }
  .auth-panel .wordmark-sm { display: block; width: min(250px, 70%); margin: 0 auto 22px; filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.6)); }
  .auth-panel { padding: 26px 20px 20px; }
}

/* ── Onboarding (create / join workspace) ─────────────────────────────── */
.onboard { width: min(560px, 100%); }
.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }
.choice {
  display: grid;
  gap: 8px;
  padding: 18px;
  border-radius: 16px;
  border: 1px solid var(--hair-strong);
  background: var(--wash);
  text-align: left;
  transition: border-color var(--t-fast), background-color var(--t-fast), transform var(--t) var(--ease);
}
.choice:hover { border-color: rgba(168, 184, 224, 0.45); background: rgba(168, 184, 224, 0.06); transform: translateY(-2px); }
.choice .c-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: rgba(168, 184, 224, 0.13); color: var(--signal); }
.choice strong { color: var(--steel-50); font-weight: 500; }
.choice span { color: var(--steel-400); font-size: 13.5px; }
@media (max-width: 560px) { .choice-grid { grid-template-columns: 1fr; } }
