:root {
  --bg-0: #f4f8fd;
  --bg-1: #e9f1fb;
  --ink: #0e2454;
  --muted: #667696;
  --line: #c5d4ea;
  --primary: #0f2a6b;
  --primary-2: #12347f;
  --accent-aqua: #4ed2c2;
  --accent-teal: #1cb5aa;
  --card: rgba(255, 255, 255, 0.82);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", "Avenir Next", "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 700px at 15% 10%, #ffffff 0%, transparent 62%),
    radial-gradient(900px 600px at 90% 92%, #dce9ff 0%, transparent 58%),
    linear-gradient(160deg, var(--bg-0), var(--bg-1));
}

.login-page {
  position: relative;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  overflow-x: hidden;
  overflow-y: auto;
}

.login-page::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.2), rgba(225, 237, 255, 0.16));
  pointer-events: none;
}

.visual-panel {
  position: relative;
  padding: 52px 54px;
  overflow: hidden;
}

.visual-brand {
  position: relative;
  z-index: 3;
  color: #0c214f;
}

.visual-brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 700;
}

.visual-brand-icon {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.visual-brand p {
  margin: 8px 0 0;
  color: #6b7892;
  font-size: 17px;
}

.cloud {
  position: absolute;
  top: 8%;
  width: clamp(260px, 34vw, 520px);
  height: clamp(42px, 5vw, 78px);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(231, 242, 255, 0.82));
  filter: blur(1.2px);
  opacity: 0.9;
}

.cloud::before,
.cloud::after {
  content: "";
  position: absolute;
  background: inherit;
  border-radius: 999px;
}

.cloud::before { width: 40%; height: 130%; left: 14%; top: -52%; }
.cloud::after { width: 26%; height: 90%; right: 16%; top: -38%; }
.cloud-a { left: 6%; animation: cloudDriftA 28s ease-in-out infinite; }
.cloud-b { left: 30%; top: 14%; animation: cloudDriftB 36s ease-in-out infinite reverse; }
.cloud-c { right: 2%; top: 9%; animation: cloudDriftA 32s ease-in-out infinite; }

.teal-swoop {
  position: absolute;
  right: -8%;
  top: 10%;
  width: min(84vw, 1040px);
  height: min(78vh, 760px);
  background: radial-gradient(ellipse at 18% 34%, rgba(97, 238, 214, 0.78), rgba(30, 180, 170, 0.36) 40%, rgba(13, 141, 136, 0.14) 64%, transparent 76%);
  border-radius: 56% 44% 48% 52% / 45% 56% 44% 55%;
  transform: rotate(-10deg);
  filter: blur(0.2px);
}

.teal-swoop-2 {
  right: -18%;
  top: -8%;
  width: min(60vw, 760px);
  height: min(56vh, 560px);
  opacity: 0.54;
  transform: rotate(-13deg);
}

.teal-swoop::before {
  content: "";
  position: absolute;
  left: 6%;
  top: 38%;
  width: 120%;
  height: 16%;
  transform: rotate(-24deg);
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(4, 112, 109, 0.95), rgba(16, 176, 167, 0.72), rgba(73, 220, 208, 0.35));
  filter: blur(0.2px);
  box-shadow: 0 0 26px rgba(20, 190, 180, 0.42);
  opacity: 0.92;
}

