:root {
  --navy-950: #052743;
  --navy-900: #062f50;
  --navy-800: #0a416b;
  --ink: #082b4d;
  --muted: #5b7190;
  --blue: #347fe6;
  --blue-hover: #246fd7;
  --copper: #db9383;
  --line: #ccd8e7;
  --success: #168869;
  --white: #ffffff;
  --shadow: 0 16px 36px rgba(20, 73, 126, 0.16);
  color-scheme: light;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  background: var(--white);
}

body {
  color: var(--ink);
  overflow-x: hidden;
}

button,
input {
  font: inherit;
}

a {
  color: #176fdb;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.auth-shell {
  display: grid;
  grid-template-columns: minmax(0, 54.8%) minmax(420px, 45.2%);
  min-height: 100svh;
  background: #fff;
}

.brand-panel {
  position: relative;
  isolation: isolate;
  min-height: 100svh;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 88% 90%, rgba(38, 127, 194, 0.42), transparent 28%),
    radial-gradient(circle at 12% 34%, rgba(0, 17, 34, 0.16), transparent 40%),
    linear-gradient(135deg, var(--navy-950) 0%, var(--navy-900) 60%, #084e79 120%);
  clip-path: polygon(0 0, 100% 0, 100% 96.7%, 87% 100%, 0 100%);
}

.brand-panel::before {
  content: "";
  position: absolute;
  z-index: -2;
  inset: 42% 0 0 22%;
  opacity: 0.47;
  background-image:
    linear-gradient(rgba(160, 193, 219, 0.17) 1px, transparent 1px),
    linear-gradient(90deg, rgba(160, 193, 219, 0.17) 1px, transparent 1px);
  background-size: 74px 72px;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 14%, #000 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 14%, #000 100%);
}

.brand-panel::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, transparent 72%, rgba(10, 87, 132, 0.14));
}

.brand-logo {
  position: absolute;
  top: clamp(28px, 4.6vh, 48px);
  left: clamp(38px, 5vw, 76px);
  width: clamp(190px, 14.4vw, 230px);
  height: auto;
}

.brand-copy {
  position: absolute;
  z-index: 2;
  top: clamp(174px, 20vh, 212px);
  left: clamp(38px, 5vw, 76px);
  width: min(690px, calc(100% - 104px));
}

.brand-copy h1 {
  max-width: 690px;
  margin: 0;
  color: #fff;
  font-size: clamp(48px, 5vw, 76px);
  font-weight: 800;
  line-height: 1.06;
  letter-spacing: -0.052em;
}

.brand-copy h1 em {
  color: var(--copper);
  font-style: normal;
}

.brand-copy p {
  max-width: 510px;
  margin: 30px 0 0;
  color: rgba(235, 244, 251, 0.78);
  font-size: clamp(19px, 1.65vw, 26px);
  font-weight: 400;
  line-height: 1.42;
}

.brand-route {
  position: absolute;
  z-index: 1;
  right: 0;
  bottom: 7.6%;
  left: 0;
  width: 100%;
  height: 47%;
  overflow: visible;
  pointer-events: none;
}

.brand-route .route-path {
  fill: none;
  stroke: var(--copper);
  stroke-width: 2.2;
  vector-effect: non-scaling-stroke;
}

.brand-route .route-node {
  fill: var(--navy-900);
  stroke: var(--copper);
  stroke-width: 3;
  vector-effect: non-scaling-stroke;
}

