:root {
  --navy: #0B1F3A;
  --navy-2: #16385F;
  --gold: #C6A15B;
  --gold-dark: #87661F;
  --ivory: #F7F4ED;
  --white: #FFFFFF;
  --ink: #14233A;
  --muted: #5B687B;
  --line: rgba(11, 31, 58, 0.14);
  --danger: #B33A4A;
  --success: #137044;
  --shadow: 0 28px 80px rgba(11, 31, 58, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 86% 12%, rgba(198, 161, 91, 0.15), transparent 28%),
    radial-gradient(circle at 14% 86%, rgba(11, 31, 58, 0.07), transparent 30%),
    var(--ivory);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.auth-shell {
  display: grid;
  width: min(1240px, calc(100% - 40px));
  min-height: min(760px, calc(100vh - 40px));
  grid-template-columns: minmax(380px, 0.92fr) minmax(430px, 1.08fr);
  overflow: hidden;
  margin: 20px auto;
  border: 1px solid rgba(11, 31, 58, 0.10);
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.auth-visual {
  position: relative;
  display: flex;
  min-height: 100%;
  flex-direction: column;
  overflow: hidden;
  padding: 42px;
  background: linear-gradient(145deg, #0B1F3A 0%, #102D50 68%, #173F69 100%);
  color: #fff;
}

.auth-visual {
  isolation: isolate;
}

.auth-visual::after {
  z-index: -3;
}

.auth-visual::before {
  z-index: -2;
}

.crystal-scene {
  position: absolute;
  z-index: -1;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.crystal-scene::before {
  position: absolute;
  top: 21%;
  right: -12%;
  width: 66%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(198, 161, 91, 0.20), transparent 68%);
  filter: blur(6px);
  content: "";
  animation: crystalGlow 6s ease-in-out infinite alternate;
}

.crystal {
  position: absolute;
  display: block;
  width: 82px;
  height: 128px;
  clip-path: polygon(50% 0, 91% 24%, 80% 79%, 50% 100%, 18% 78%, 8% 24%);
  background:
    linear-gradient(118deg, rgba(255, 255, 255, .58) 0 13%, transparent 13% 46%, rgba(255, 255, 255, .17) 46% 49%, transparent 49%),
    linear-gradient(150deg, rgba(227, 201, 137, .54), rgba(255, 255, 255, .06) 42%, rgba(78, 143, 193, .34));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .28), 0 28px 55px rgba(0, 0, 0, .20);
  filter: drop-shadow(0 14px 18px rgba(0, 0, 0, .18));
  opacity: .62;
  animation: crystalFloat 7s ease-in-out infinite;
}

.crystal::before {
  position: absolute;
  inset: 0;
  clip-path: polygon(50% 0, 50% 100%, 18% 78%, 8% 24%);
  background: linear-gradient(135deg, rgba(255, 255, 255, .36), rgba(11, 31, 58, .14));
  content: "";
}

.crystal::after {
  position: absolute;
  inset: 0;
  clip-path: polygon(50% 0, 91% 24%, 80% 79%, 50% 100%);
  background: linear-gradient(145deg, rgba(198, 161, 91, .35), rgba(255, 255, 255, .02));
  content: "";
}

.crystal-one {
  top: 11%;
  right: 8%;
  transform: rotate(19deg) scale(.78);
  animation-delay: -1s;
}

.crystal-two {
  top: 40%;
  right: 2%;
  transform: rotate(-13deg) scale(1.18);
  opacity: .38;
  animation-delay: -4.2s;
}

.crystal-three {
  right: 25%;
  bottom: 7%;
  transform: rotate(28deg) scale(.58);
  opacity: .46;
  animation-delay: -2.4s;
}

.crystal-four {
  top: 31%;
  left: -5%;
  transform: rotate(-24deg) scale(.46);
  opacity: .30;
  animation-delay: -5.5s;
}

.crystal-orbit {
  position: absolute;
  display: block;
  border: 1px solid rgba(227, 201, 137, .22);
  border-radius: 50%;
  transform: rotate(-25deg);
  animation: orbitPulse 7s ease-in-out infinite;
}

.crystal-orbit::after {
  position: absolute;
  top: 50%;
  left: -4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #E3C989;
  box-shadow: 0 0 18px rgba(227, 201, 137, .82);
  content: "";
}

.orbit-one {
  top: 8%;
  right: -14%;
  width: 320px;
  height: 180px;
}

.orbit-two {
  right: 8%;
  bottom: 12%;
  width: 210px;
  height: 116px;
  animation-delay: -3.5s;
}

.light-streak {
  position: absolute;
  display: block;
  width: 190px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(227, 201, 137, .66), transparent);
  filter: drop-shadow(0 0 7px rgba(227, 201, 137, .42));
  opacity: .55;
  animation: streakTravel 8s linear infinite;
}

.streak-one {
  top: 28%;
  left: -80px;
  transform: rotate(-18deg);
}

.streak-two {
  right: -70px;
  bottom: 31%;
  transform: rotate(24deg);
  animation-delay: -4s;
}

.gold-gradient {
  color: #E3C989;
  background: linear-gradient(100deg, #FFF0C7 0%, #C6A15B 45%, #F6DC9E 78%, #C6A15B 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: goldShimmer 5s linear infinite;
}

.auth-visual::before,
.auth-visual::after {
  position: absolute;
  border: 1px solid rgba(198, 161, 91, 0.22);
  border-radius: 50%;
  content: "";
}

.auth-visual::before {
  top: -120px;
  right: -110px;
  width: 350px;
  height: 350px;
}

.auth-visual::after {
  right: -180px;
  bottom: -220px;
  width: 520px;
  height: 520px;
}

.auth-brand {
  position: relative;
  z-index: 1;
  display: inline-flex;
  width: 174px;
  align-items: center;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.14);
}

.auth-brand img {
  display: block;
  width: 100%;
  height: auto;
}

.visual-content {
  position: relative;
  z-index: 1;
  max-width: 490px;
  margin: auto 0;
}

.visual-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  color: #E3C989;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.visual-kicker::before {
  width: 28px;
  height: 1px;
  background: var(--gold);
  content: "";
}

