:root {
  --chs-blue: #1f2a78;
  --chs-blue-2: #263a9a;
  --chs-blue-3: #17205f;
  --chs-orange: #f97316;

  --ink: #0f172a;
  --muted: #64748b;
  --line: #dbe3ee;
  --surface: #ffffff;

  --success-bg: #ecfdf3;
  --success-text: #166534;

  --error-bg: #fff1f2;
  --error-text: #b42318;
}


/* =========================================================
   BASE
   ========================================================= */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  min-height: 100%;
}

body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;

  padding: 32px;
  overflow-x: hidden;

  font-family: "Inter", sans-serif;
  color: var(--ink);

  background:
    radial-gradient(circle at 12% 18%, rgba(31, 42, 120, 0.16), transparent 32%),
    radial-gradient(circle at 86% 80%, rgba(249, 115, 22, 0.10), transparent 25%),
    linear-gradient(145deg, #f8fafc 0%, #eaf0f7 100%);
}

body::before,
body::after {
  content: "";
  position: fixed;

  border-radius: 999px;
  border: 1px solid rgba(31, 42, 120, 0.10);

  pointer-events: none;
  filter: blur(2px);
}

body::before {
  width: 340px;
  height: 340px;

  left: -160px;
  top: -150px;

  animation: ambientFloat 9s ease-in-out infinite;
}

body::after {
  width: 520px;
  height: 520px;

  right: -280px;
  bottom: -320px;

  animation: ambientFloat 12s 1.2s ease-in-out infinite reverse;
}


/* =========================================================
   AUTH SHELL
   ========================================================= */

.auth-shell {
  position: relative;
  isolation: isolate;

  width: min(980px, 100%);
  min-height: 560px;

  display: grid;
  grid-template-columns: 1fr 1fr;

  overflow: hidden;

  background: var(--surface);

  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 26px;

  box-shadow:
    0 36px 90px rgba(15, 23, 42, 0.18),
    0 6px 18px rgba(15, 23, 42, 0.06);

  animation: shellEnter 0.75s cubic-bezier(0.16, 1, 0.3, 1) both;
}


/* =========================================================
   FORM PANELS
   ========================================================= */

.form-panel {
  position: relative;
  z-index: 6;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 54px 58px;

  transition:
    opacity 0.28s ease,
    transform 0.58s cubic-bezier(0.22, 1, 0.36, 1);
}

.form-panel--reset {
  grid-column: 2;
  grid-row: 1;

  opacity: 0;
  pointer-events: none;

  transform: translateX(54px);
}

.auth-shell.reset-mode .form-panel--login {
  opacity: 0;
  pointer-events: none;

  transform: translateX(-54px);
}

.auth-shell.reset-mode .form-panel--reset {
  opacity: 0;
  pointer-events: none;

  transform: translateX(54px);
}

.auth-shell.reset-mode.reveal-reset .form-panel--reset {
  opacity: 1;
  pointer-events: auto;

  transform: translateX(0);
}

.auth-shell.returning-login .form-panel--login {
  opacity: 0;
  pointer-events: none;

  transform: translateX(-54px);
}

.auth-shell.returning-login.reveal-login .form-panel--login {
  opacity: 1;
  pointer-events: auto;

  transform: translateX(0);
}

.form-inner {
  position: relative;
  z-index: 7;

  width: min(360px, 100%);
}


/* =========================================================
   MINI BRAND
   ========================================================= */

.brand-mini {
  display: flex;
  align-items: center;
  gap: 12px;

  margin-bottom: 34px;
}

.brand-mini img {
  width: 72px;
  height: 72px;

  object-fit: contain;
}