.ambient-icons {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.ambient-icon {
  position: absolute;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(203, 246, 241, 0.38);
  box-shadow: 0 0 28px rgba(112, 246, 233, 0.28);
  opacity: 0;
  animation-name: ambientFade;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
}

.ambient-icon img {
  width: 30px;
  height: 30px;
  object-fit: contain;
  filter: drop-shadow(0 0 6px rgba(153, 252, 242, 0.6));
}

.ambient-icon.fallback {
  color: #e6fffc;
  font-size: 12px;
  font-weight: 700;
}

.motion-trails {
  position: absolute;
  inset: 0;
}

.trail {
  position: absolute;
  left: -10%;
  width: 102%;
  height: 3px;
  border-radius: 999px;
  background:
    linear-gradient(90deg, transparent 0%, rgba(208, 255, 249, 0.2) 28%, rgba(136, 255, 241, 0.78) 50%, rgba(196, 255, 248, 0.22) 72%, transparent 100%);
  box-shadow: 0 0 26px rgba(90, 246, 233, 0.38);
  opacity: 0.85;
}

.t1 { top: 24%; transform: rotate(-31deg); animation: flow 10s linear infinite; }
.t2 { top: 38%; transform: rotate(-30deg); animation: flow 11.5s linear infinite reverse; }
.t3 { top: 52%; transform: rotate(-29deg); animation: flow 12.5s linear infinite; }
.t4 { top: 66%; transform: rotate(-27deg); animation: flow 13.5s linear infinite reverse; }

.spark {
  position: absolute;
  left: 0;
  top: 50%;
  width: 12px;
  height: 12px;
  transform: translate(-8px, -50%);
  border-radius: 50%;
  background: #ebfffd;
  box-shadow: 0 0 18px #cbfffa, 0 0 30px rgba(129, 255, 241, 0.98), 0 0 44px rgba(108, 245, 231, 0.92);
}

.s1 { animation: sparkMove 2.6s linear infinite; }
.s2 { animation: sparkMove 2.9s linear infinite 0.4s; }
.s3 { animation: sparkMove 2.8s linear infinite 0.7s; }
.s4 { animation: sparkMove 3.1s linear infinite 0.2s; }

.feature-chip {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 14px;
  border: 1px solid rgba(216, 244, 239, 0.7);
  background: rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: #0d3a58;
  font-size: 13px;
  font-weight: 700;
  padding: 9px 12px;
  box-shadow: 0 14px 38px rgba(16, 58, 74, 0.15);
  animation: chipFloat 7s ease-in-out infinite;
}

.chip-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11px;
  color: #fff;
  background: linear-gradient(165deg, #35c8bc, #169f95);
}

.c1 { top: 30%; left: 12%; animation-delay: 0s; }
.c2 { top: 48%; left: 16%; animation-delay: 1.3s; }
.c3 { top: 48%; left: 46%; animation-delay: 2.2s; }
.c4 { top: 66%; left: 34%; animation-delay: 0.8s; }

.mist {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -8%;
  height: 30%;
  background: linear-gradient(180deg, rgba(230, 239, 252, 0.12), rgba(215, 229, 248, 0.66), rgba(210, 225, 246, 0.84));
  filter: blur(2px);
  animation: mistDrift 26s ease-in-out infinite;
}

.visual-panel::after {
  content: "";
  position: absolute;
  left: -8%;
  right: -8%;
  bottom: -6%;
  height: 33%;
  background:
    radial-gradient(40% 60% at 24% 70%, rgba(244, 249, 255, 0.95), transparent 70%),
    radial-gradient(36% 56% at 56% 62%, rgba(241, 248, 255, 0.92), transparent 68%),
    radial-gradient(34% 54% at 78% 72%, rgba(241, 248, 255, 0.9), transparent 70%);
  filter: blur(2.2px);
  animation: cloudLayer 30s ease-in-out infinite;
  pointer-events: none;
}

.auth-panel {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  padding: 24px 38px;
}

.login-shell {
  width: min(520px, 100%);
  border-radius: 24px;
  border: 1px solid rgba(188, 206, 233, 0.94);
  background: var(--card);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 26px 78px rgba(16, 42, 95, 0.18);
  padding: 20px 30px 26px;
  animation: panelIn 720ms cubic-bezier(.2,.8,.2,1);
}

.card-badge {
  width: 68px;
  height: 68px;
  margin: 0 auto 8px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, rgba(76, 165, 155, 0.9), rgba(110, 200, 190, 0.88));
}

.card-badge-icon {
  width: 54px;
  height: 54px;
  object-fit: contain;
}

