.page {
  width: min(940px, 100%);
  min-height: 100vh;
  padding: 1rem;
  display: grid;
  place-items: center;
  background:
    linear-gradient(180deg, rgba(232, 246, 248, 0.82) 0%, rgba(253, 246, 236, 0) 52%),
    var(--bg-0);
}

.loginShell {
  width: 100%;
  min-height: min(760px, calc(100vh - 2rem));
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(320px, 0.88fr);
  overflow: hidden;
  border: 1px solid rgba(240, 230, 214, 0.92);
  border-radius: 28px;
  background: var(--panel);
  box-shadow: 0 20px 54px rgba(171, 115, 102, 0.18);
}

.visualPanel {
  position: relative;
  min-height: 640px;
  padding: 2rem clamp(1.4rem, 4vw, 3.25rem) 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.1rem;
  overflow: hidden;
  background:
    linear-gradient(180deg, #e8f8fb 0%, #fff1e7 72%, #ffb5aa 100%);
}

.visualPanel::after {
  content: "";
  position: absolute;
  left: -8%;
  right: -8%;
  bottom: -74px;
  height: 180px;
  border-radius: 50% 50% 0 0;
  background: #ffb5aa;
  opacity: 0.9;
}

.cornerDeco {
  position: absolute;
  z-index: 1;
  width: clamp(92px, 13vw, 148px);
  height: auto;
  pointer-events: none;
}

.cornerDecoLeft {
  top: 0.9rem;
  left: 0.95rem;
}

.cornerDecoRight {
  top: 0.85rem;
  right: 0.75rem;
}

.cloudBadge {
  position: relative;
  z-index: 2;
  width: min(210px, 48vw);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  margin-top: 0.4rem;
  border: 7px solid rgba(255, 255, 255, 0.82);
  border-radius: 999px;
  background: #e4f4fb;
  box-shadow: 0 16px 34px rgba(85, 141, 153, 0.22);
}

.cloudBaby {
  width: 90%;
  height: auto;
  object-fit: contain;
  transform: translateY(2px);
}

.visualCopy {
  position: relative;
  z-index: 2;
  max-width: 25rem;
  display: grid;
  gap: 0.45rem;
  text-align: center;
}

.visualCopy span,
.loginIntro span {
  color: var(--accent-strong);
  font-size: 0.86rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.visualCopy h1 {
  color: var(--ink-0);
  font-family: var(--font-baloo), var(--font-space-grotesk), system-ui, sans-serif;
  font-size: clamp(2.45rem, 7vw, 4.4rem);
  font-weight: 800;
  line-height: 0.95;
}

.visualCopy p {
  color: var(--ink-1);
  font-size: clamp(1rem, 2.1vw, 1.15rem);
  font-weight: 700;
  line-height: 1.35;
}

.balanceStage {
  position: relative;
  z-index: 2;
  width: min(420px, 92%);
  margin-top: auto;
  display: grid;
  place-items: end center;
}

.balanceStage::before {
  content: "";
  position: absolute;
  width: 86%;
  height: 42%;
  left: 7%;
  bottom: 8%;
  border-radius: 48% 52% 44% 56%;
  background: rgba(255, 255, 255, 0.68);
  box-shadow: 0 18px 36px rgba(171, 115, 102, 0.16);
}

.balanceBaby {
  position: relative;
  z-index: 1;
  width: 100%;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 18px 20px rgba(137, 91, 86, 0.16));
}

.loginPanel {
  padding: clamp(2rem, 5vw, 3.4rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1.35rem;
  background: linear-gradient(180deg, #ffffff 0%, #fffaf4 100%);
}

.loginIntro {
  display: grid;
  gap: 0.35rem;
}

.loginIntro h2 {
  color: var(--ink-0);
  font-size: clamp(1.85rem, 4vw, 2.55rem);
  font-weight: 900;
  line-height: 1.02;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  width: 100%;
}

.form :global(.field) {
  gap: 0.45rem;
}

.form :global(.field label) {
  color: var(--ink-0);
  font-size: 0.9rem;
}

.form :global(.field input) {
  min-height: 3rem;
  border: 2px solid #f0e5dc;
  border-radius: 16px;
  background: #fffdfa;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.form :global(.field input:focus) {
  border-color: var(--teal-strong);
  outline: 3px solid rgba(142, 218, 224, 0.34);
  outline-offset: 1px;
}

.submitButton {
  width: 100%;
  min-height: 3.15rem;
  margin-top: 0.25rem;
  border-radius: 999px;
  letter-spacing: 0;
  box-shadow: 0 12px 22px rgba(232, 89, 110, 0.26);
}

.submitButton:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  box-shadow: none;
}

.message {
  padding: 0.75rem 0.9rem;
  border: 1px solid #ffc9c2;
  border-radius: 16px;
  background: #fff0ed;
  color: #8e2f2f;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
}

@media (max-width: 780px) {
  .page {
    min-height: 100svh;
    padding: 0;
    place-items: stretch;
  }

  .loginShell {
    min-height: 100svh;
    grid-template-columns: 1fr;
    grid-template-rows: clamp(220px, 38svh, 310px) minmax(0, 1fr);
    border: none;
    border-radius: 0;
    box-shadow: none;
  }

  .visualPanel {
    min-height: 0;
    height: 100%;
    padding: 0.85rem 1rem 0;
    display: grid;
    grid-template-columns: minmax(88px, 0.42fr) minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    align-items: center;
    column-gap: 0.75rem;
    row-gap: 0;
  }

  .visualPanel::after {
    bottom: -100px;
    height: 162px;
  }

  .cornerDeco {
    width: clamp(56px, 17vw, 82px);
  }

  .cornerDecoLeft {
    top: 0.45rem;
    left: 0.45rem;
  }

  .cornerDecoRight {
    top: 0.45rem;
    right: 0.35rem;
  }

  .cloudBadge {
    grid-column: 1;
    grid-row: 1;
    justify-self: center;
    width: clamp(92px, 29vw, 126px);
    margin-top: 0;
    border-width: 5px;
  }

  .visualCopy {
    grid-column: 2;
    grid-row: 1;
    justify-self: stretch;
    gap: 0.16rem;
    text-align: left;
  }

  .visualCopy span {
    font-size: 0.72rem;
  }

  .visualCopy h1 {
    font-size: clamp(2.05rem, 10vw, 2.85rem);
    line-height: 0.92;
  }

  .visualCopy p {
    max-width: 24ch;
    font-size: 0.85rem;
    line-height: 1.24;
  }

  .balanceStage {
    grid-column: 1 / -1;
    grid-row: 2;
    place-self: end center;
    width: clamp(150px, 50vw, 230px);
    margin: -0.4rem auto -1.15rem;
  }

  .balanceStage::before {
    bottom: 7%;
  }

  .loginPanel {
    min-height: 0;
    padding: 1.05rem 1.2rem max(1.15rem, env(safe-area-inset-bottom));
    justify-content: flex-start;
    gap: 0.8rem;
  }

  .loginIntro {
    gap: 0.18rem;
  }

  .loginIntro span {
    font-size: 0.74rem;
  }

  .loginIntro h2 {
    font-size: clamp(1.85rem, 9vw, 2.35rem);
  }

  .form {
    gap: 0.68rem;
  }

  .form :global(.field) {
    gap: 0.34rem;
  }

  .form :global(.field input) {
    min-height: 2.75rem;
    padding: 0.62rem 0.8rem;
    border-radius: 15px;
  }

  .submitButton {
    min-height: 2.9rem;
    margin-top: 0.1rem;
  }
}

@media (max-width: 420px) {
  .visualPanel {
    grid-template-columns: minmax(82px, 0.38fr) minmax(0, 1fr);
    column-gap: 0.6rem;
  }

  .cornerDeco {
    width: 58px;
  }

  .visualCopy h1 {
    font-size: clamp(1.9rem, 10vw, 2.28rem);
  }

  .visualCopy p {
    font-size: 0.8rem;
  }

  .balanceStage {
    width: clamp(145px, 52vw, 196px);
    margin-bottom: -0.95rem;
  }
}

@media (max-width: 420px) and (max-height: 700px) {
  .loginShell {
    grid-template-rows: 208px minmax(0, 1fr);
  }

  .visualCopy p {
    max-width: 22ch;
  }

  .balanceStage {
    width: 142px;
    margin-bottom: -1.25rem;
  }

  .loginPanel {
    padding-top: 0.85rem;
    gap: 0.65rem;
  }

  .form {
    gap: 0.55rem;
  }
}