.brand-mini-copy strong {
  display: block;

  color: var(--chs-blue);

  font-size: 14px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.brand-mini-copy span {
  display: block;

  margin-top: 4px;

  color: var(--muted);

  font-size: 12px;
}


/* =========================================================
   TYPOGRAPHY
   ========================================================= */

.eyebrow {
  margin-bottom: 10px;

  color: var(--chs-orange);

  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 {
  margin-bottom: 12px;

  font-size: clamp(30px, 4vw, 42px);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.subtitle {
  margin-bottom: 28px;

  color: var(--muted);

  font-size: 14px;
  line-height: 1.65;
}


/* =========================================================
   FORM FIELDS
   ========================================================= */

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;

  margin-bottom: 8px;

  color: #334155;

  font-size: 13px;
  font-weight: 700;
}

.input-wrap {
  position: relative;
}

input[type="email"],
input[type="password"],
input[type="text"] {
  width: 100%;
  height: 50px;

  padding: 0 46px 0 14px;

  border: 1px solid var(--line);
  border-radius: 12px;

  outline: none;

  background: #fbfdff;
  color: var(--ink);

  font: inherit;
  font-size: 14px;

  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
}

input:focus {
  background: #ffffff;

  border-color: rgba(31, 42, 120, 0.70);

  box-shadow: 0 0 0 4px rgba(31, 42, 120, 0.10);
}

.field-icon,
.toggle-password {
  position: absolute;

  right: 14px;
  top: 50%;

  transform: translateY(-50%);

  color: #7b8aa0;

  line-height: 1;
}

.field-icon {
  transition:
    color 0.2s ease,
    transform 0.2s ease;
}

.input-wrap:focus-within .field-icon {
  color: var(--chs-blue);

  transform: translateY(-50%) scale(1.08);
}

.toggle-password {
  width: auto;

  padding: 4px;

  border: 0;

  background: transparent;

  cursor: pointer;

  font-size: 17px;
}


/* =========================================================
   LOGIN OPTIONS
   ========================================================= */

.login-options {
  display: flex;
  align-items: center;
  gap: 16px;

  margin: 4px 0 22px;

  font-size: 13px;
}

.login-options--single {
  justify-content: flex-start;
}

.login-options label {
  display: flex;
  align-items: center;
  gap: 8px;

  color: #475569;

  cursor: pointer;
}

.login-options input {
  width: 15px;
  height: 15px;

  accent-color: var(--chs-blue);
}


/* =========================================================
   BUTTONS + LINKS
   ========================================================= */

a,
.link-button {
  color: var(--chs-blue);

  text-decoration: none;

  font-weight: 700;
}

a:hover,
.link-button:hover {
  text-decoration: underline;
}

.link-button {
  padding: 0;

  border: 0;

  background: transparent;

  cursor: pointer;

  font: inherit;
}

.primary-button {
  position: relative;

  width: 100%;
  min-height: 50px;

  overflow: hidden;

  border: 0;
  border-radius: 12px;

  background:
    linear-gradient(135deg, var(--chs-blue), var(--chs-blue-2));

  color: #ffffff;

  font: inherit;
  font-size: 14px;
  font-weight: 800;

  cursor: pointer;

  box-shadow: 0 12px 26px rgba(31, 42, 120, 0.24);

  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    filter 0.18s ease;
}

.primary-button::before {
  content: "";

  position: absolute;
  inset: 0;

  background:
    linear-gradient(
      110deg,
      transparent 15%,
      rgba(255, 255, 255, 0.22) 48%,
      transparent 80%
    );

  transform: translateX(-120%);

  transition: transform 0.6s ease;
}

.primary-button:hover {
  transform: translateY(-1px);

  box-shadow: 0 15px 32px rgba(31, 42, 120, 0.30);
}

.primary-button:hover::before {
  transform: translateX(120%);
}

.primary-button:disabled {
  opacity: 0.78;

  cursor: wait;

  transform: none;
}


/* =========================================================
   AUTH FOOTER
   ========================================================= */

.auth-foot {
  margin-top: 22px;
  padding-top: 20px;

  border-top: 1px solid #edf1f5;

  color: var(--muted);

  text-align: center;

  font-size: 12px;
  line-height: 1.6;
}

.auth-foot .link-button {
  margin-top: 6px;

  font-size: 12px;
}


/* =========================================================
   MESSAGES
   ========================================================= */

.message {
  display: none;

  margin: 0 0 18px;
  padding: 11px 13px;

  border-radius: 10px;

  font-size: 12px;
  line-height: 1.45;
}

.message.success {
  display: block;

  background: var(--success-bg);
  color: var(--success-text);

  border: 1px solid #bbf7d0;

  animation: messageIn 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.message.error {
  display: block;

  background: var(--error-bg);
  color: var(--error-text);

  border: 1px solid #fecdd3;

  animation: messageIn 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
}


/* =========================================================
   ANIMATED BRAND PANEL
   ========================================================= */

.brand-panel {
  position: absolute;
  z-index: 5;

  inset: 0 0 0 50%;

  overflow: hidden;

  pointer-events: none;

  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.08), transparent 38%),
    linear-gradient(135deg, var(--chs-blue-3), var(--chs-blue));

  color: #ffffff;

  clip-path: polygon(16% 0, 100% 0, 100% 100%, 0 100%);

  transform: translateX(0);

  will-change: transform, clip-path;

  transition:
    transform 0.82s cubic-bezier(0.77, 0, 0.18, 1),
    clip-path 0.82s cubic-bezier(0.77, 0, 0.18, 1);
}

.auth-shell.reset-mode .brand-panel {
  inset: 0 0 0 50%;

  transform: translateX(-100%);

  clip-path: polygon(0 0, 100% 0, 84% 100%, 0 100%);
}

.brand-panel::before,
.brand-panel::after {
  content: "";

  position: absolute;

  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 50%;
}

.brand-panel::before {
  width: 360px;
  height: 360px;

  right: -160px;
  top: -130px;
}

.brand-panel::after {
  width: 220px;
  height: 220px;

  left: -100px;
  bottom: -110px;

  border-color: rgba(255, 255, 255, 0.08);
}

.brand-content {
  position: absolute;
  inset: 0;

  display: flex;
  flex-direction: column;
  justify-content: center;

  padding: 68px 64px 68px 92px;

  pointer-events: none;

  transition:
    opacity 0.24s ease,
    transform 0.62s cubic-bezier(0.22, 1, 0.36, 1);
}

.brand-content--reset {
  opacity: 0;

  padding: 68px 92px 68px 64px;

  transform: translateX(-42px);
}

.auth-shell.reset-mode .brand-content--login {
  opacity: 0;

  transform: translateX(42px);
}

.auth-shell.reset-mode .brand-content--reset {
  opacity: 1;

  transform: translateX(0);

  transition-delay: 0.34s;
}

.brand-mark {
  width: 150px;
  max-height: 118px;

  margin-bottom: 30px;

  object-fit: contain;
  object-position: left center;

  filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.18));

  animation:
    brandMarkEnter 0.7s 0.28s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.brand-kicker {
  margin-bottom: 12px;

  color: rgba(255, 255, 255, 0.68);

  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.brand-content h2 {
  max-width: 420px;

  margin-bottom: 18px;

  font-size: clamp(32px, 4vw, 47px);
  line-height: 1.03;
  letter-spacing: -0.045em;
}

.brand-content p {
  max-width: 390px;

  color: rgba(255, 255, 255, 0.76);

  font-size: 14px;
  line-height: 1.7;
}

.panel-action {
  position: relative;
  z-index: 20;

  width: fit-content;

  margin-top: 28px;
  padding: 10px 16px;

  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 999px;

  background: rgba(255, 255, 255, 0.08);

  color: #ffffff;

  font: inherit;
  font-size: 12px;
  font-weight: 800;

  cursor: pointer;

  pointer-events: auto;

  backdrop-filter: blur(6px);

  transition:
    background 0.2s ease,
    transform 0.2s ease;
}

.panel-action:hover {
  background: rgba(255, 255, 255, 0.14);

  transform: translateY(-1px);
}

.security-note {
  margin-top: auto;
  padding-top: 30px;

  color: rgba(255, 255, 255, 0.48);

  font-size: 11px;
}


/* =========================================================
   ANIMATIONS
   ========================================================= */

@keyframes shellEnter {
  from {
    opacity: 0;

    transform: translateY(18px) scale(0.985);
  }

  to {
    opacity: 1;

    transform: translateY(0) scale(1);
  }
}

@keyframes brandMarkEnter {
  from {
    opacity: 0;

    transform: translateY(12px) scale(0.96);
  }

  to {
    opacity: 1;

    transform: translateY(0) scale(1);
  }
}

@keyframes ambientFloat {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }

  50% {
    transform: translate3d(0, -10px, 0);
  }
}

