/* =========================================================
   ComplyConstruct — converged login portal
   Palette + tokens mirror the landing page so the theme matches.
   ========================================================= */

:root {
  --navy-900: #0a1424;
  --navy-850: #0c1828;
  --navy-800: #0f1d33;
  --navy-700: #152741;
  --navy-600: #1c3257;

  --blue: #3b82f6;
  --blue-deep: #2563eb;
  --cyan: #22d3ee;

  --slate-500: #64748b;
  --slate-400: #94a3b8;
  --slate-300: #cbd5e1;
  --slate-100: #f1f5f9;
  --white: #ffffff;

  --line: rgba(255, 255, 255, 0.08);

  --radius: 18px;
  --radius-sm: 12px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  /* How far the badge sits below its final spot before rising. "Slight" move up. */
  --rise: 64px;

  --font-head: "Sora", -apple-system, system-ui, sans-serif;
  --font-body: "Inter", -apple-system, system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  color: var(--slate-300);
  background: var(--navy-900);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

/* ============ BUTTONS (copied from landing page) ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 15px;
  padding: 13px 24px;
  border-radius: 100px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), background 0.3s var(--ease), color 0.3s var(--ease);
  white-space: nowrap;
}
.btn--lg { padding: 16px 34px; font-size: 16px; }
.btn--primary {
  color: #06203a;
  background: linear-gradient(100deg, var(--blue) 0%, var(--cyan) 100%);
  box-shadow: 0 12px 30px -10px rgba(34, 211, 238, 0.55);
}
.btn--primary:hover { transform: translateY(-3px); box-shadow: 0 18px 38px -10px rgba(34, 211, 238, 0.7); }
.btn--primary:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }

/* ============ PORTAL STAGE ============ */
.portal {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  color: var(--white);
  background: radial-gradient(120% 100% at 80% -10%, #16315a 0%, var(--navy-900) 55%);
  overflow: hidden;
}

.portal__bg { position: absolute; inset: 0; pointer-events: none; }
.portal__grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: radial-gradient(120% 90% at 50% 30%, #000 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(120% 90% at 50% 30%, #000 30%, transparent 80%);
}
.portal__glow { position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.5; }
.portal__glow--1 { width: 520px; height: 520px; top: -140px; right: -90px; background: radial-gradient(circle, rgba(34, 211, 238, 0.5), transparent 65%); animation: glowFloat1 16s var(--ease) infinite alternate; }
.portal__glow--2 { width: 460px; height: 460px; bottom: -180px; left: -110px; background: radial-gradient(circle, rgba(59, 130, 246, 0.45), transparent 65%); animation: glowFloat2 20s var(--ease) infinite alternate; }

/* Soft glowing hue that breathes (and gently shifts hue) behind the logo. */
.portal__aura {
  position: absolute;
  left: 50%;
  top: 48%;
  transform: translate(-50%, -50%);
  width: min(74vw, 580px);
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.42), rgba(59, 130, 246, 0.16) 48%, transparent 70%);
  filter: blur(60px);
}

@keyframes glowFloat1 { from { transform: translate(0, 0); } to { transform: translate(-34px, 28px); } }
@keyframes glowFloat2 { from { transform: translate(0, 0); } to { transform: translate(30px, -26px); } }
@keyframes auraIn { to { opacity: 1; } }
@keyframes auraGlow {
  0%, 100% { transform: translate(-50%, -50%) scale(1);    filter: blur(58px) hue-rotate(0deg); }
  50%      { transform: translate(-50%, -50%) scale(1.14); filter: blur(66px) hue-rotate(22deg); }
}

