:root {
  --auth-primary: #6236ff;
  --auth-primary-hover: #4e1dff;
  --auth-ink: #27173e;
  --auth-muted: #756b7f;
  --auth-canvas: #ededf5;
  --auth-surface: #ffffff;
  --auth-line: #dcdce9;
  --auth-success: #05a987;
  --auth-dark: #030108;
  --auth-dark-surface: #161129;
}

body.auth-page {
  min-height: 100%;
  color: var(--auth-muted);
  background:
    radial-gradient(circle at 8% 12%, rgba(98, 54, 255, 0.14), transparent 30%),
    radial-gradient(circle at 92% 84%, rgba(5, 208, 164, 0.1), transparent 30%),
    var(--auth-canvas);
}

body.auth-page::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  opacity: 0.42;
  background-image:
    linear-gradient(rgba(98, 54, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(98, 54, 255, 0.04) 1px, transparent 1px);
  background-size: 34px 34px;
  -webkit-mask-image: linear-gradient(to bottom right, #000, transparent 70%);
  mask-image: linear-gradient(to bottom right, #000, transparent 70%);
}

.auth-page .appHeader {
  color: var(--auth-ink);
}

.auth-page .appHeader.transparent::before {
  background: transparent;
}

.auth-page .appHeader .headerButton {
  color: var(--auth-ink);
}

.auth-page #appCapsule.auth-capsule {
  display: grid;
  min-height: 100svh;
  align-items: center;
  padding: max(76px, calc(env(safe-area-inset-top) + 68px)) 18px max(28px, env(safe-area-inset-bottom));
}

.auth-shell {
  display: grid;
  grid-template-columns: minmax(280px, 0.82fr) minmax(420px, 1.18fr);
  width: min(100%, 1060px);
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid rgba(39, 23, 62, 0.09);
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 32px 90px -45px rgba(39, 23, 62, 0.46);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  animation: auth-card-enter 700ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.auth-register .auth-shell {
  width: min(100%, 1160px);
  grid-template-columns: minmax(300px, 0.72fr) minmax(520px, 1.28fr);
}

.auth-story {
  position: relative;
  min-width: 0;
  overflow: hidden;
  padding: 48px 42px;
  color: rgba(255, 255, 255, 0.72);
  background:
    radial-gradient(circle at 82% 15%, rgba(147, 111, 255, 0.42), transparent 25%),
    linear-gradient(145deg, #27173e 0%, #160a4a 58%, #0c0720 100%);
}

.auth-story::before,
.auth-story::after {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  content: "";
}

.auth-story::before {
  width: 280px;
  height: 280px;
  right: -128px;
  top: 30%;
  animation: auth-orbit 14s linear infinite;
}

.auth-story::after {
  width: 180px;
  height: 180px;
  right: -60px;
  top: calc(30% + 50px);
  border-color: rgba(5, 208, 164, 0.2);
  animation: auth-orbit 10s linear infinite reverse;
}

.auth-story-inner {
  position: sticky;
  top: 36px;
  z-index: 2;
}

.auth-story .auth-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.82);
  background: rgba(255, 255, 255, 0.06);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.auth-story .auth-eyebrow::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #58ddc0;
  box-shadow: 0 0 0 5px rgba(88, 221, 192, 0.11);
  content: "";
}

.auth-story h2 {
  max-width: 410px;
  margin: 28px 0 16px;
  color: #ffffff;
  font-size: clamp(2rem, 4vw, 3.25rem);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -0.045em;
}

.auth-story > .auth-story-inner > p {
  max-width: 410px;
  margin: 0;
  color: rgba(255, 255, 255, 0.66);
  font-size: 14px;
  line-height: 1.75;
}

.auth-signal-list {
  display: grid;
  gap: 10px;
  margin-top: 34px;
}

.auth-signal {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.055);
  color: rgba(255, 255, 255, 0.84);
  font-size: 13px;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.auth-signal ion-icon {
  flex: 0 0 auto;
  color: #9c84ff;
  font-size: 20px;
}

.auth-mini-card {
  display: grid;
  gap: 4px;
  margin-top: 34px;
  padding: 16px;
  border-radius: 16px;
  color: #ffffff;
  background: linear-gradient(135deg, rgba(98, 54, 255, 0.48), rgba(5, 208, 164, 0.16));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.auth-mini-card span,
.auth-mini-card small {
  color: rgba(255, 255, 255, 0.62);
  font-size: 11px;
}

.auth-mini-card strong {
  font-size: 15px;
  font-weight: 600;
}

.auth-panel {
  min-width: 0;
  padding: 42px 48px 44px;
  background: rgba(255, 255, 255, 0.9);
}

.auth-register .auth-panel {
  padding: 38px 44px 42px;
}

.auth-brand {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  gap: 10px;
  color: var(--auth-ink);
  font-size: 13px;
  font-weight: 600;
}

.auth-brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  overflow: hidden;
  padding: 7px;
  border-radius: 12px;
  background: #f2efff;
  box-shadow: inset 0 0 0 1px rgba(98, 54, 255, 0.1);
}

.auth-brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.auth-brand-name {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-heading {
  margin: 30px 0 24px;
}

.auth-heading h1 {
  margin: 0;
  color: var(--auth-ink);
  font-size: clamp(1.9rem, 4vw, 2.65rem);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.auth-heading p {
  max-width: 520px;
  margin: 10px 0 0;
  color: var(--auth-muted);
  font-size: 14px;
  line-height: 1.65;
}

.auth-page .section {
  margin: 0;
  padding: 0;
}

.auth-page .card,
.auth-page .card .card-body {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.auth-page .form-group.basic {
  margin: 0 0 16px;
  padding: 0;
}

.auth-page .form-group .label {
  margin: 0 0 7px;
  color: #4f435a;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.auth-page .form-group.basic .form-control,
.auth-page .form-group.basic .custom-select {
  width: 100%;
  height: 52px;
  padding: 0 44px 0 15px;
  border: 1px solid #d3cedd !important;
  border-radius: 14px;
  color: var(--auth-ink);
  background: #fbfaff;
  font-size: 14px;
  box-shadow: 0 1px 2px rgba(39, 23, 62, 0.03);
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.auth-page .form-group.basic .form-control:hover,
.auth-page .form-group.basic .custom-select:hover {
  border-color: #aaa1b8 !important;
}

.auth-page .form-group.basic .form-control:focus,
.auth-page .form-group.basic .custom-select:focus {
  border-color: var(--auth-primary) !important;
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(98, 54, 255, 0.12) !important;
}

.auth-page .form-group .clear-input,
.auth-page .form-group .toggle-password {
  right: 7px;
  bottom: 7px;
  height: 38px;
  color: #7e738a;
}

.auth-page .btn.btn-lg {
  min-height: 52px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0;
}

.auth-page .btn-primary {
  border-color: var(--auth-primary) !important;
  background: var(--auth-primary) !important;
  box-shadow: 0 16px 30px -16px rgba(98, 54, 255, 0.62);
  transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.auth-page .btn-primary:hover,
.auth-page .btn-primary:focus {
  border-color: var(--auth-primary-hover) !important;
  background: var(--auth-primary-hover) !important;
  box-shadow: 0 18px 36px -16px rgba(78, 29, 255, 0.68);
  transform: translateY(-2px);
}

.auth-submit-row {
  margin-top: 6px;
}

.auth-forgot {
  display: flex;
  justify-content: flex-end;
  margin: -3px 0 18px;
}

.auth-forgot a {
  color: var(--auth-primary);
  font-size: 12px;
  font-weight: 600;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0 16px;
  color: #8b8195;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

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

.auth-page .google-signin {
  position: relative;
  display: flex;
  width: 100%;
  min-height: 54px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  overflow: hidden;
  padding: 7px 18px;
  border: 1px solid #cbc5d5;
  border-radius: 15px;
  color: var(--auth-ink);
  background: #ffffff;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 8px 22px -18px rgba(39, 23, 62, 0.52);
  animation: google-bounce 4.8s ease-in-out 1.1s infinite;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.auth-page .google-signin::after {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(110deg, transparent 20%, rgba(98, 54, 255, 0.08) 48%, transparent 72%);
  content: "";
  transform: translateX(-120%);
}

.auth-page .google-signin:hover,
.auth-page .google-signin:focus {
  border-color: #a99cf0;
  color: var(--auth-ink);
  box-shadow: 0 14px 30px -20px rgba(98, 54, 255, 0.58);
  animation: none;
  transform: translateY(-2px);
}

.auth-page .google-signin:hover::after,
.auth-page .google-signin:focus::after {
  transform: translateX(120%);
  transition: transform 650ms ease;
}

.auth-page .google-signin .circle {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  border: 1px solid #e2deea;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 4px 12px -9px rgba(39, 23, 62, 0.55);
}

.auth-page .google-signin .circle img {
  width: 21px;
  height: 21px;
  object-fit: contain;
}

.auth-page .google-signin .rectangle {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  padding: 0;
  border-radius: 0;
  color: inherit;
  background: transparent;
  font-size: inherit;
  letter-spacing: 0;
  white-space: nowrap;
  transform: none;
  transition: none;
}

.auth-page .google-signin:hover .circle,
.auth-page .google-signin:focus .circle {
  animation: google-icon-pop 520ms cubic-bezier(0.22, 1.4, 0.36, 1);
}

.auth-page .google-signin.is-launching {
  pointer-events: none;
  border-color: #9c8cff;
  animation: google-launch 480ms cubic-bezier(0.22, 1.4, 0.36, 1) both;
}

.auth-page .google-signin.is-launching .circle {
  animation: google-icon-pop 480ms cubic-bezier(0.22, 1.4, 0.36, 1);
}

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

.auth-switch a {
  color: var(--auth-primary);
  font-weight: 600;
}

.auth-register #registrationForm > .card > .card-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 16px;
}

.auth-register .auth-field-wide,
.auth-register .auth-consent {
  grid-column: 1 / -1;
}

.auth-register .custom-file-upload > input {
  width: 0;
  height: 0;
}

.auth-register .custom-file-upload label {
  min-height: 82px;
  margin: 0;
  border: 1px dashed #bdb4cb;
  border-radius: 14px;
  color: var(--auth-muted);
  background: #f8f7fb;
}

.auth-register .custom-file-upload label strong {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.auth-register .custom-file-upload label ion-icon {
  color: var(--auth-primary);
  font-size: 24px;
}

.auth-register .custom-file-upload label i {
  color: #5b4f66;
  font-size: 13px;
  font-style: normal;
  font-weight: 600;
}

.auth-register .auth-consent {
  margin: 2px 0 16px;
  padding: 13px 14px;
  border: 1px solid var(--auth-line);
  border-radius: 13px;
  background: #f8f7fb;
}

.auth-register .form-check-label {
  color: #5b4f66;
  font-size: 12px;
}

.auth-register #blinker {
  color: #d9365f;
  font-size: 11px;
  animation: consent-pulse 600ms ease-in-out 2;
}

body.dark-mode.auth-page {
  color: #8f82a5;
  background:
    radial-gradient(circle at 8% 12%, rgba(98, 54, 255, 0.24), transparent 30%),
    radial-gradient(circle at 92% 84%, rgba(5, 208, 164, 0.1), transparent 30%),
    var(--auth-dark);
}

body.dark-mode.auth-page .auth-shell {
  border-color: rgba(255, 255, 255, 0.09);
  background: rgba(22, 17, 41, 0.9);
  box-shadow: 0 34px 96px -44px rgba(0, 0, 0, 0.92);
}

body.dark-mode.auth-page .auth-panel {
  background: rgba(22, 17, 41, 0.94);
}

body.dark-mode.auth-page .auth-brand,
body.dark-mode.auth-page .auth-heading h1,
body.dark-mode.auth-page .google-signin {
  color: #ffffff;
}

body.dark-mode.auth-page .auth-brand-mark {
  background: rgba(98, 54, 255, 0.16);
}

body.dark-mode.auth-page .form-group .label,
body.dark-mode.auth-page .form-check-label {
  color: #e9e3f2;
}

body.dark-mode.auth-page .form-group.basic .form-control,
body.dark-mode.auth-page .form-group.basic .custom-select {
  color: #ffffff;
  border-color: #493b5c !important;
  background: #211832;
}

body.dark-mode.auth-page .form-group.basic .form-control:focus,
body.dark-mode.auth-page .form-group.basic .custom-select:focus {
  background: #271b3b;
}

body.dark-mode.auth-page .google-signin {
  border-color: #493b5c;
  background: #211832;
}

body.dark-mode.auth-page .google-signin .circle {
  border-color: #493b5c;
}

body.dark-mode.auth-page .auth-divider::before,
body.dark-mode.auth-page .auth-divider::after {
  background: #372648;
}

body.dark-mode.auth-page .auth-consent,
body.dark-mode.auth-page .custom-file-upload label {
  border-color: #493b5c;
  background: #211832;
}

@keyframes auth-card-enter {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.985);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes auth-orbit {
  to {
    transform: rotate(360deg);
  }
}

@keyframes google-bounce {
  0%,
  74%,
  100% {
    transform: translateY(0);
  }

  79% {
    transform: translateY(-6px);
  }

  84% {
    transform: translateY(2px);
  }

  89% {
    transform: translateY(-2px);
  }

  93% {
    transform: translateY(0);
  }
}

@keyframes google-icon-pop {
  0% {
    transform: scale(1) rotate(0);
  }

  48% {
    transform: scale(1.16) rotate(-7deg);
  }

  76% {
    transform: scale(0.96) rotate(3deg);
  }

  100% {
    transform: scale(1) rotate(0);
  }
}

@keyframes google-launch {
  0% {
    transform: translateY(0) scale(1);
  }

  45% {
    transform: translateY(-7px) scale(1.015);
  }

  72% {
    transform: translateY(2px) scale(0.995);
  }

  100% {
    transform: translateY(0) scale(1);
  }
}

@keyframes consent-pulse {
  50% {
    opacity: 0.45;
  }
}

@media (max-width: 899px) {
  .auth-shell,
  .auth-register .auth-shell {
    grid-template-columns: minmax(0, 1fr);
    width: min(100%, 560px);
  }

  .auth-story {
    display: none;
  }
}

@media (max-width: 575px) {
  .auth-page #appCapsule.auth-capsule {
    align-items: start;
    padding-right: 12px;
    padding-left: 12px;
  }

  .auth-shell {
    border-radius: 24px;
  }

  .auth-panel,
  .auth-register .auth-panel {
    padding: 30px 22px 32px;
  }

  .auth-heading {
    margin-top: 24px;
  }

  .auth-register #registrationForm > .card > .card-body {
    grid-template-columns: minmax(0, 1fr);
  }

  .auth-register #registrationForm > .card > .card-body > * {
    grid-column: 1;
  }

  .auth-page .google-signin {
    font-size: 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-shell,
  .auth-story::before,
  .auth-story::after,
  .auth-page .google-signin,
  .auth-page .google-signin .circle,
  .auth-register #blinker {
    animation: none !important;
  }

  .auth-page .google-signin::after {
    display: none;
  }
}

