/* =====================================================================
   WhatsApp Saathi — login page
   Pure CSS 3D (no WebGL, no images, no external libraries).
   Visual language: green chat palette, bubbles, ticks — drawn generically.
   ===================================================================== */
:root {
  --deep: #041a17;
  --deep-2: #06231f;
  --teal: #075e54;
  --teal-2: #128c7e;
  --green: #25d366;
  --green-dk: #1aa251;
  --green-lt: #dcf8c6;
  --bubble-out: #d9fdd3;
  --bubble-in: #ffffff;
  --chat-bg: #efeae2;
  --read: #34b7f1;
  --ink: #0f1f1c;
  --muted: #5d6d69;
  --line: #dfe7e4;
  --danger: #d64545;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* phone geometry */
  --pw: 270px;
  --ph: 552px;
  --pd: 18px;
  --pr: 44px;
  --scene-scale: 1;

  /* driven by login.js (pointer parallax) */
  --rx: 0deg;
  --ry: 0deg;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--deep);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
svg { display: block; }

/* ------------------------------------------------------------------ */
/* Background                                                          */
/* ------------------------------------------------------------------ */
.bg {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background:
    radial-gradient(1200px 700px at 20% 30%, rgba(18, 140, 126, 0.45), transparent 60%),
    radial-gradient(900px 600px at 90% 90%, rgba(37, 211, 102, 0.16), transparent 60%),
    linear-gradient(160deg, #06302a 0%, var(--deep-2) 45%, var(--deep) 100%);
  z-index: 0;
}
.bg-pattern {
  position: absolute;
  inset: -50%;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 20h26a8 8 0 0 1 8 8v10a8 8 0 0 1-8 8H30l-8 6v-6h-4a8 8 0 0 1-8-8V28a8 8 0 0 1 8-8z'/%3E%3Cpath d='m72 30 4 4 8-8'/%3E%3Cpath d='m78 30 4 4 8-8'/%3E%3Ccircle cx='90' cy='80' r='9'/%3E%3Cpath d='M78 102c2-6 6-9 12-9s10 3 12 9'/%3E%3Cpath d='M22 86h22M22 94h14'/%3E%3C/svg%3E");
  background-size: 120px 120px;
  animation: pattern-drift 60s linear infinite;
  transform: rotate(-8deg);
}
@keyframes pattern-drift { to { background-position: 240px 120px; } }

.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.55;
  will-change: transform;
}
.g1 { width: 420px; height: 420px; left: -80px; top: 10%; background: #128c7e; animation: glow-a 18s ease-in-out infinite alternate; }
.g2 { width: 360px; height: 360px; right: 8%; top: -120px; background: #25d366; opacity: 0.22; animation: glow-b 22s ease-in-out infinite alternate; }
.g3 { width: 300px; height: 300px; left: 38%; bottom: -140px; background: #0b8f6e; opacity: 0.4; animation: glow-a 26s ease-in-out infinite alternate-reverse; }
@keyframes glow-a { to { transform: translate(120px, 60px) scale(1.15); } }
@keyframes glow-b { to { transform: translate(-90px, 80px) scale(0.9); } }

.bg-floor {
  position: absolute;
  left: -20%;
  right: -20%;
  bottom: -10%;
  height: 55%;
  background-image:
    linear-gradient(rgba(37, 211, 102, 0.18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 211, 102, 0.18) 1px, transparent 1px);
  background-size: 56px 56px;
  transform: perspective(600px) rotateX(62deg);
  transform-origin: 50% 100%;
  -webkit-mask-image: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent 80%);
          mask-image: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent 80%);
  animation: floor-run 8s linear infinite;
}
@keyframes floor-run { to { background-position: 0 56px, 0 0; } }

/* ------------------------------------------------------------------ */
/* Layout                                                              */
/* ------------------------------------------------------------------ */
.login-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
  align-items: center;
  gap: 24px;
  padding: 32px clamp(16px, 4vw, 64px);
  max-width: 1320px;
  margin: 0 auto;
}