@keyframes messageIn {
  from {
    opacity: 0;

    transform: translateY(-6px);
  }

  to {
    opacity: 1;

    transform: translateY(0);
  }
}

@keyframes mobileFormIn {
  from {
    opacity: 0;

    transform: translateY(16px);
  }

  to {
    opacity: 1;

    transform: translateY(0);
  }
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 760px) {
	body {
	  align-items: flex-start;
	  justify-content: center;

	  min-height: 100dvh;
	  padding: 18px;

	  overflow-x: hidden;
	}

	.auth-shell {
	  display: block;

	  width: 100%;
	  max-width: 520px;
	  min-height: 680px;

	  border-radius: 22px;

	  animation: none;
	  transform: none;
	}

  .brand-panel {
    position: relative;

    inset: auto;

    min-height: 360px;

    clip-path: none;

    pointer-events: auto;

    transition: none;
  }

  .auth-shell.reset-mode .brand-panel {
    inset: auto;

    clip-path: none;

    transform: none;
  }

  .brand-content {
    position: relative;

    min-height: 360px;

    padding: 34px 30px;

    pointer-events: none;
  }

  .brand-content--login,
  .brand-content--reset {
    position: absolute;

    inset: 0;
  }

  .brand-content--reset {
    display: flex;

    opacity: 0;

    transform: translateY(18px);
  }

  .auth-shell.reset-mode .brand-content--login {
    display: flex;

    opacity: 0;

    transform: translateY(-18px);
  }

  .auth-shell.reset-mode .brand-content--reset {
    display: flex;

    opacity: 1;

    transform: translateY(0);
  }

  .brand-mark {
    width: 105px;

    margin-bottom: 16px;
  }

  .brand-content h2 {
    margin-bottom: 10px;

    font-size: 30px;
  }

  .brand-content p {
    font-size: 13px;
  }

  .panel-action {
    display: inline-flex;

    margin-top: 18px;

    pointer-events: auto;
  }

  .security-note {
    display: none;
  }

  .form-panel {
	min-height: 320px;
    padding: 34px 26px 30px;

    transition:
      opacity 0.3s ease,
      transform 0.42s cubic-bezier(0.22, 1, 0.36, 1);
  }

  .form-panel--reset {
    display: none;
  }

  .auth-shell.reset-mode .form-panel--login {
    display: none;
  }

  .auth-shell.reset-mode .form-panel--reset {
    display: none;
  }

  .auth-shell.reset-mode.reveal-reset .form-panel--reset {
    display: flex;

    animation:
      mobileFormIn 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
  }

  .brand-mini {
    display: none;
  }
  
  input[type="email"],
  input[type="password"],
  input[type="text"] {
    font-size: 16px;
  }
}


/* =========================================================
   REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;

    scroll-behavior: auto !important;
  }
}