.visual-content h1 {
  max-width: 440px;
  margin: 0;
  font-size: clamp(36px, 4.2vw, 61px);
  line-height: 1.02;
  letter-spacing: -0.045em;
}

.visual-content>p {
  max-width: 430px;
  margin: 22px 0 30px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 14px;
  line-height: 1.75;
}

.visual-points {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.visual-point {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(10px);
}

.visual-point i {
  color: #E3C989;
  font-size: 21px;
}

.visual-point span {
  display: grid;
  gap: 2px;
}

.visual-point strong {
  font-size: 11px;
}

.visual-point small {
  color: rgba(255, 255, 255, 0.62);
  font-size: 9px;
}

.visual-footer {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: rgba(255, 255, 255, 0.58);
  font-size: 9px;
}

.secure-mark {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.secure-mark i {
  color: #E3C989;
  font-size: 14px;
}

.auth-main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px clamp(32px, 5vw, 82px);
}

.auth-card {
  width: min(100%, 470px);
  animation: cardEnter .72s cubic-bezier(.2, .7, .2, 1) both;
}

.auth-mobile-brand {
  display: none;
  width: 150px;
  margin-bottom: 30px;
}

.auth-mobile-brand img {
  width: 100%;
}

.auth-eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--gold-dark);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.auth-eyebrow span {
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: var(--gold);
}

.auth-card h2 {
  margin: 0;
  color: var(--navy);
  font-size: clamp(29px, 3vw, 40px);
  letter-spacing: -0.045em;
}

.auth-intro {
  margin: 10px 0 28px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.65;
}

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

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
}

.form-field {
  display: grid;
  gap: 7px;
}

.form-field label {
  color: var(--navy);
  font-size: 10.5px;
  font-weight: 760;
}

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

.field-control>i {
  position: absolute;
  left: 14px;
  z-index: 1;
  color: #6D7889;
  font-size: 18px;
  pointer-events: none;
}

.field-control input {
  width: 100%;
  min-height: 48px;
  padding: 0 44px 0 43px;
  border: 1px solid var(--line);
  border-radius: 13px;
  outline: none;
  background: #fff;
  color: var(--navy);
  font-size: 11.5px;
  transition: border-color 160ms, box-shadow 160ms, background 160ms;
}

.field-control input::placeholder {
  color: #7C8797;
  opacity: 1;
}

.field-control input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(198, 161, 91, 0.15);
  background: #FFFEFB;
}

.field-control.is-invalid input {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(179, 58, 74, 0.10);
}

.password-toggle {
  position: absolute;
  right: 9px;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--navy);
  cursor: pointer;
}

.password-toggle:hover {
  background: var(--ivory);
}

.password-toggle i {
  font-size: 18px;
}

.field-error {
  display: none;
  color: var(--danger);
  font-size: 9px;
  font-weight: 650;
}

.form-field.has-error .field-error {
  display: block;
}

.form-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.check-label {
  display: inline-flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
  cursor: pointer;
}

.check-label input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--navy);
}

.auth-link {
  color: var(--gold-dark);
  font-size: 10px;
  font-weight: 800;
  text-decoration: none;
}

.auth-link:hover {
  color: var(--navy);
  text-decoration: underline;
}

.password-strength {
  display: none;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
}

.password-strength.is-visible {
  display: grid;
}