/* ------------------------------------------------------------------ */
/* 3D scene                                                            */
/* ------------------------------------------------------------------ */
.scene {
  position: relative;
  height: min(720px, 92vh);
  display: flex;
  align-items: center; /* flex centres even when the unscaled stage is taller than the scene */
  justify-content: center;
}
.stage { flex: none; }
.stage {
  position: relative;
  width: var(--pw);
  height: var(--ph);
  perspective: 1400px;
  perspective-origin: 50% 40%;
  transform: scale(var(--scene-scale));
}
.rig {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transform: rotateX(calc(6deg + var(--rx))) rotateY(calc(-22deg + var(--ry)));
  transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
  animation: rig-enter 1.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes rig-enter {
  from { opacity: 0; transform: translateZ(-500px) rotateX(20deg) rotateY(-80deg); }
}
.floater {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  animation: float 7s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0) rotateY(-4deg) rotateZ(-1deg); }
  50%      { transform: translateY(-18px) rotateY(6deg) rotateZ(1deg); }
}

/* ---- the phone body ---- */
.phone {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
}
.face {
  position: absolute;
  inset: 0;
  border-radius: var(--pr);
  backface-visibility: hidden;
}
.face.front {
  transform: translateZ(calc(var(--pd) / 2));
  background: linear-gradient(145deg, #2c3533, #0c1211 55%, #1c2422);
  padding: 10px;
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.12);
  backface-visibility: visible;
}
.face.back {
  transform: rotateY(180deg) translateZ(calc(var(--pd) / 2));
  background:
    radial-gradient(120% 60% at 30% 10%, rgba(255, 255, 255, 0.22), transparent 50%),
    linear-gradient(150deg, #1f8f6e, #0b5a4c 60%, #07403a);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.08);
}
.face.back .cam {
  position: absolute;
  top: 22px;
  left: 22px;
  width: 78px;
  height: 78px;
  border-radius: 24px;
  background: rgba(0, 0, 0, 0.35);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15);
}
.face.back .cam i {
  position: absolute;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #4a6a8a, #0a0f14 60%);
  box-shadow: 0 0 0 3px #1d2624;
}
.face.back .cam i:nth-child(1) { left: 10px; top: 10px; }
.face.back .cam i:nth-child(2) { right: 10px; bottom: 10px; }
.face.back .back-mark {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 54px;
  height: 54px;
  margin: -27px 0 0 -27px;
  border-radius: 50% 50% 50% 12%;
  border: 3px solid rgba(255, 255, 255, 0.35);
}
/* extruded frame: stacked rounded slabs */
.face.edge {
  --step: calc(var(--pd) / 10);
  transform: translateZ(calc(var(--pd) / 2 - var(--i) * var(--step)));
  background: linear-gradient(90deg, #5f7470, #b9c9c5 18%, #6c807c 50%, #b9c9c5 82%, #5f7470);
  backface-visibility: visible;
}
.hw-btn {
  position: absolute;
  width: 4px;
  border-radius: 3px;
  background: linear-gradient(#8fa5a0, #52645f);
  transform-style: preserve-3d;
}
.hb1 { right: -3px; top: 150px; height: 64px; transform: translateZ(0); }
.hb2 { left: -3px;  top: 120px; height: 36px; }
.hb3 { left: -3px;  top: 170px; height: 56px; }

/* ---- screen ---- */
.bezel {
  position: relative;
  height: 100%;
  border-radius: calc(var(--pr) - 10px);
  overflow: hidden;
  background: #000;
}
.notch {
  position: absolute;
  z-index: 5;
  top: 9px;
  left: 50%;
  width: 84px;
  height: 22px;
  margin-left: -42px;
  border-radius: 14px;
  background: #000;
}
.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--chat-bg);
  font-size: 11.5px;
}
.screen::after { /* glass reflection */
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(115deg, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0) 32%, rgba(255, 255, 255, 0) 70%, rgba(255, 255, 255, 0.08) 100%);
  animation: glare 7s ease-in-out infinite;
}
@keyframes glare { 50% { opacity: 0.45; } }

.statusbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 38px;
  padding: 10px 22px 0 26px;
  background: var(--teal);
  color: #fff;
  font-weight: 600;
  font-size: 11px;
}
.sb-icons { display: flex; gap: 5px; align-items: center; }
.sig { display: flex; gap: 1.5px; align-items: flex-end; height: 9px; }
.sig b { width: 2.5px; background: #fff; border-radius: 1px; }
.sig b:nth-child(1) { height: 3px; } .sig b:nth-child(2) { height: 5px; }
.sig b:nth-child(3) { height: 7px; } .sig b:nth-child(4) { height: 9px; }
.bat { width: 18px; height: 9px; border: 1.2px solid #fff; border-radius: 3px; padding: 1px; }
.bat b { display: block; height: 100%; width: 78%; background: #fff; border-radius: 1px; }

.chat-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 10px 6px;
  background: var(--teal);
  color: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  position: relative;
  z-index: 2;
}
.chat-head .back { width: 18px; height: 18px; fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.c-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #f5a340, #e0590c);
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.5px;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.25);
}
.c-title { flex: 1; min-width: 0; line-height: 1.2; }
.c-title strong { display: block; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-title small { font-size: 10px; opacity: 0.85; transition: color 0.3s; }
.c-title small.typing { color: #b8f5cf; font-style: italic; }
.c-actions { display: flex; gap: 3px; flex-direction: column; }
.c-actions i { width: 3px; height: 3px; background: #fff; border-radius: 50%; }

.chat-body {
  flex: 1;
  position: relative;
  overflow: hidden;
  padding: 10px 10px 6px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 5px;
  background-color: var(--chat-bg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80' fill='none' stroke='%23000' stroke-opacity='.05' stroke-width='1.4'%3E%3Ccircle cx='14' cy='16' r='5'/%3E%3Cpath d='M44 10h14a4 4 0 0 1 4 4v6a4 4 0 0 1-4 4h-8l-4 3v-3h-2a4 4 0 0 1-4-4v-6a4 4 0 0 1 4-4z'/%3E%3Cpath d='m10 52 5 5 8-9'/%3E%3Cpath d='M50 50l6 12 6-12z'/%3E%3C/svg%3E");
}
.chat-body.fade-out > .msg { transition: opacity 0.5s, transform 0.5s; opacity: 0; transform: translateY(-14px); }
.day-chip {
  align-self: center;
  margin-bottom: auto;
  padding: 3px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.85);
  color: #54656f;
  font-size: 9.5px;
  font-weight: 600;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.06);
}

.msg {
  position: relative;
  max-width: 82%;
  padding: 6px 8px 5px;
  border-radius: 9px;
  line-height: 1.35;
  color: #111b21;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
  animation: pop 0.42s cubic-bezier(0.2, 1.3, 0.4, 1) both;
  transform-origin: bottom left;
}
.msg.in  { align-self: flex-start; background: var(--bubble-in); border-top-left-radius: 2px; }
.msg.out { align-self: flex-end; background: var(--bubble-out); border-top-right-radius: 2px; transform-origin: bottom right; }
.msg.in::before, .msg.out::before {
  content: "";
  position: absolute;
  top: 0;
  width: 8px;
  height: 10px;
}
.msg.in::before  { left: -6px;  background: linear-gradient(225deg, var(--bubble-in) 50%, transparent 50%); }
.msg.out::before { right: -6px; background: linear-gradient(135deg, var(--bubble-out) 50%, transparent 50%); }
.msg .meta {
  float: right;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin: 5px 0 -2px 8px;
  font-size: 8.5px;
  color: #667781;
}
.ticks { width: 15px; height: 10px; fill: none; stroke: #8696a0; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: stroke 0.35s; }
.ticks .t2 { opacity: 0; transition: opacity 0.25s; }
.ticks.delivered .t2 { opacity: 1; }
.ticks.read { stroke: var(--read); }
.ticks.read .t2 { opacity: 1; }

.msg.doc { display: flex; gap: 7px; align-items: center; padding: 6px; min-width: 150px; }
.doc-ico {
  flex: none;
  width: 26px;
  height: 30px;
  border-radius: 4px;
  background: linear-gradient(160deg, #21a366, #107c41);
  position: relative;
  color: #fff;
  font-size: 7px;
  font-weight: 800;
  display: grid;
  place-items: end center;
  padding-bottom: 4px;
}
.doc-ico::after { content: ""; position: absolute; right: 0; top: 0; border: 5px solid transparent; border-top-color: var(--bubble-out); border-right-color: var(--bubble-out); }
.doc-body { flex: 1; min-width: 0; }
.doc-body strong { display: block; font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-body small { color: #667781; font-size: 8.5px; }

.msg.typing { display: inline-flex; gap: 3px; padding: 9px 11px; }
.msg.typing i { width: 5px; height: 5px; border-radius: 50%; background: #8696a0; animation: dot 1.1s infinite; }
.msg.typing i:nth-child(2) { animation-delay: 0.15s; }
.msg.typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes dot { 0%, 60%, 100% { transform: translateY(0); opacity: 0.5; } 30% { transform: translateY(-3px); opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(0.85); } }

.chat-input { display: flex; gap: 6px; align-items: center; padding: 6px 8px 16px; background: transparent; }
.pill {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 10px;
  border-radius: 16px;
  background: #fff;
  color: #8696a0;
  font-size: 11px;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.08);
}
.smile { width: 13px; height: 13px; border-radius: 50%; border: 1.6px solid #8696a0; }
.send {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--teal-2);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.18);
}
.send svg { width: 14px; height: 14px; fill: #fff; }
.send.pulse { animation: send-pulse 0.5s ease; }
@keyframes send-pulse { 50% { transform: scale(0.82); background: var(--green); } }

/* ---- floating chips ---- */
.chip {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px 10px 10px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35), inset 0 0 0 1px rgba(255, 255, 255, 0.6);
  color: var(--ink);
  white-space: nowrap;
  transform-style: preserve-3d;
  -webkit-backdrop-filter: blur(6px);
          backdrop-filter: blur(6px);
}
.chip strong { display: block; font-size: 14px; line-height: 1.1; }
.chip small { font-size: 11px; color: var(--muted); }
.chip-ico { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; }
.chip-ico svg { width: 20px; height: 20px; fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.chip-ico.ok { background: linear-gradient(135deg, var(--green), var(--teal-2)); }
.chip-ico.people { background: linear-gradient(135deg, #f5a340, #e0590c); }
.chip-ico.people svg { stroke-width: 2; }

.chip-a { right: -150px; top: 70px;  animation: chip-in 0.8s 0.9s cubic-bezier(0.2, 1.2, 0.4, 1) both, chip-bob-a 6s 1.7s ease-in-out infinite; }
.chip-b { left: -170px;  top: 300px; animation: chip-in 0.8s 1.15s cubic-bezier(0.2, 1.2, 0.4, 1) both, chip-bob-b 7s 2s ease-in-out infinite; }
.chip-c { right: -120px; bottom: 50px; animation: chip-in 0.8s 1.4s cubic-bezier(0.2, 1.2, 0.4, 1) both, chip-bob-a 8s 2.2s ease-in-out infinite reverse; }
@keyframes chip-in { from { opacity: 0; transform: translateZ(0) scale(0.6); } }
@keyframes chip-bob-a { 0%, 100% { transform: translateZ(90px) translateY(0); } 50% { transform: translateZ(90px) translateY(-10px); } }
@keyframes chip-bob-b { 0%, 100% { transform: translateZ(130px) translateY(0); } 50% { transform: translateZ(130px) translateY(12px); } }
.chip-a, .chip-c { transform: translateZ(90px); }
.chip-b { transform: translateZ(130px); }

.bars { display: flex; gap: 3px; align-items: flex-end; width: 34px; height: 34px; padding: 6px; border-radius: 11px; background: linear-gradient(135deg, #0f766e, #075e54); }
.bars i { flex: 1; border-radius: 2px; background: #b8f5cf; animation: eq 1.2s ease-in-out infinite; }
.bars i:nth-child(1) { height: 40%; animation-delay: -0.2s; }
.bars i:nth-child(2) { height: 80%; animation-delay: -0.5s; }
.bars i:nth-child(3) { height: 55%; animation-delay: -0.8s; }
.bars i:nth-child(4) { height: 95%; animation-delay: -0.1s; }
.bars i:nth-child(5) { height: 65%; animation-delay: -0.6s; }
@keyframes eq { 50% { transform: scaleY(0.45); } }
.bars i { transform-origin: bottom; }

/* ---- orbiting contacts ---- */
.orbit {
  position: absolute;
  left: 50%;
  top: 46%;
  width: 0;
  height: 0;
  transform-style: preserve-3d;
  animation: orbit 26s linear infinite;
}
@keyframes orbit {
  from { transform: rotateX(-10deg) rotateY(0deg); }
  to   { transform: rotateX(-10deg) rotateY(360deg); }
}
.orb {
  position: absolute;
  transform-style: preserve-3d;
  transform: rotateY(var(--a)) translateZ(300px) translateY(var(--y, 0px));
}
.o1 { --a: 0deg;   --y: -290px; }
.o2 { --a: 90deg;  --y: 250px; }
.o3 { --a: 180deg; --y: -230px; }
.o4 { --a: 270deg; --y: 300px; }
.orb-face {
  position: absolute;
  left: -24px;
  top: -24px;
  width: 48px;
  height: 48px;
  transform-style: preserve-3d;
  animation: face-cam 26s linear infinite;
}
/* counter-rotate so each avatar always faces the viewer */
@keyframes face-cam {
  from { transform: rotateY(calc(-1 * var(--a))); }
  to   { transform: rotateY(calc(-1 * var(--a) - 360deg)); }
}
.av {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35), inset -6px -8px 14px rgba(0, 0, 0, 0.25), inset 5px 6px 10px rgba(255, 255, 255, 0.35);
  overflow: hidden;
}
.av::before { /* head */
  content: "";
  position: absolute;
  left: 50%;
  top: 22%;
  width: 36%;
  height: 36%;
  margin-left: -18%;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
}
.av::after { /* shoulders */
  content: "";
  position: absolute;
  left: 50%;
  bottom: -22%;
  width: 70%;
  height: 50%;
  margin-left: -35%;
  border-radius: 50% 50% 0 0;
  background: rgba(255, 255, 255, 0.85);
}
.av1 { background: radial-gradient(circle at 35% 30%, #7ee2a8, #128c7e); }
.av2 { background: radial-gradient(circle at 35% 30%, #ffc98a, #e0590c); }
.av3 { background: radial-gradient(circle at 35% 30%, #9cc7ff, #2f6df6); }
.av4 { background: radial-gradient(circle at 35% 30%, #e3b5ff, #8b3fd1); }
.orb-face em {
  position: absolute;
  right: 1px;
  bottom: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 2.5px var(--deep-2);
}
.mini-bubble {
  position: absolute;
  left: 36px;
  top: -14px;
  width: 30px;
  height: 18px;
  border-radius: 9px 9px 9px 2px;
  background: #fff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
  animation: mini 5s ease-in-out infinite;
  transform-origin: bottom left;
}
.mini-bubble::after {
  content: "";
  position: absolute;
  left: 6px;
  right: 6px;
  top: 8px;
  height: 2px;
  border-radius: 1px;
  background: #c4ccca;
  box-shadow: 0 -4px 0 #c4ccca;
}
.o2 .mini-bubble { animation-delay: 1.2s; background: var(--bubble-out); }
.o3 .mini-bubble { animation-delay: 2.5s; }
.o4 .mini-bubble { animation-delay: 3.7s; background: var(--bubble-out); }
@keyframes mini {
  0%, 12%  { opacity: 0; transform: scale(0.3); }
  22%, 60% { opacity: 1; transform: scale(1); }
  72%, 100% { opacity: 0; transform: scale(0.6) translateY(-6px); }
}

.shadow {
  position: absolute;
  left: 50%;
  bottom: -70px;
  width: 300px;
  height: 46px;
  margin-left: -150px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(0, 0, 0, 0.55), rgba(18, 140, 126, 0.15) 70%, transparent);
  filter: blur(4px);
  animation: shadow 7s ease-in-out infinite;
}
@keyframes shadow { 50% { transform: scale(0.82); opacity: 0.7; } }

/* ------------------------------------------------------------------ */
/* Form card                                                           */
/* ------------------------------------------------------------------ */
.panel { display: flex; justify-content: center; }
.card {
  width: 100%;
  max-width: 420px;
  padding: 34px 32px 26px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.4);
  animation: card-in 0.9s 0.25s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes card-in { from { opacity: 0; transform: translateX(40px) scale(0.97); } }
.card > * { animation: rise 0.6s cubic-bezier(0.16, 1, 0.3, 1) both; }
.card > :nth-child(1) { animation-delay: 0.45s; }
.card > :nth-child(2) { animation-delay: 0.55s; }
.card > :nth-child(3) { animation-delay: 0.62s; }
.card > :nth-child(4) { animation-delay: 0.7s; }
.card > :nth-child(5) { animation-delay: 0.8s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.brand img { width: 44px; height: 44px; }
.brand-name { font-weight: 800; font-size: 17px; letter-spacing: -0.2px; }
.brand-sub { font-size: 12px; color: var(--muted); }
h1 { margin: 0 0 6px; font-size: 28px; letter-spacing: -0.6px; line-height: 1.15; }
.lead { margin: 0 0 22px; color: var(--muted); font-size: 14px; line-height: 1.5; }

.field { display: block; margin-bottom: 14px; }
.field.hidden { display: none; }
.f-label { display: block; margin-bottom: 6px; font-size: 12.5px; font-weight: 600; color: #33433f; }
.f-wrap { position: relative; display: block; }
.f-ico {
  position: absolute;
  left: 13px;
  top: 50%;
  width: 18px;
  height: 18px;
  margin-top: -9px;
  fill: none;
  stroke: #8a9a96;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
  transition: stroke 0.2s;
}
.field input {
  width: 100%;
  height: 48px;
  padding: 0 44px 0 42px;
  border: 1.5px solid var(--line);
  border-radius: 13px;
  background: #f7faf9;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.field input::placeholder { color: #9aa8a4; }
.field input:hover { border-color: #c9d6d2; }
.field input:focus { border-color: var(--green); background: #fff; box-shadow: 0 0 0 4px rgba(37, 211, 102, 0.16); }
.f-wrap:focus-within .f-ico { stroke: var(--teal-2); }
.field.invalid input { border-color: var(--danger); box-shadow: 0 0 0 4px rgba(214, 69, 69, 0.12); }

.reveal {
  position: absolute;
  right: 6px;
  top: 50%;
  width: 36px;
  height: 36px;
  margin-top: -18px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.reveal:hover { background: #eef3f1; }
.reveal:focus-visible { outline: 2px solid var(--green); outline-offset: 1px; }
.reveal svg { width: 19px; height: 19px; fill: none; stroke: #6b7c78; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.reveal .eye-off { display: none; }
.reveal[aria-pressed="true"] .eye { display: none; }
.reveal[aria-pressed="true"] .eye-off { display: block; }

.row { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 14px; }
.switch { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; color: #33433f; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.track { position: relative; width: 38px; height: 22px; border-radius: 11px; background: #d3dcd9; transition: background 0.2s; flex: none; }
.thumb { position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); transition: transform 0.25s cubic-bezier(0.3, 1.4, 0.5, 1); }
.switch input:checked + .track { background: var(--green); }
.switch input:checked + .track .thumb { transform: translateX(16px); }
.switch input:focus-visible + .track { box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.35); }

.error {
  min-height: 0;
  max-height: 0;
  overflow: hidden;
  margin: 0;
  border-radius: 10px;
  color: #9b2c2c;
  background: #fdecec;
  font-size: 13px;
  line-height: 1.4;
  transition: max-height 0.25s, padding 0.25s, margin 0.25s;
}
.error.show { max-height: 80px; padding: 9px 12px; margin-bottom: 14px; }

.submit {
  position: relative;
  width: 100%;
  height: 50px;
  border: 0;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #fff;
  font: inherit;
  font-size: 15.5px;
  font-weight: 700;
  cursor: pointer;
  background: linear-gradient(135deg, #2bd46c, var(--teal-2));
  box-shadow: 0 10px 24px rgba(18, 140, 126, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  overflow: hidden;
  transition: transform 0.15s, box-shadow 0.2s, filter 0.2s;
}
.submit::before { /* sheen */
  content: "";
  position: absolute;
  top: 0;
  left: -60%;
  width: 40%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transform: skewX(-20deg);
  animation: sheen 4.5s 2s ease-in-out infinite;
}
@keyframes sheen { 0%, 70% { left: -60%; } 100% { left: 130%; } }
.submit:hover { transform: translateY(-1px); box-shadow: 0 14px 30px rgba(18, 140, 126, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.25); }
.submit:active { transform: translateY(1px) scale(0.99); }
.submit:focus-visible { outline: 3px solid rgba(37, 211, 102, 0.5); outline-offset: 2px; }
.s-arrow { width: 18px; height: 18px; fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.2s; }
.submit:hover .s-arrow { transform: translateX(3px); }
.spinner { display: none; width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid rgba(255, 255, 255, 0.35); border-top-color: #fff; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.submit.loading { pointer-events: none; filter: saturate(0.8); }
.submit.loading .s-text, .submit.loading .s-arrow { display: none; }
.submit.loading .spinner { display: block; }
.submit.success { background: linear-gradient(135deg, var(--green), var(--green-dk)); }

.card.shake { animation: shake 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97); }
@keyframes shake {
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

.foot {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid #edf1ef;
  font-size: 12px;
  color: var(--muted);
}
.lock { display: inline-flex; align-items: center; gap: 6px; color: #33433f; font-weight: 600; }
.lock svg { width: 15px; height: 15px; fill: none; stroke: var(--teal-2); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* leaving the page after a successful login */
body.leaving .card { transition: opacity 0.45s, transform 0.45s; opacity: 0; transform: scale(0.96); }
body.leaving .rig { transition: transform 0.7s cubic-bezier(0.6, 0, 0.8, 0.3), opacity 0.7s; transform: translateZ(300px) rotateY(0deg); opacity: 0; }

/* ------------------------------------------------------------------ */
/* Responsive                                                          */
/* ------------------------------------------------------------------ */
@media (max-width: 1100px) {
  .chip-a { right: -110px; }
  .chip-b { left: -120px; }
  .chip-c { right: -90px; }
}
@media (max-width: 920px) {
  .login-shell {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    padding: 12px 16px 32px;
    align-content: start;
  }
  .scene { height: 400px; overflow: hidden; margin: 0 -16px; }
  :root { --scene-scale: 0.64; }
  .card { margin-top: 4px; padding: 28px 22px 22px; }
  .brand { margin-bottom: 20px; }
  h1 { font-size: 24px; }
}
@media (max-width: 480px) {
  .scene { height: 350px; }
  :root { --scene-scale: 0.5; }
  .chip-a { right: -120px; }
  .chip-b { left: -130px; }
}
@media (max-height: 640px) and (min-width: 921px) {
  :root { --scene-scale: 0.8; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0s !important;
    transition-duration: 0.001ms !important;
  }
  .orbit, .orb-face { animation: none !important; }
  .orb-face { transform: rotateY(calc(-1 * var(--a))); }
}

/* Author / company watermark under the sign-in card. */
.login-watermark {
  margin-top: 16px; text-align: center;
  font-size: 11px; color: var(--muted); letter-spacing: .01em;
}
.login-watermark b { color: #122018; font-weight: 650; }