.brand-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.brand-icon { width: 24px; height: 24px; }
.brand-name { font-size: 16px; font-weight: 700; color: var(--primary); display: none; }
h1 { margin: 0; font-size: clamp(42px, 3.3vw, 50px); line-height: 1.05; color: #081839; letter-spacing: -0.02em; text-align: center; }
.welcome { margin: 10px 0 16px; color: var(--muted); font-size: 15px; line-height: 1.4; text-align: center; }

.login-form { display: grid; gap: 10px; }
label { font-size: 13px; font-weight: 600; color: #41567f; }
input {
  border: 1px solid #b9c8e4;
  border-radius: 12px;
  min-height: 48px;
  font-size: 16px;
  color: #0d224f;
  padding: 0 13px;
  background: rgba(255, 255, 255, 0.95);
}
input:focus {
  outline: none;
  border-color: #58b8d8;
  box-shadow: 0 0 0 3px rgba(64, 198, 191, 0.2);
}

.form-meta {
  display: flex;
  justify-content: flex-end;
  margin-top: -1px;
}

.text-link {
  color: #1f4f9e;
  text-decoration: none;
  font-size: 13px;
}
.text-link:hover { text-decoration: underline; }

.btn {
  width: 100%;
  min-height: 58px;
  border-radius: 12px;
  border: 1px solid var(--primary-2);
  background: linear-gradient(90deg, #0f9f95 0%, #1bb6aa 100%);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}
.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 22px rgba(17, 50, 114, 0.32);
}
.btn:focus-visible {
  outline: 2px solid #42c4b8;
  outline-offset: 2px;
}
.btn[disabled] { opacity: 0.76; cursor: wait; filter: saturate(0.7); }

.msg {
  min-height: 20px;
  margin: 2px 0 0;
  color: #2e4f89;
  font-size: 13px;
}

.create-line,
.support-line {
  margin: 2px 0 0;
  color: #667896;
  font-size: 14px;
  line-height: 1.35;
}

.or-sep {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 10px;
  align-items: center;
  margin-top: 2px;
}

.or-sep::before,
.or-sep::after {
  content: "";
  border-top: 1px solid #d7e1ef;
}

.or-sep span {
  color: #7e8da8;
  font-size: 12px;
}

.create-line {
  text-align: center;
}

@keyframes drift {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(26px); }
}

@keyframes cloudDriftA {
  0%, 100% { transform: translateX(0) translateY(0); }
  50% { transform: translateX(52px) translateY(8px); }
}

@keyframes cloudDriftB {
  0%, 100% { transform: translateX(0) translateY(0); }
  50% { transform: translateX(-46px) translateY(10px); }
}

@keyframes flow {
  0% { opacity: 0.56; }
  50% { opacity: 0.85; }
  100% { opacity: 0.56; }
}

@keyframes sparkMove {
  0% { left: 0%; opacity: 0; }
  8% { opacity: 1; }
  70% { opacity: 1; }
  100% { left: 100%; opacity: 0; }
}

@keyframes mistDrift {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(20px); }
}

@keyframes cloudLayer {
  0%, 100% { transform: translateX(0); opacity: 0.9; }
  50% { transform: translateX(26px); opacity: 1; }
}

@keyframes chipFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes ambientFade {
  0%, 100% { opacity: 0; transform: scale(0.92); }
  28% { opacity: 0.88; transform: scale(1); }
  64% { opacity: 0.45; transform: scale(0.98); }
}

@keyframes panelIn {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 980px) {
  .login-page {
    grid-template-columns: 1fr;
  }
  .visual-panel {
    min-height: 40vh;
    order: 2;
    padding: 16px;
  }
  .ambient-icon {
    width: 44px;
    height: 44px;
  }
  .ambient-icon img {
    width: 24px;
    height: 24px;
  }
  .visual-brand { display: none; }
  .auth-panel {
    order: 1;
    padding: 18px;
  }
  .login-shell {
    width: min(560px, 100%);
  }
  .c1 { top: 18%; left: 8%; }
  .c2 { top: 34%; left: 10%; }
  .c3 { top: 42%; left: 28%; }
  .c4 { top: 54%; left: 22%; }
}

@media (prefers-reduced-motion: reduce) {
  .cloud,
  .trail,
  .feature-chip,
  .login-shell,
  .ambient-icon {
    animation: none !important;
  }
  .ambient-icon { opacity: 0.22; }
  .btn { transition: none; }
}
