/* ============================================================
   IRIS — Login
   Matches the app's design language (atmospheric near-black,
   Inter, brand emerald + glow), turned up: aurora backdrop,
   glass card with animated hairline, staggered entrance,
   pointer-reactive glow. All motion is reduced-motion aware.
   ============================================================ */

@property --angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

:root {
  color-scheme: dark;

  /* Refined neutrals — cooler than stock zinc (mirrors the app) */
  --zinc-100: #f4f4f5;
  --zinc-200: #e4e4e7;
  --zinc-400: #a1a1aa;
  --zinc-500: #71717a;

  /* IRIS brand emerald */
  --emerald-200: #a7f3d0;
  --emerald-300: #6ee7b7;
  --emerald-400: #34d399;
  --emerald-500: #10b981;
  --emerald-600: #059669;
  --emerald-700: #047857;

  /* Atmospheric surfaces */
  --bg-app:    #07070a;
  --bg-layer2: #111118;
  --bg-layer3: #161620;
  --border-soft: #1f1f29;
  --border:      #2a2a36;

  /* Brand glow + elevation (from the app's token set) */
  --glow-emerald: 0 0 0 1px rgba(16,185,129,.30), 0 12px 40px -12px rgba(16,185,129,.34);
  --shadow-card: 0 1px 0 rgba(255,255,255,.03) inset,
                 0 2px 4px rgba(0,0,0,.45),
                 0 24px 70px -24px rgba(0,0,0,.8);

  --radius:    12px;
  --radius-lg: 18px;
  --radius-xl: 24px;

  /* Signature easings */
  --ease-out:    cubic-bezier(.22,.61,.36,1);
  --ease-spring: cubic-bezier(.34,1.4,.5,1);

  /* Pointer-reactive highlight origin (updated by JS) */
  --mx: 50%;
  --my: 30%;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -moz-osx-font-smoothing: grayscale; }

body {
  min-height: 100vh;
  background-color: var(--bg-app);
  color: var(--zinc-200);
  font: 16px/1.5 "Inter", "InterVariable", system-ui, -apple-system,
        BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  overflow: hidden; /* aurora must not introduce scrollbars */
}

::selection { background: rgba(16,185,129,.30); color: #ecfdf5; }

:focus-visible {
  outline: 2px solid var(--emerald-500);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------- Atmospheric backdrop ---------- */
.aurora {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  /* base wash matching the app's fixed radial gradients */
  background-image:
    radial-gradient(1100px 600px at -10% -20%, rgba(16,185,129,.10), transparent 60%),
    radial-gradient(900px 500px at 110% 0%,   rgba(139,92,246,.07), transparent 55%),
    radial-gradient(1400px 700px at 50% 120%, rgba(56,189,248,.05), transparent 60%);
}

.aurora__blob {
  position: absolute;
  width: 46vmax;
  height: 46vmax;
  border-radius: 50%;
  filter: blur(72px);
  opacity: .5;
  mix-blend-mode: screen;
  will-change: transform;
}
.aurora__blob--emerald {
  top: -18vmax; left: -14vmax;
  background: radial-gradient(circle at 50% 50%, rgba(16,185,129,.55), transparent 62%);
}
.aurora__blob--violet {
  top: -10vmax; right: -16vmax;
  background: radial-gradient(circle at 50% 50%, rgba(139,92,246,.40), transparent 62%);
}
.aurora__blob--sky {
  bottom: -22vmax; left: 30%;
  background: radial-gradient(circle at 50% 50%, rgba(56,189,248,.34), transparent 62%);
}

/* faint technical grid, masked to a soft center fade */
.aurora__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.022) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: radial-gradient(circle at 50% 42%, #000 0%, transparent 72%);
          mask-image: radial-gradient(circle at 50% 42%, #000 0%, transparent 72%);
}

.aurora__vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 120% at 50% 40%, transparent 55%, rgba(0,0,0,.55) 100%);
}

/* ---------- Layout ---------- */
.login-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