.brand-route .route-task {
  fill: url(#taskGradient);
  opacity: 0.95;
}

.brand-route .route-ghost {
  fill: url(#ghostGradient);
  opacity: 0.72;
}

.brand-values {
  position: absolute;
  z-index: 2;
  bottom: 3.7%;
  left: clamp(38px, 5vw, 76px);
  margin: 0;
  color: rgba(222, 235, 245, 0.74);
  font-size: 12px;
  line-height: 1.7;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.brand-values::after {
  content: "";
  display: block;
  width: 24px;
  height: 1px;
  margin-top: 10px;
  background: rgba(255, 255, 255, 0.75);
}

.form-panel {
  display: grid;
  min-height: 100svh;
  place-items: center;
  padding: 52px clamp(42px, 6.2vw, 92px);
  background: #fff;
}

.form-wrap {
  width: min(100%, 500px);
}

.form-wrap > header h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(44px, 4.25vw, 64px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.05em;
}

.form-wrap > header p {
  max-width: 500px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: clamp(18px, 1.8vw, 26px);
  line-height: 1.38;
}

.auth-form {
  margin-top: clamp(34px, 5.1vh, 54px);
}

.field {
  margin-bottom: 22px;
}

.field-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.field label {
  display: inline-block;
  margin-bottom: 9px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 650;
}

.field-head small {
  color: #7385a0;
  font-size: 13px;
}

.input-wrap {
  position: relative;
}

.field input[type="email"],
.field input[type="text"],
.field input[type="password"] {
  width: 100%;
  height: 64px;
  padding: 0 20px;
  border: 1px solid #b9c9dc;
  border-radius: 5px;
  outline: none;
  color: var(--ink);
  background: #fff;
  font-size: 16px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.field input::placeholder {
  color: #99aac2;
}

.field input:hover {
  border-color: #8ea8c5;
}

.field input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(52, 127, 230, 0.12);
}

.password-input input {
  padding-right: 58px !important;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 15px;
  display: grid;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  place-items: center;
  transform: translateY(-50%);
  color: #7792b8;
  background: transparent;
  cursor: pointer;
}

.password-toggle:hover,
.password-toggle:focus-visible {
  color: var(--blue);
  background: #eef5ff;
}

.password-toggle svg {
  width: 22px;
  height: 22px;
}

.hint {
  margin: 8px 0 0;
  color: #687d9a;
  font-size: 13px;
  line-height: 1.4;
}

.form-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 4px 0 28px;
  font-size: 14px;
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  color: #2e4966;
  line-height: 1.45;
}

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

.register-consent {
  margin: 5px 0 26px;
  font-size: 13px;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 64px;
  padding: 15px 28px;
  border: 0;
  border-radius: 5px;
  color: #fff;
  background: linear-gradient(135deg, #2f78de, #3a88ef);
  box-shadow: 0 12px 28px rgba(41, 111, 211, 0.2);
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.primary-button:hover {
  background: linear-gradient(135deg, #276fd6, #2d7de6);
  box-shadow: 0 15px 34px rgba(41, 111, 211, 0.27);
  transform: translateY(-1px);
}

.primary-button:active {
  transform: translateY(0);
}

.primary-button:focus-visible,
.back-link:focus-visible,
.auth-footer a:focus-visible {
  outline: 3px solid rgba(52, 127, 230, 0.28);
  outline-offset: 3px;
}

.form-message {
  min-height: 22px;
  margin: 13px 0 0;
  color: var(--success);
  font-size: 14px;
  text-align: center;
}

.auth-footer {
  margin-top: 58px;
  padding-top: 36px;
  border-top: 1px solid #d4deea;
  color: #24415f;
  font-size: 15px;
  text-align: center;
}

.auth-footer p {
  margin: 0;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: 32px;
  font-size: 15px;
  font-weight: 600;
}

.back-link span {
  font-size: 25px;
  font-weight: 300;
  line-height: 1;
}

.success-state {
  display: none;
  margin-top: 42px;
}

.success-state.is-visible {
  display: block;
  animation: formReveal 480ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.success-box {
  display: flex;
  align-items: center;
  gap: 17px;
  padding: 22px 24px;
  border: 1px solid #caebe2;
  border-radius: 6px;
  background: #eef9f6;
}

.success-icon {
  display: grid;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  border-radius: 50%;
  place-items: center;
  color: #fff;
  background: var(--success);
  font-size: 26px;
  font-weight: 700;
}

.success-box strong,
.success-box span {
  display: block;
}

.success-box strong {
  margin-bottom: 4px;
  color: var(--ink);
  font-size: 17px;
}

.success-box span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
}

.auth-ready .brand-logo,
.auth-ready .brand-copy,
.auth-ready .brand-values,
.auth-ready .form-wrap {
  opacity: 0;
}

.auth-ready.is-loaded .brand-logo,
.auth-ready.is-loaded .brand-copy,
.auth-ready.is-loaded .brand-values,
.auth-ready.is-loaded .form-wrap {
  animation: formReveal 720ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.auth-ready.is-loaded .brand-copy {
  animation-delay: 100ms;
}

.auth-ready.is-loaded .brand-values {
  animation-delay: 220ms;
}

.auth-ready.is-loaded .form-wrap {
  animation-delay: 170ms;
}

.auth-ready .brand-route .route-path {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}

.auth-ready.is-loaded .brand-route .route-path {
  animation: drawRoute 1450ms 170ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes formReveal {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes drawRoute {
  to { stroke-dashoffset: 0; }
}

@media (max-width: 1050px) {
  .auth-shell {
    grid-template-columns: minmax(0, 47%) minmax(420px, 53%);
  }

  .brand-copy h1 {
    font-size: clamp(44px, 5.5vw, 60px);
  }
}

@media (max-width: 900px) {
  .auth-shell {
    display: block;
  }

  .brand-panel {
    min-height: 310px;
    clip-path: polygon(0 0, 100% 0, 100% 92%, 62% 100%, 0 96%);
  }

  .brand-panel::before {
    inset: 22% 0 0 38%;
    background-size: 64px 58px;
  }

  .brand-logo {
    top: 24px;
    left: 25px;
    width: 174px;
  }

  .brand-copy {
    top: 112px;
    left: 25px;
    width: calc(100% - 50px);
  }

  .brand-copy h1 {
    max-width: 590px;
    font-size: clamp(34px, 8vw, 54px);
  }

  .brand-copy p {
    margin-top: 14px;
    font-size: 17px;
  }

  .brand-route {
    right: -18%;
    bottom: -32%;
    left: 28%;
    width: 92%;
    height: 82%;
    opacity: 0.78;
  }

  .brand-values {
    display: none;
  }

  .form-panel {
    min-height: auto;
    padding: 54px 25px 46px;
  }

  .form-wrap {
    width: min(100%, 560px);
  }
}

@media (max-width: 520px) {
  .brand-panel {
    min-height: 280px;
  }

  .brand-copy {
    top: 106px;
  }

  .brand-copy h1 {
    font-size: 37px;
  }

  .brand-copy p {
    max-width: 340px;
    font-size: 15px;
  }

  .form-panel {
    padding-top: 42px;
  }

  .form-wrap > header h2 {
    font-size: 42px;
  }

  .form-wrap > header p {
    font-size: 18px;
  }

  .auth-form {
    margin-top: 34px;
  }

  .field input[type="email"],
  .field input[type="text"],
  .field input[type="password"],
  .primary-button {
    height: 58px;
    min-height: 58px;
  }

  .form-options {
    align-items: flex-start;
    flex-direction: column;
  }

  .auth-footer {
    margin-top: 42px;
    padding-top: 28px;
  }
}

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