:root {
  --brand-blue: #2b4e9a;
  --brand-blue-deep: #17356f;
  --brand-blue-soft: #eaf0fb;
  --ink: #111b34;
  --muted: #68738c;
  --line: #dce3ef;
  --surface: #ffffff;
  --page: #ffffff;
}

html {
  min-width: 320px;
  color-scheme: light;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: Poppins, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.login-shell,
.login-shell *,
.login-shell *::before,
.login-shell *::after {
  box-sizing: border-box;
}

.login-shell button,
.login-shell input {
  font: inherit;
}

.login-shell a {
  color: inherit;
}

.login-shell {
  display: grid;
  grid-template-columns: minmax(0, 58%) minmax(430px, 42%);
  min-height: 100svh;
  overflow: hidden;
}

.login-visual {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  isolation: isolate;
  background: #f4f6fa;
}

.login-visual__image {
  position: absolute;
  inset: 0;
  z-index: -5;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 34% center;
  filter: brightness(1.02) saturate(0.98);
  transform: scale(1.015);
  animation: login-image-breathe 14s ease-in-out infinite alternate;
}

.login-visual__veil {
  position: absolute;
  inset: 0;
  z-index: -4;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02) 0%, rgba(230, 236, 248, 0.08) 54%, rgba(209, 220, 241, 0.18) 100%);
}

.login-visual__fade {
  position: absolute;
  inset: 0 auto 0 0;
  z-index: -2;
  width: 78%;
  background: linear-gradient(90deg, rgba(43, 78, 154, 0.9) 0%, rgba(43, 78, 154, 0.72) 40%, rgba(43, 78, 154, 0.34) 70%, rgba(43, 78, 154, 0) 100%);
  pointer-events: none;
}

.login-visual__content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  min-height: 100svh;
  padding: clamp(34px, 5vw, 78px) clamp(34px, 6vw, 94px) clamp(40px, 6vw, 82px);
}

.login-visual__logo {
  width: min(285px, 42%);
  height: auto;
  object-fit: contain;
  object-position: left center;
}

.login-visual__message {
  position: absolute;
  top: 50%;
  left: clamp(34px, 6vw, 94px);
  width: min(600px, 72%);
  color: #fff;
  text-align: left;
  text-shadow: 0 4px 20px rgba(27, 55, 116, 0.18);
  transform: translateY(-50%);
}

