@font-face {
  font-family: "Public Sans";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("/assets/fonts/public-sans/public-sans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
    U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light;
  --page-1: #051433;
  --page-2: #0a2257;
  --page-3: #12357e;
  --card: #ffffff;
  --ink: #0c1b3a;
  --muted: #5b6475;
  --line: #e4e8f0;
  --focus: #b8c9ff;
  --primary: #143d91;
  --primary-2: #2c65cf;
  --danger: #be123c;
  font-family: "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Oxygen, Ubuntu, Cantarell, "Fira Sans",
    "Droid Sans", "Helvetica Neue", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(1200px 720px at -14% -16%, rgba(93, 140, 255, 0.34), rgba(93, 140, 255, 0) 54%),
    radial-gradient(1300px 760px at 106% 4%, rgba(60, 167, 217, 0.26), rgba(60, 167, 217, 0) 48%),
    radial-gradient(1400px 800px at 52% 118%, rgba(39, 94, 211, 0.22), rgba(39, 94, 211, 0) 46%),
    linear-gradient(150deg, var(--page-1) 0%, var(--page-2) 44%, var(--page-3) 100%);
}

body::before,
body::after {
  position: fixed;
  pointer-events: none;
  content: "";
}

body::before {
  inset: 0;
  opacity: 0.09;
  background-image: linear-gradient(rgba(255, 255, 255, 0.16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.16) 1px, transparent 1px);
  background-size: 84px 84px;
}

body::after {
  width: 560px;
  height: 560px;
  right: -210px;
  bottom: -240px;
  border-radius: 50%;
  background: rgba(56, 119, 232, 0.2);
  filter: blur(50px);
}

main {
  position: relative;
  z-index: 1;
}

a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.auth-shell {
  position: relative;
  display: grid;
  min-height: 100vh;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 14px;
  padding: 24px 20px 18px;
  justify-items: center;
  overflow: hidden;
}

.auth-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.auth-blob,
.auth-panel,
.finance-icon {
  position: absolute;
}

.auth-blob {
  border-radius: 50%;
  filter: blur(56px);
  opacity: 0.34;
  animation: float-soft 18s ease-in-out infinite;
}

.auth-blob.b1 {
  width: 540px;
  height: 540px;
  left: -180px;
  top: -160px;
  background: #2e63d7;
}

.auth-blob.b2 {
  width: 460px;
  height: 460px;
  right: -150px;
  top: -120px;
  background: #2e8fc4;
  animation-delay: 2.8s;
}

.auth-blob.b3 {
  width: 420px;
  height: 420px;
  left: 14%;
  bottom: -210px;
  background: #1f4ca6;
  animation-delay: 8.4s;
}

.auth-panel {
  width: 150px;
  height: 150px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  background: rgba(45, 82, 173, 0.16);
}

.auth-panel.p1 {
  top: 16%;
  left: calc(50% - 260px);
}

.auth-panel.p2 {
  right: calc(50% - 310px);
  bottom: 13%;
  border-style: dashed;
}

.finance-icon {
  display: grid;
  width: 60px;
  height: 60px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 15px;
  place-items: center;
  color: #f8fbff;
  background: linear-gradient(145deg, var(--c1, #3f8bff), var(--c2, #2558d8));
  box-shadow: 0 14px 34px rgba(5, 20, 51, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transform: rotate(var(--r, 0deg));
  animation: drift var(--dur, 12s) cubic-bezier(0.42, 0.05, 0.58, 0.95) infinite,
    glow calc(var(--dur, 12s) * 0.72) ease-in-out infinite;
  will-change: transform, filter;
}

.finance-icon svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.finance-icon.f1 {
  top: 11%;
  left: 10%;
  --r: -7deg;
  --c1: #3f8bff;
  --c2: #2558d8;
  --mx: 22px;
  --my: 15px;
  --dur: 11.5s;
}

.finance-icon.f2 {
  top: 18%;
  right: 14%;
  --r: 8deg;
  --c1: #12b7ff;
  --c2: #0666cc;
  --mx: -17px;
  --my: 18px;
  --dur: 13.2s;
}

.finance-icon.f3 {
  top: 36%;
  left: 6%;
  --r: -6deg;
  --c1: #2ec4b6;
  --c2: #1b8f84;
  --mx: 19px;
  --my: -14px;
  --dur: 10.8s;
}

.finance-icon.f4 {
  top: 46%;
  right: 9%;
  --r: 7deg;
  --c1: #8e67ff;
  --c2: #5842d8;
  --mx: -20px;
  --my: 14px;
  --dur: 12.6s;
}

.finance-icon.f5 {
  bottom: 14%;
  left: 11%;
  --r: -5deg;
  --c1: #ff8f2f;
  --c2: #d56817;
  --mx: 16px;
  --my: -17px;
  --dur: 11.9s;
}

.finance-icon.f6 {
  right: 16%;
  bottom: 8%;
  --r: 5deg;
  --c1: #ff4d8d;
  --c2: #cc2f67;
  --mx: -20px;
  --my: -14px;
  --dur: 13.8s;
}

.finance-icon.f7 {
  top: 58%;
  left: 22%;
  --r: -4deg;
  --c1: #38cf7a;
  --c2: #169a55;
  --mx: 17px;
  --my: 13px;
  --dur: 10.9s;
}

.finance-icon.f8 {
  top: 28%;
  right: 28%;
  --r: 6deg;
  --c1: #f5b942;
  --c2: #cf8a17;
  --mx: -15px;
  --my: -16px;
  --dur: 12.1s;
}

.auth-card {
  position: relative;
  z-index: 1;
  align-self: center;
  width: min(92vw, 480px);
  padding: 54px 54px 42px;
  border: 1px solid rgba(17, 45, 101, 0.14);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 24px 56px rgba(8, 26, 73, 0.3);
}

.auth-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 28px;
}

.auth-logo picture,
.auth-logo img {
  display: block;
}

.auth-logo img {
  width: 120px;
  height: auto;
  object-fit: contain;
}

.auth-header {
  margin-bottom: 34px;
  text-align: center;
}

.auth-header h1 {
  margin: 0 0 8px;
  color: #0d2f74;
  font-size: 34px;
  font-weight: 700;
  line-height: 1.1;
}

.auth-header p {
  margin: 0;
  color: #42526d;
  font-size: 16px;
  line-height: 1.5;
}

.auth-form {
  display: grid;
  gap: 18px;
}

.field {
  display: grid;
  gap: 8px;
}

.field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

label {
  color: #596173;
  font-size: 14px;
  font-weight: 500;
}

.field-row a {
  flex: 0 0 auto;
  font-size: 14px;
}

input[type="email"],
input[type="password"],
input[type="text"] {
  width: 100%;
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfcff;
  color: var(--ink);
  font: inherit;
  outline: 0;
  padding: 0 16px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

input::placeholder {
  color: #a6adbb;
}

input:focus {
  border-color: var(--focus);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(184, 201, 255, 0.34);
}

input[aria-invalid="true"] {
  border-color: #f3a3b8;
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 56px;
}

.password-toggle {
  position: absolute;
  top: 1px;
  right: 1px;
  display: grid;
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 0 11px 11px 0;
  place-items: center;
  color: #7a8395;
  background: transparent;
  cursor: pointer;
}

.password-toggle:hover,
.password-toggle:focus-visible,
.password-toggle.is-visible {
  color: var(--primary);
  background: #f4f7ff;
}

.password-toggle:focus-visible {
  outline: 3px solid rgba(184, 201, 255, 0.7);
  outline-offset: 2px;
}

.password-toggle svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.field-error {
  margin: 0;
  color: var(--danger);
  font-size: 13px;
  line-height: 1.35;
}

.check-row {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 10px;
  color: #6b7280;
  cursor: pointer;
}

.check-row input {
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--primary);
}

.submit-btn {
  min-height: 48px;
  border: 0;
  border-radius: 12px;
  color: #ffffff;
  background: linear-gradient(100deg, #0d2f74, #1f4ca6 62%, var(--primary-2));
  box-shadow: 0 12px 26px rgba(13, 47, 116, 0.32);
  cursor: pointer;
  font: inherit;
  font-weight: 500;
}

.submit-btn:hover {
  filter: brightness(0.98);
}

.submit-btn:focus-visible {
  outline: 4px solid rgba(184, 201, 255, 0.55);
  outline-offset: 3px;
}

.or-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 30px 0 16px;
  color: #7b8494;
  font-size: 12px;
}

.or-divider::before,
.or-divider::after {
  flex: 1;
  height: 1px;
  background: var(--line);
  content: "";
}

.or-divider span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  padding: 3px 11px;
}

.signup-row,
.auth-footer-note {
  margin: 0;
  text-align: center;
}

.signup-row {
  color: #9aa1ad;
  line-height: 1.5;
}

.signup-row a {
  margin-left: 4px;
}

.auth-footer-note {
  position: relative;
  z-index: 1;
  align-self: end;
  color: rgba(227, 236, 255, 0.82);
  font-size: 13px;
}

@keyframes float-soft {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(9px, -14px, 0);
  }
}

@keyframes drift {
  0%,
  100% {
    transform: translate3d(0, 0, 0) rotate(var(--r, 0deg));
  }
  25% {
    transform: translate3d(calc(var(--mx, 18px) * 0.8), calc(var(--my, 14px) * -0.7), 0)
      rotate(calc(var(--r, 0deg) + 4deg));
  }
  50% {
    transform: translate3d(calc(var(--mx, 18px) * -0.72), calc(var(--my, 14px) * 0.85), 0)
      rotate(calc(var(--r, 0deg) - 3deg));
  }
  75% {
    transform: translate3d(calc(var(--mx, 18px) * 0.55), calc(var(--my, 14px) * 0.55), 0)
      rotate(calc(var(--r, 0deg) + 2deg));
  }
}

@keyframes glow {
  0%,
  100% {
    filter: saturate(1) brightness(1);
  }
  50% {
    filter: saturate(1.14) brightness(1.06);
  }
}

@media (max-height: 760px) and (min-width: 700px) {
  .auth-shell {
    padding-top: 18px;
    padding-bottom: 12px;
  }

  .auth-card {
    padding-top: 38px;
    padding-bottom: 30px;
  }

  .auth-logo {
    margin-bottom: 20px;
  }

  .auth-logo img {
    width: 106px;
  }

  .auth-header {
    margin-bottom: 26px;
  }

  .or-divider {
    margin-top: 24px;
  }
}

@media (max-width: 991.98px) {
  .finance-icon {
    width: 52px;
    height: 52px;
    border-radius: 13px;
  }

  .finance-icon svg {
    width: 24px;
    height: 24px;
  }

  .finance-icon.f3,
  .finance-icon.f7,
  .finance-icon.f8,
  .auth-panel {
    display: none;
  }
}

@media (max-width: 560px) {
  .auth-shell {
    padding: 18px 14px 16px;
  }

  .auth-card {
    padding: 32px 22px 28px;
    border-radius: 18px;
  }

  .auth-logo {
    margin-bottom: 22px;
  }

  .auth-logo img {
    width: 104px;
  }

  .auth-header h1 {
    font-size: 28px;
  }

  .auth-header p {
    font-size: 15px;
  }

  .field-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