.stage {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* ---- Logo group ---- */
.logo { display: flex; flex-direction: column; align-items: center; gap: 22px; }
.logo__badge { filter: drop-shadow(0 16px 36px rgba(34, 211, 238, 0.4)); }
.logo__badge svg { width: clamp(120px, 22vw, 168px); height: auto; }
.logo__word {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(40px, 8vw, 64px);
  letter-spacing: -0.02em;
  color: var(--white);
}
.logo__word span { color: var(--cyan); }

.logo__cta { margin-top: clamp(40px, 7vh, 64px); }

/* =========================================================
   Reveal sequence (only when JS is present so no-JS shows
   everything immediately). Badge fades in centred, rises
   slightly, then the wordmark and the Login button appear.
   ========================================================= */
.js .logo__badge {
  opacity: 0;
  transform: translateY(var(--rise)) scale(0.9);
  animation: badgeReveal 1.8s var(--ease) 0.2s forwards;
}
.js .logo__word {
  opacity: 0;
  animation: wordSwipe 0.85s var(--ease) 1.7s forwards;
}
.js .logo__cta {
  opacity: 0;
  transform: translateY(12px) scale(0.98);
  animation: ctaReveal 0.6s var(--ease) 2.6s forwards;
}
.js .portal__aura {
  opacity: 0;
  animation: auraIn 1.2s var(--ease) 0.3s forwards, auraGlow 7s ease-in-out 1.5s infinite;
}

@keyframes badgeReveal {
  0%   { opacity: 0; transform: translateY(var(--rise)) scale(0.9); }
  32%  { opacity: 1; transform: translateY(var(--rise)) scale(1); }  /* visible, centred */
  52%  { opacity: 1; transform: translateY(var(--rise)) scale(1); }  /* brief hold */
  100% { opacity: 1; transform: translateY(0) scale(1); }            /* risen into place */
}
@keyframes wordSwipe {
  0%   { opacity: 0; transform: translateX(-26px); clip-path: inset(0 100% 0 0); }
  100% { opacity: 1; transform: translateX(0);     clip-path: inset(0 0 0 0); }
}
@keyframes ctaReveal {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}

/* ============ MODAL ============ */
.modal { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 24px; }
.modal[hidden] { display: none; }

.modal__backdrop {
  position: absolute; inset: 0;
  background: rgba(5, 11, 22, 0.72);
  backdrop-filter: blur(6px);
  animation: modalFade 0.25s var(--ease);
}

.modal__card {
  position: relative;
  width: 100%;
  max-width: 392px;
  background: var(--navy-800);
  border: 1px solid var(--navy-700);
  border-radius: var(--radius);
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.7);
  padding: 30px 28px 26px;
  animation: modalPop 0.32s var(--ease);
}

.modal__close {
  position: absolute; top: 14px; right: 14px;
  display: grid; place-items: center;
  width: 34px; height: 34px;
  border: 0; border-radius: 10px;
  background: transparent;
  color: var(--slate-400);
  cursor: pointer;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.modal__close:hover { background: rgba(255, 255, 255, 0.06); color: var(--white); }

.modal__head { text-align: center; margin-bottom: 22px; }
.modal__badge { display: inline-grid; place-items: center; margin-bottom: 14px; filter: drop-shadow(0 8px 18px rgba(34, 211, 238, 0.3)); }
.modal__head h1 { font-family: var(--font-head); font-weight: 700; font-size: 22px; color: var(--white); letter-spacing: -0.02em; }
.modal__head p { font-size: 14px; color: var(--slate-400); margin-top: 4px; }

.modal__form { display: grid; gap: 16px; }
.field { display: grid; gap: 7px; }
.field__row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.field label { font-size: 12px; font-weight: 500; color: var(--slate-400); }
.field__link { font-size: 12px; font-weight: 500; color: var(--cyan); }
.field__link:hover { color: var(--white); }

.field input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--navy-700);
  background: var(--navy-900);
  color: var(--slate-100);
  font-family: var(--font-body);
  font-size: 14px;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.field input::placeholder { color: var(--slate-500); }
.field input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.modal__submit { width: 100%; margin-top: 4px; }

.modal__status { min-height: 0; font-size: 13px; color: var(--cyan); text-align: center; }
.modal__status:empty { display: none; }

/* ============ REDUCED MOTION ============ */
@media (prefers-reduced-motion: reduce) {
  .js .logo__badge, .js .logo__word, .js .logo__cta, .js .portal__aura {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  .js .portal__aura { transform: translate(-50%, -50%) !important; }
  .portal__glow--1, .portal__glow--2 { animation: none !important; }
  .modal__backdrop, .modal__card { animation: none !important; }
}

@keyframes modalFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalPop {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}