.login-kicker {
  display: block;
  margin-bottom: 14px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.login-kicker--blue {
  margin-bottom: 10px;
  color: var(--brand-blue);
}

.login-visual h1 {
  max-width: 640px;
  margin: 0;
  color: #fff;
  font-size: clamp(2.35rem, 4.6vw, 5rem);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.055em;
  text-wrap: balance;
}

.brand-spark {
  position: absolute;
  z-index: 1;
  display: block;
  width: 42px;
  aspect-ratio: 1;
  background: rgba(255, 255, 255, 0.62);
  clip-path: polygon(50% 0, 60% 38%, 100% 50%, 60% 62%, 50% 100%, 40% 62%, 0 50%, 40% 38%);
  filter: drop-shadow(0 0 18px rgba(255, 255, 255, 0.24));
  animation: login-spark-float 7s ease-in-out infinite;
  pointer-events: none;
}

.brand-spark--one { top: 19%; left: 11%; width: 42px; }
.brand-spark--two { top: 8%; left: 34%; width: 18px; opacity: 0.65; animation-delay: -2.5s; }
.brand-spark--three { top: 24%; left: 55%; width: 27px; opacity: 0.46; animation-delay: -4.5s; }
.brand-spark--four { top: 36%; left: 27%; width: 13px; animation-duration: 8.5s; animation-delay: -1.4s; }
.brand-spark--five { top: 48%; left: 61%; width: 11px; animation-duration: 6.4s; animation-delay: -3.1s; }
.brand-spark--six { right: auto; bottom: 9%; left: 44%; width: 23px; animation-duration: 9.2s; animation-delay: -5.8s; }
.brand-spark--seven { top: 7%; left: 59%; width: 9px; animation-duration: 7.6s; animation-delay: -4.2s; }
.brand-spark--eight { top: 29%; left: 41%; width: 9px; animation-duration: 6.8s; animation-delay: -2.2s; }
.brand-spark--nine { top: 44%; left: 4%; width: 16px; animation-duration: 8.1s; animation-delay: -5.1s; }
.brand-spark--ten { bottom: 35%; left: 14%; width: 11px; animation-duration: 7.2s; animation-delay: -3.7s; }
.brand-spark--eleven { right: auto; bottom: 18%; left: 58%; width: 16px; animation-duration: 9.6s; animation-delay: -6.4s; }
.brand-spark--twelve { top: 4%; right: auto; left: 47%; width: 20px; animation-duration: 10.2s; animation-delay: -7.1s; }
.brand-spark--thirteen { bottom: 4%; left: 22%; width: 12px; animation-duration: 6.2s; animation-delay: -1.8s; }
.brand-spark--fourteen { bottom: 8%; left: 6%; width: 27px; opacity: 0.58; animation-duration: 8.8s; animation-delay: -3.9s; }
.brand-spark--fifteen { bottom: 22%; left: 3%; width: 10px; opacity: 0.7; animation-duration: 6.9s; animation-delay: -5.4s; }
.brand-spark--sixteen { bottom: 12%; left: 31%; width: 8px; opacity: 0.62; animation-duration: 7.7s; animation-delay: -2.7s; }
.brand-spark--seventeen { top: 63%; left: 5%; width: 21px; opacity: 0.48; animation-duration: 9.4s; animation-delay: -6.1s; }
.brand-spark--eighteen { top: 69%; left: 51%; width: 12px; opacity: 0.68; animation-duration: 7.1s; animation-delay: -3.3s; }
.brand-spark--nineteen { right: auto; bottom: 29%; left: 37%; width: 8px; opacity: 0.72; animation-duration: 6.6s; animation-delay: -4.8s; }
.brand-spark--twenty { top: 16%; left: 47%; width: 10px; opacity: 0.64; animation-duration: 8.2s; animation-delay: -2.1s; }
.brand-spark--twenty-one { top: 34%; left: 62%; width: 17px; opacity: 0.44; animation-duration: 10s; animation-delay: -7.4s; }
.brand-spark--twenty-two { right: auto; bottom: 42%; left: 62%; width: 10px; opacity: 0.58; animation-duration: 7.5s; animation-delay: -5.7s; }
.brand-spark--twenty-three { top: 57%; left: 22%; width: 18px; opacity: 0.5; animation-duration: 8.9s; animation-delay: -4.1s; }
.brand-spark--twenty-four { top: 69%; left: 32%; width: 10px; opacity: 0.7; animation-duration: 6.7s; animation-delay: -2.9s; }
.brand-spark--twenty-five { top: 78%; left: 12%; width: 20px; opacity: 0.46; animation-duration: 9.7s; animation-delay: -6.8s; }
.brand-spark--twenty-six { top: 84%; left: 52%; width: 11px; opacity: 0.66; animation-duration: 7.3s; animation-delay: -5.2s; }

.login-panel {
  position: relative;
  z-index: 4;
  display: grid;
  min-height: 100svh;
  background: var(--page);
}

.login-panel__inner {
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: min(100%, 610px);
  margin-inline: auto;
  padding: 34px clamp(32px, 5vw, 78px) 26px;
}

.catalog-link {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 9px;
  margin-bottom: clamp(24px, 5vh, 56px);
  color: #4f5c76;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 180ms ease, transform 180ms ease;
}

.catalog-link:hover {
  color: var(--brand-blue);
  transform: translateX(-3px);
}

.login-card {
  animation: login-form-arrive 620ms cubic-bezier(0.2, 0.75, 0.2, 1) both;
}

.login-card__logo {
  display: none;
  width: 210px;
  max-width: 58vw;
  height: auto;
  margin-bottom: 32px;
}

.login-card h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(1.6rem, 1.9vw, 2rem);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.035em;
  white-space: nowrap;
}

.login-card__intro {
  margin: 15px 0 0;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.7;
}

.login-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 20px;
  padding: 13px 15px;
  border: 1px solid #f0c9ce;
  border-radius: 13px;
  background: #fff2f4;
  color: #a82236;
  font-size: 0.76rem;
  line-height: 1.5;
}

.login-alert i {
  margin-top: 3px;
}

.login-form {
  display: grid;
  gap: 18px;
  margin-top: 28px;
}

.field {
  display: grid;
  gap: 8px;
  margin: 0;
  color: #25304a;
  font-size: 0.78rem;
  font-weight: 600;
}