/* ---------- Card ---------- */
.login-card {
  position: relative;
  width: 100%;
  max-width: 408px;
  padding: 44px 36px 30px;
  border-radius: var(--radius-xl);
  text-align: center;
  isolation: isolate;
  background:
    linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,0) 40%),
    linear-gradient(180deg, var(--bg-layer2), #0d0d13);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-card), var(--glow-emerald);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
          backdrop-filter: blur(20px) saturate(150%);
}

/* animated conic hairline border */
.login-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: conic-gradient(from var(--angle),
    transparent 0deg,
    rgba(16,185,129,.55) 70deg,
    rgba(110,231,183,.85) 110deg,
    transparent 180deg,
    transparent 360deg);
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask-composite: exclude;
  opacity: .9;
  pointer-events: none;
}

/* pointer-reactive inner glow */
.login-card__glow {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  z-index: -1;
  background: radial-gradient(420px circle at var(--mx) var(--my),
    rgba(16,185,129,.16), transparent 60%);
  opacity: 0;
  transition: opacity .5s var(--ease-out);
  pointer-events: none;
}
.login-card:hover .login-card__glow { opacity: 1; }

/* slow diagonal sheen drifting across the glass */
.login-card__sheen {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
  z-index: -1;
  pointer-events: none;
}
.login-card__sheen::after {
  content: "";
  position: absolute;
  top: -60%;
  left: -120%;
  width: 80%;
  height: 220%;
  transform: rotate(18deg);
  background: linear-gradient(90deg, transparent,
    rgba(255,255,255,.05), transparent);
}

/* ---------- Mark ---------- */
.login-mark { margin: 0 auto 18px; width: 76px; height: 76px; }
.mark { display: block; width: 100%; height: 100%;
  filter: drop-shadow(0 6px 18px rgba(16,185,129,.35)); }
.mark__arc { transform-box: fill-box; transform-origin: center; }
.mark__core { transform-box: fill-box; transform-origin: center; }

/* ---------- Type ---------- */
.login-wordmark {
  margin: 0 0 8px;
  font-size: 2.1rem;
  font-weight: 700;
  letter-spacing: 0.34em;
  text-indent: 0.34em; /* optical centering for tracked caps */
  background: linear-gradient(180deg, #ffffff 0%, var(--emerald-200) 60%, var(--emerald-400) 100%);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--emerald-300); /* fallback */
  text-shadow: 0 0 28px rgba(16,185,129,.25);
}

.login-tagline {
  margin: 0 0 26px;
  color: var(--zinc-400);
  font-size: 0.86rem;
  letter-spacing: 0.01em;
}

/* ---------- Error ---------- */
.login-error {
  margin: 0 0 18px;
  padding: 11px 14px;
  border-radius: var(--radius);
  background: rgba(127,29,29,.30);
  border: 1px solid rgba(239,68,68,.32);
  color: #fecaca;
  font-size: 0.85rem;
  text-align: left;
}

/* ---------- Button ---------- */
.login-button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px 18px;
  border-radius: var(--radius);
  overflow: hidden;
  background: linear-gradient(180deg, var(--emerald-500), var(--emerald-700));
  color: #04150e;
  font-weight: 650;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  text-decoration: none;
  box-shadow: 0 1px 0 rgba(255,255,255,.18) inset,
              0 10px 26px -10px rgba(16,185,129,.6);
  transition: transform .28s var(--ease-spring),
              box-shadow .28s var(--ease-out),
              filter .28s var(--ease-out);
}
.login-button:hover {
  transform: translateY(-2px);
  filter: saturate(1.06);
  box-shadow: 0 1px 0 rgba(255,255,255,.25) inset,
              0 16px 40px -12px rgba(16,185,129,.75);
}
.login-button:active { transform: translateY(0) scale(.995); transition-duration: .08s; }

.login-button__label { position: relative; z-index: 1; }
.login-button__arrow {
  position: relative;
  z-index: 1;
  width: 18px; height: 18px;
  transition: transform .3s var(--ease-spring);
}
.login-button:hover .login-button__arrow { transform: translateX(4px); }

