/* ComSAS Agent sign-in. Faithful port of the Novigi login kit (no Tailwind runtime). */
:root {
  --novigi-blue: #0062FF;
  --novigi-blue-hover: #0042ab;
  --novigi-blue-active: #0048BD;
  --ease-brand: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-flip: cubic-bezier(0.32, 0.72, 0, 1);
}
*, *::before, *::after { box-sizing: border-box; }
html { font-size: clamp(0.86875rem, 0.71875rem + 0.234375vw, 1.09375rem); background: #000; }
body { margin: 0; font-family: Inter, system-ui, sans-serif; -webkit-font-smoothing: antialiased; color: #fff; background: #000; }

.shell {
  position: relative; min-height: 100vh; min-height: 100dvh; overflow: hidden; background: #000;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 2rem; padding-top: 9rem;
}
.bg { position: absolute; inset: 0; overflow: hidden; background: #000; }
.bg-poster, .bg-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.bg-video.is-failed { display: none; }
.bg-vignette { position: absolute; inset: 0; background: radial-gradient(ellipse at center, rgba(0,0,0,0.25) 0%, rgba(0,0,0,0.6) 100%); }

.brand { position: absolute; left: 0; right: 0; top: 0; z-index: 10; display: flex; flex-direction: column; align-items: center; gap: 1rem; padding: 4.5rem 1rem 0; text-align: center; }
.brand-logo { height: clamp(1.75rem, 3vw, 2.5rem); width: auto; animation: logo-in 0.9s var(--ease-brand) 0.45s both; }
.brand-title {
  margin: 0; color: var(--novigi-blue); font-family: Inter, system-ui, sans-serif; font-weight: 500;
  /* Kit uses 5rem/0.1em for a 5-letter mark; scale down for the longer name. */
  font-size: clamp(2.25rem, 7.2vw, 5rem); letter-spacing: 0.1em; line-height: 0.9;
  margin-right: -0.1em; /* optically recentre trailing tracking */
  text-wrap: balance;
  animation: title-in 1.1s var(--ease-brand) both;
}
@keyframes logo-in { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: none; } }
@keyframes title-in { from { opacity: 0; transform: translateY(24px); letter-spacing: 0.22em; } to { opacity: 1; transform: none; letter-spacing: 0.1em; } }

.stage { position: relative; z-index: 10; width: 100%; max-width: 28rem; }

.glass {
  border-radius: 1rem; border: 1px solid rgba(255,255,255,0.1); background: rgba(255,255,255,0.06);
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.6);
  -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px);
}
.pane-static { padding: 2rem; text-align: center; }
.pane-title { margin: 0; font-size: 1.125rem; font-weight: 600; color: #fff; }
.pane-text { margin: 0.5rem 0 0; font-size: 0.875rem; line-height: 1.5; color: #94a3b8; }

/* Flip card */
.flip-wrap { margin: 0 auto; width: 24rem; max-width: 100%; perspective: 75rem; }
.flip { position: relative; transform-style: preserve-3d; transition: transform 0.55s var(--ease-flip); }
.flip.is-open { transform: rotateY(180deg); }
.face { -webkit-backface-visibility: hidden; backface-visibility: hidden; }
.face-front {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  border-radius: 1rem; cursor: pointer; outline: none; -webkit-tap-highlight-color: transparent;
}
.face-front:focus-visible { box-shadow: 0 0 0 2px var(--novigi-blue); }
.front-label { font-size: 1.875rem; line-height: 2.25rem; font-weight: 600; letter-spacing: -0.025em; color: var(--novigi-blue); transition: text-shadow 0.3s; }
.face-front:hover .front-label, .face-front:focus-visible .front-label { text-shadow: 0 0 24px rgba(0,98,255,0.55); }
.flip.is-open .face-front { pointer-events: none; }
.face-back { transform: rotateY(180deg); padding: 1.5rem; display: flex; flex-direction: column; gap: 1rem; }
.flip:not(.is-open) .face-back { pointer-events: none; }

.pane-note { margin: 0; font-size: 0.875rem; line-height: 1.5; color: #94a3b8; text-align: center; }
.alert { border-radius: 0.5rem; padding: 0.75rem 1rem; font-size: 0.875rem; line-height: 1.5; }
.alert-error { border: 1px solid rgba(239,68,68,0.4); background: rgba(239,68,68,0.1); color: #fecaca; }

.btn-ms {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  height: 2.75rem; width: 100%; padding: 0 1rem; border-radius: 0.375rem;
  border: 1px solid var(--novigi-blue); background: var(--novigi-blue); color: #fff;
  font: 500 0.875rem/1 Inter, system-ui, sans-serif; text-decoration: none;
  transition: background-color 0.15s, border-color 0.15s; -webkit-tap-highlight-color: transparent;
}
.btn-ms:hover { background: var(--novigi-blue-hover); border-color: var(--novigi-blue-hover); }
.btn-ms:active { background: var(--novigi-blue-active); border-color: var(--novigi-blue-active); }
.btn-ms:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.ms-logo { width: 1rem; height: 1rem; flex: none; }

/* No JavaScript: show the sign-in pane flat, no flip. */
.no-js .flip { transform: none; }
.no-js .face-front { display: none; }
.no-js .face-back { transform: none; pointer-events: auto; }

@media (max-width: 480px) {
  .shell { padding: 1.25rem; padding-top: 9rem; }
  .brand { padding-top: 3.5rem; }
}
@media (prefers-reduced-motion: reduce) {
  .brand-logo, .brand-title { animation: none; }
  .flip { transition: none; }
  .front-label { transition: none; }
}