.field__control {
  position: relative;
  display: flex;
  align-items: center;
}

.field__control > i {
  position: absolute;
  left: 17px;
  color: #73809a;
  pointer-events: none;
  transition: color 180ms ease;
}

.field__control input {
  width: 100%;
  height: 54px;
  margin: 0;
  padding: 0 52px 0 47px;
  border: 1px solid var(--line);
  border-radius: 14px;
  outline: none;
  background: #fff;
  color: var(--ink);
  font-size: 0.88rem;
  box-shadow: 0 5px 18px rgba(25, 48, 92, 0.035);
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.field__control input::placeholder { color: #97a1b4; }
.field__control:focus-within input { border-color: var(--brand-blue); box-shadow: 0 0 0 4px rgba(43, 78, 154, 0.1), 0 10px 24px rgba(43, 78, 154, 0.07); }
.field__control:focus-within > i { color: var(--brand-blue); }

.password-toggle {
  position: absolute;
  right: 8px;
  display: grid;
  width: 38px;
  height: 38px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #748098;
  cursor: pointer;
  transition: color 180ms ease, background 180ms ease;
}

.password-toggle:hover,
.password-toggle:focus-visible {
  outline: none;
  background: var(--brand-blue-soft);
  color: var(--brand-blue);
}

.form-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: -2px;
  font-size: 0.74rem;
}

.form-options > a,
.terms-option a {
  color: var(--brand-blue);
  font-weight: 600;
  text-underline-offset: 3px;
}

.form-options > a { text-decoration: none; }
.form-options > a:hover { text-decoration: underline; }

.check-option,
.terms-option {
  display: inline-flex;
  align-items: flex-start;
  gap: 9px;
  margin: 0;
  color: #626e85;
  cursor: pointer;
}

.check-option input,
.terms-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.check-option > span,
.terms-option > span {
  position: relative;
  display: grid;
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  place-items: center;
  border: 1.5px solid #bdc6d7;
  border-radius: 6px;
  background: #fff;
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.check-option input:checked + span,
.terms-option input:checked + span {
  border-color: var(--brand-blue);
  background: var(--brand-blue);
  box-shadow: 0 0 0 3px rgba(43, 78, 154, 0.11);
}

.check-option input:checked + span::after,
.terms-option input:checked + span::after {
  width: 8px;
  height: 4px;
  border-bottom: 2px solid #fff;
  border-left: 2px solid #fff;
  content: "";
  transform: translateY(-1px) rotate(-45deg);
}

.check-option input:focus-visible + span,
.terms-option input:focus-visible + span {
  outline: 3px solid rgba(43, 78, 154, 0.18);
  outline-offset: 2px;
}

.terms-option { line-height: 1.5; }
.terms-option small { font-size: 0.68rem; }

.login-submit {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 56px;
  margin-top: 2px;
  padding: 0 19px 0 23px;
  border: 0;
  border-radius: 15px;
  background: var(--brand-blue);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 14px 30px rgba(43, 78, 154, 0.25);
  transition: background 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.login-submit i { transition: transform 180ms ease; }
.login-submit:hover { background: var(--brand-blue-deep); box-shadow: 0 17px 36px rgba(43, 78, 154, 0.31); transform: translateY(-2px); }
.login-submit:hover i { transform: translateX(3px); }
.login-submit:focus-visible { outline: 4px solid rgba(43, 78, 154, 0.18); outline-offset: 3px; }

.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 27px 0 17px;
  color: #8993a6;
  font-size: 0.67rem;
  text-align: center;
}

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

.support-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

.support-actions > a {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  text-decoration: none;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.support-actions > a:hover {
  border-color: #b8c8e6;
  background: #f9fbff;
  transform: translateY(-2px);
}

.support-actions > a > i {
  display: grid;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 11px;
  background: var(--brand-blue-soft);
  color: var(--brand-blue);
  font-size: 1rem;
}

.support-actions span { display: grid; min-width: 0; }
.support-actions strong { color: #28334b; font-size: 0.73rem; }
.support-actions small { overflow: hidden; color: #7b869b; font-size: 0.61rem; text-overflow: ellipsis; white-space: nowrap; }

.login-footer {
  margin: auto 0 0;
  padding-top: clamp(28px, 5vh, 54px);
  color: #8a94a7;
  font-size: 0.63rem;
  text-align: center;
}

@keyframes login-image-breathe {
  from { transform: scale(1.015) translate3d(0, 0, 0); }
  to { transform: scale(1.055) translate3d(-0.8%, -0.4%, 0); }
}

@keyframes login-spark-float {
  0%, 100% { opacity: 0.42; transform: translate3d(0, 0, 0) scale(0.9) rotate(0); }
  50% { opacity: 0.88; transform: translate3d(0, -14px, 0) scale(1.08) rotate(10deg); }
}

@keyframes login-form-arrive {
  from { opacity: 0; transform: translate3d(22px, 0, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

@media (max-width: 1180px) {
  .login-shell { grid-template-columns: minmax(0, 52%) minmax(420px, 48%); }
  .login-visual__content { padding-inline: 48px; }
  .login-visual__message { width: 82%; }
}

@media (max-width: 880px) {
  .login-shell { display: block; overflow: visible; background: var(--page); }
  .login-visual { min-height: clamp(290px, 39svh, 380px); }
  .login-visual__image { object-position: 42% 55%; }
  .login-visual__veil { background: linear-gradient(180deg, rgba(43, 78, 154, 0.22) 0%, rgba(43, 78, 154, 0.42) 48%, rgba(43, 78, 154, 0.72) 100%); }
  .login-visual__fade { inset: auto 0 0; width: auto; height: 115px; background: linear-gradient(180deg, rgba(43, 78, 154, 0), rgba(43, 78, 154, 0.82) 72%, var(--brand-blue) 100%); }
  .login-visual__content { min-height: clamp(290px, 39svh, 380px); padding: 28px 24px 62px; }
  .login-visual__logo { width: 215px; }
  .login-visual__message { top: 54%; left: 24px; width: min(560px, calc(100% - 48px)); }
  .login-visual h1 { font-size: clamp(2rem, 7.5vw, 3.3rem); }
  .brand-spark--three,
  .brand-spark--seven,
  .brand-spark--eleven,
  .brand-spark--twelve,
  .brand-spark--twenty,
  .brand-spark--twenty-one,
  .brand-spark--twenty-two,
  .brand-spark--twenty-four,
  .brand-spark--twenty-six { display: none; }
  .login-panel { min-height: auto; margin-top: -38px; border-radius: 34px 34px 0 0; box-shadow: 0 -18px 40px rgba(17, 35, 72, 0.08); }
  .login-panel__inner { width: min(100%, 620px); padding: 28px 24px calc(28px + env(safe-area-inset-bottom)); }
  .catalog-link { margin-bottom: 30px; }
  .login-card__logo { display: block; }
}

@media (max-width: 540px) {
  .login-visual { min-height: 310px; }
  .login-visual__image { object-position: 34% 54%; }
  .login-visual__content { min-height: 310px; padding-inline: 20px; }
  .login-visual__logo { width: 184px; }
  .login-visual__message { top: 56%; left: 20px; width: calc(100% - 40px); }
  .login-visual h1 { max-width: 360px; font-size: clamp(2rem, 10vw, 2.75rem); }
  .brand-spark--one { left: auto; right: 8%; }
  .brand-spark--two,
  .brand-spark--three,
  .brand-spark--six,
  .brand-spark--seven,
  .brand-spark--nine,
  .brand-spark--eleven,
  .brand-spark--twelve,
  .brand-spark--thirteen,
  .brand-spark--fifteen,
  .brand-spark--eighteen,
  .brand-spark--twenty,
  .brand-spark--twenty-one,
  .brand-spark--twenty-two { display: none; }
  .login-panel__inner { padding-inline: 19px; }
  .catalog-link { margin-bottom: 27px; }
  .login-card h2 { font-size: 1.55rem; }
  .form-options { align-items: flex-start; }
  .form-options > a { max-width: 48%; text-align: right; }
  .support-actions { grid-template-columns: 1fr; }
  .support-actions small { white-space: normal; }
}

@media (max-height: 880px) and (min-width: 881px) {
  .login-panel__inner { justify-content: flex-start; max-height: 100svh; overflow-y: auto; }
  .catalog-link { margin-bottom: 22px; }
  .login-card h2 { font-size: 1.85rem; }
  .login-form { gap: 14px; margin-top: 21px; }
  .field__control input { height: 50px; }
  .login-divider { margin-block: 20px 13px; }
  .login-footer { padding-top: 24px; }
}

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