.password-strength span {
  height: 4px;
  border-radius: 10px;
  background: #E4E6E9;
}

.password-strength[data-score="1"] span:nth-child(-n+1) {
  background: #B33A4A;
}

.password-strength[data-score="2"] span:nth-child(-n+2) {
  background: #C88124;
}

.password-strength[data-score="3"] span:nth-child(-n+3) {
  background: #C6A15B;
}

.password-strength[data-score="4"] span {
  background: #137044;
}

.strength-copy {
  margin-top: -10px;
  color: var(--muted);
  font-size: 9px;
}

.auth-button {
  display: flex;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 0;
  border-radius: 13px;
  background: var(--navy);
  box-shadow: 0 12px 28px rgba(11, 31, 58, 0.20);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 160ms, box-shadow 160ms, background 160ms;
}

.auth-server-error {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 11px 12px;
  border: 1px solid rgba(179, 58, 74, 0.22);
  border-radius: 11px;
  background: rgba(179, 58, 74, 0.07);
  color: var(--danger);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.5;
}

.auth-server-error[hidden] {
  display: none;
}

.auth-server-error i {
  margin-top: 1px;
  font-size: 17px;
}

.auth-button:hover {
  transform: translateY(-1px);
  background: var(--navy-2);
  box-shadow: 0 16px 34px rgba(11, 31, 58, 0.24);
}

.auth-button::after {
  width: 24px;
  height: 1px;
  margin-left: 2px;
  background: linear-gradient(90deg, rgba(227, 201, 137, .25), #E3C989);
  content: "";
  transition: width 180ms ease;
}

.auth-button:hover::after {
  width: 38px;
}

.auth-button i {
  color: #E3C989;
  font-size: 18px;
}

.auth-button.is-loading {
  pointer-events: none;
  opacity: 0.82;
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 21px 0;
  color: #6B7789;
  font-size: 9.5px;
}

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

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

.sso-button {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--navy);
  font-size: 10px;
  font-weight: 750;
  cursor: pointer;
}

.sso-button:hover {
  border-color: var(--gold);
  background: #FFFCF5;
}

.sso-button i {
  color: var(--gold-dark);
  font-size: 17px;
}

.auth-switch {
  margin: 23px 0 0;
  color: var(--muted);
  font-size: 10.5px;
  text-align: center;
}

.auth-switch a {
  color: var(--navy);
  font-weight: 850;
  text-decoration: none;
}

.auth-switch a:hover {
  color: var(--gold-dark);
}

.auth-toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: calc(100% - 44px);
  padding: 13px 17px;
  border: 1px solid rgba(19, 112, 68, 0.22);
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 16px 45px rgba(11, 31, 58, 0.18);
  color: var(--success);
  font-size: 10.5px;
  font-weight: 750;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: 180ms;
}

.auth-toast.is-visible {
  opacity: 1;
  transform: none;
}

.auth-toast i {
  font-size: 19px;
}

@keyframes crystalFloat {

  0%,
  100% {
    translate: 0 0;
    rotate: 0deg;
  }

  50% {
    translate: 0 -18px;
    rotate: 4deg;
  }
}

@keyframes crystalGlow {
  from {
    transform: scale(.90);
    opacity: .55;
  }

  to {
    transform: scale(1.08);
    opacity: 1;
  }
}

@keyframes orbitPulse {

  0%,
  100% {
    opacity: .38;
    scale: .96;
  }

  50% {
    opacity: .85;
    scale: 1.04;
  }
}

@keyframes streakTravel {
  0% {
    translate: -90px 30px;
    opacity: 0;
  }

  20%,
  70% {
    opacity: .55;
  }

  100% {
    translate: 420px -110px;
    opacity: 0;
  }
}

@keyframes goldShimmer {
  to {
    background-position: 200% center;
  }
}

@keyframes cardEnter {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {

  .crystal,
  .crystal-orbit,
  .light-streak,
  .crystal-scene::before,
  .gold-gradient,
  .auth-card {
    animation: none !important;
  }
}

@media (max-width: 900px) {
  .auth-shell {
    width: min(680px, calc(100% - 28px));
    grid-template-columns: 1fr;
  }

  .auth-visual {
    display: none;
  }

  .auth-main {
    min-height: calc(100vh - 28px);
    padding: 42px clamp(24px, 8vw, 70px);
  }

  .auth-mobile-brand {
    display: block;
  }
}

@media (max-width: 520px) {
  .auth-shell {
    width: 100%;
    min-height: 100vh;
    margin: 0;
    border: 0;
    border-radius: 0;
  }

  .auth-main {
    padding: 32px 21px;
  }

  .field-grid,
  .sso-grid {
    grid-template-columns: 1fr;
  }

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