/* diagonal shine sweep on hover */
.login-button__shine {
  position: absolute;
  top: 0; left: -130%;
  width: 60%; height: 100%;
  transform: skewX(-20deg);
  background: linear-gradient(90deg, transparent,
    rgba(255,255,255,.45), transparent);
  z-index: 0;
}
.login-button:hover .login-button__shine { animation: shine .85s var(--ease-out); }

@keyframes shine {
  from { left: -130%; }
  to   { left: 130%; }
}

/* ---------- Footer ---------- */
.login-footer {
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-size: 0.74rem;
  color: var(--zinc-500);
}
.login-env {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 3px 11px 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.02);
  color: var(--zinc-400);
  text-transform: uppercase;
  letter-spacing: 0.10em;
  font-size: 0.68rem;
}
.login-env__dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--emerald-400);
  box-shadow: 0 0 0 0 rgba(52,211,153,.6);
}
.login-support { color: var(--zinc-500); }

/* ============================================================
   Motion — entrance + ambient. Everything below only runs when
   the user has NOT requested reduced motion, so the default
   (and any animation-unsupported) experience is fully visible.
   ============================================================ */
@media (prefers-reduced-motion: no-preference) {
  .anim { opacity: 0; will-change: transform, opacity; }
  .login-card { animation: card-in .8s var(--ease-out) both; }
  .anim--mark    { animation: rise .7s var(--ease-out) .18s both; }
  .anim--title   { animation: rise .7s var(--ease-out) .26s both; }
  .anim--tagline { animation: rise .7s var(--ease-out) .34s both; }
  .login-error   { animation: rise .7s var(--ease-out) .40s both; }
  .anim--button  { animation: rise .7s var(--ease-out) .46s both; }
  .anim--footer  { animation: rise .7s var(--ease-out) .56s both; }

  .login-card::before { animation: spin-border 8s linear infinite; }
  .login-card__sheen::after { animation: sheen 9s ease-in-out 1.2s infinite; }

  .mark__arc  { animation: spin 14s linear infinite; }
  .mark__core { animation: core-pulse 3.6s ease-in-out infinite; }
  .login-env__dot { animation: dot-pulse 2.6s ease-out infinite; }

  .aurora__blob--emerald { animation: drift-a 26s ease-in-out infinite alternate; }
  .aurora__blob--violet  { animation: drift-b 32s ease-in-out infinite alternate; }
  .aurora__blob--sky     { animation: drift-c 30s ease-in-out infinite alternate; }
}

@keyframes card-in {
  from { opacity: 0; transform: translateY(20px) scale(.985); filter: blur(6px); }
  to   { opacity: 1; transform: none; filter: none; }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}
@keyframes spin-border { to { --angle: 360deg; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes core-pulse {
  0%, 100% { filter: drop-shadow(0 0 2px rgba(16,185,129,.4)); opacity: .92; }
  50%      { filter: drop-shadow(0 0 9px rgba(52,211,153,.85)); opacity: 1; }
}
@keyframes sheen {
  0%, 70% { transform: rotate(18deg) translateX(0); opacity: 0; }
  78%     { opacity: 1; }
  100%    { transform: rotate(18deg) translateX(360%); opacity: 0; }
}
@keyframes dot-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(52,211,153,.55); }
  70%  { box-shadow: 0 0 0 7px rgba(52,211,153,0); }
  100% { box-shadow: 0 0 0 0 rgba(52,211,153,0); }
}
@keyframes drift-a {
  from { transform: translate3d(0,0,0) scale(1); }
  to   { transform: translate3d(8vmax,6vmax,0) scale(1.12); }
}
@keyframes drift-b {
  from { transform: translate3d(0,0,0) scale(1.05); }
  to   { transform: translate3d(-7vmax,5vmax,0) scale(.92); }
}
@keyframes drift-c {
  from { transform: translate3d(0,0,0) scale(.95); }
  to   { transform: translate3d(6vmax,-7vmax,0) scale(1.1); }
}

/* ---------- Small screens ---------- */
@media (max-width: 460px) {
  .login-card { padding: 36px 24px 26px; }
  .login-wordmark { font-size: 1.9rem; }
}
