/*
  HelTrack auth v2.
  Scoped to body.gj-auth so legacy auth.css can remain during migration.
*/

.gj-auth {
  --gj-auth-shell-pad: clamp(1rem, 3vw, 2rem);
  background: var(--gj-color-bg);
}

.gj-auth .gj-auth-main {
  flex: 1 1 auto;
  width: 100%;
  margin-left: 0 !important;
  padding: 0 !important;
  color: var(--gj-color-text);
  background:
    radial-gradient(circle at top left, rgba(20, 163, 154, .14), transparent 34rem),
    linear-gradient(135deg, #eef4f6 0%, #f8fafc 52%, #edf3f0 100%);
  border: 0 !important;
}

[data-bs-theme="dark"] .gj-auth .gj-auth-main {
  background:
    radial-gradient(circle at top left, rgba(20, 163, 154, .18), transparent 34rem),
    linear-gradient(135deg, #0f151b 0%, #121a22 52%, #111816 100%);
}

.gj-auth .gj-auth-messages {
  width: min(1080px, calc(100% - 2rem));
  margin: 1rem auto 0;
}

.gj-login {
  width: 100%;
  min-height: calc(100vh - 128px);
  display: grid;
  place-items: center;
  padding: var(--gj-auth-shell-pad);
}

.gj-login__panel {
  width: min(1080px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(360px, .96fr);
  overflow: hidden;
  color: var(--gj-color-text);
  background: var(--gj-color-surface);
  border: 1px solid color-mix(in srgb, var(--gj-color-border) 88%, transparent);
  border-radius: var(--gj-radius-md);
  box-shadow: 0 26px 70px rgba(15, 23, 42, .16);
}

[data-bs-theme="dark"] .gj-login__panel {
  box-shadow: 0 26px 70px rgba(0, 0, 0, .38);
}

.gj-login__media {
  position: relative;
  min-height: 620px;
  color: #fff;
  background: #14242f;
}

.gj-login__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gj-login__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8, 18, 28, .12), rgba(8, 18, 28, .82));
}

.gj-login__media-copy {
  position: absolute;
  z-index: 1;
  left: clamp(1.25rem, 4vw, 3rem);
  right: clamp(1.25rem, 4vw, 3rem);
  bottom: clamp(1.25rem, 5vw, 3.25rem);
  display: grid;
  gap: .75rem;
}

.gj-auth-kicker {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  width: fit-content;
  color: color-mix(in srgb, #ffffff 92%, var(--gj-color-primary));
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.gj-login__media-copy h1,
.gj-login__card h1 {
  margin: 0;
  letter-spacing: 0;
}

.gj-login__media-copy h1 {
  max-width: 13ch;
  color: #fff;
  font-size: clamp(2.2rem, 5vw, 4.25rem);
  line-height: .98;
  font-weight: 900;
}

.gj-login__media-copy p {
  max-width: 32rem;
  margin: 0;
  color: rgba(255, 255, 255, .84);
  font-size: 1rem;
}

.gj-login__card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1.25rem;
  min-width: 0;
  padding: clamp(1.4rem, 4vw, 3rem);
  background: var(--gj-color-surface);
}

.gj-login__brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.gj-login__brand img {
  width: 58px;
  height: 58px;
  object-fit: contain;
  border-radius: var(--gj-radius-md);
  border: 1px solid var(--gj-color-border);
  background: #fff;
  padding: .35rem;
}

.gj-login__card .gj-auth-kicker {
  color: var(--gj-color-primary);
}

.gj-login__brand h1 {
  color: var(--gj-color-text);
  font-size: clamp(1.65rem, 2.7vw, 2.2rem);
  line-height: 1.08;
  font-weight: 900;
}

.gj-login__intro {
  margin: 0;
  color: var(--gj-color-muted);
}

.gj-login__form {
  display: grid;
  gap: 1rem;
}

.gj-login__field {
  display: grid;
  gap: .45rem;
}

.gj-login__field label {
  margin: 0;
  color: var(--gj-color-text) !important;
  font-size: .83rem;
  font-weight: 800;
}

.gj-login__input {
  position: relative;
}

.gj-login__input i {
  position: absolute;
  left: .9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gj-color-muted);
  pointer-events: none;
}

.gj-login__input .form-control {
  min-height: 48px;
  padding-left: 2.55rem;
  color: var(--gj-color-text);
  background: var(--gj-color-surface-muted);
  border-color: var(--gj-color-border);
  border-radius: var(--gj-radius-sm);
}

.gj-login__input .form-control::placeholder {
  color: color-mix(in srgb, var(--gj-color-muted) 72%, transparent);
}

.gj-login__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  flex-wrap: wrap;
}

.gj-login__row .form-check-label,
.gj-auth .form-check-label {
  color: var(--gj-color-text);
}

.gj-auth-link,
.gj-auth-link:hover,
.gj-auth-link:focus {
  color: var(--gj-color-primary);
  font-weight: 800;
  text-decoration: none;
}

.gj-login__submit {
  min-height: 48px;
  width: 100%;
}

.gj-login__register {
  display: grid;
  gap: .85rem;
  padding: 1rem;
  border: 1px solid var(--gj-color-border);
  border-radius: var(--gj-radius-md);
  background: var(--gj-color-surface-muted);
}

.gj-login__register-heading {
  display: grid;
  gap: .15rem;
}

.gj-login__register-heading span {
  color: var(--gj-color-muted);
  font-size: .84rem;
  font-weight: 700;
}

.gj-login__register-heading strong {
  color: var(--gj-color-text);
}

.gj-login__register-action {
  width: 100%;
  min-height: 44px;
}

.gj-login__platform {
  margin: 0;
  color: var(--gj-color-muted);
  font-size: .86rem;
}

.gj-login__platform a {
  color: var(--gj-color-primary);
  font-weight: 800;
  text-decoration: none;
}

@media (max-width: 991.98px) {
  .gj-login {
    min-height: auto;
    align-items: start;
  }

  .gj-login__panel {
    grid-template-columns: 1fr;
  }

  .gj-login__media {
    min-height: 280px;
  }

  .gj-login__media-copy h1 {
    max-width: 18ch;
  }
}

@media (max-width: 575.98px) {
  .gj-auth .modern-auth-navbar {
    margin: .75rem;
    max-width: calc(100% - 1.5rem);
  }

  .gj-login {
    padding: .75rem;
  }

  .gj-login__panel {
    border-radius: var(--gj-radius-sm);
  }

  .gj-login__media {
    display: none;
  }

  .gj-login__card {
    padding: 1.1rem;
  }

  .gj-login__brand {
    align-items: flex-start;
  }

  .gj-login__brand img {
    width: 48px;
    height: 48px;
  }
}


/* Register v2 */
.gj-register {
  width: 100%;
  min-height: calc(100vh - 128px);
  display: grid;
  place-items: center;
  padding: var(--gj-auth-shell-pad);
}

.gj-register__panel {
  width: min(1180px, 100%);
  display: grid;
  grid-template-columns: minmax(320px, .9fr) minmax(0, 1.1fr);
  overflow: hidden;
  color: var(--gj-color-text);
  background: var(--gj-color-surface);
  border: 1px solid color-mix(in srgb, var(--gj-color-border) 88%, transparent);
  border-radius: var(--gj-radius-md);
  box-shadow: 0 26px 70px rgba(15, 23, 42, .16);
}

.gj-register__panel--compact {
  width: min(1080px, 100%);
  grid-template-columns: minmax(0, 1.04fr) minmax(360px, .96fr);
}

[data-bs-theme="dark"] .gj-register__panel {
  box-shadow: 0 26px 70px rgba(0, 0, 0, .38);
}

.gj-register__media {
  position: relative;
  min-height: 640px;
  color: #fff;
  background: #14242f;
}

.gj-register__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gj-register__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8, 18, 28, .12), rgba(8, 18, 28, .82));
}

.gj-register__media-copy {
  position: absolute;
  z-index: 1;
  left: clamp(1.25rem, 4vw, 3rem);
  right: clamp(1.25rem, 4vw, 3rem);
  bottom: clamp(1.25rem, 5vw, 3.25rem);
  display: grid;
  gap: .75rem;
}

.gj-register__media-copy h1 {
  max-width: 14ch;
  margin: 0;
  color: #fff;
  font-size: clamp(2.1rem, 4.7vw, 4rem);
  line-height: .98;
  font-weight: 900;
  letter-spacing: 0;
}

.gj-register__media-copy p {
  max-width: 32rem;
  margin: 0;
  color: rgba(255, 255, 255, .84);
}

.gj-register__workspace,
.gj-register__card {
  min-width: 0;
  background: var(--gj-color-surface);
}

.gj-register__workspace {
  display: grid;
  align-content: start;
  gap: 1rem;
  padding: clamp(1.2rem, 3vw, 2rem);
  max-height: min(900px, calc(100vh - 180px));
  overflow: auto;
}

.gj-register__card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1.25rem;
  padding: clamp(1.4rem, 4vw, 3rem);
}

.gj-register__brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.gj-register__brand img {
  width: 58px;
  height: 58px;
  object-fit: contain;
  border-radius: var(--gj-radius-md);
  border: 1px solid var(--gj-color-border);
  background: #fff;
  padding: .35rem;
}

.gj-register__brand h1,
.gj-register__brand h2 {
  margin: 0;
  color: var(--gj-color-text);
  font-size: clamp(1.55rem, 2.6vw, 2.1rem);
  line-height: 1.08;
  font-weight: 900;
  letter-spacing: 0;
}

.gj-register__card .gj-auth-kicker,
.gj-register__workspace .gj-auth-kicker {
  color: var(--gj-color-primary);
}

.gj-register__intro,
.gj-register__header > p,
.gj-register__footer,
.gj-register__footer span {
  margin: 0;
  color: var(--gj-color-muted);
}

.gj-register__header {
  display: grid;
  gap: .85rem;
  padding-bottom: .35rem;
}

.gj-register__section {
  display: grid;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--gj-color-border);
  border-radius: var(--gj-radius-md);
  background: var(--gj-color-surface-muted);
}

.gj-register__section-heading {
  display: flex;
  align-items: center;
  gap: .85rem;
}

.gj-register__section-heading h2,
.gj-register__section-heading h3 {
  margin: 0;
  color: var(--gj-color-text);
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: 0;
}

.gj-register__section-heading p {
  margin: .15rem 0 0;
  color: var(--gj-color-muted);
  font-size: .9rem;
}

.gj-register__step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  color: var(--gj-color-primary);
  background: var(--gj-color-primary-soft);
  font-size: .78rem;
  font-weight: 900;
}

.gj-register__section-heading--selected {
  align-items: flex-start;
}

.gj-register__section-heading--selected .gj-register__start-over {
  margin-left: auto;
}

.gj-register__search-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .75rem;
}

.gj-auth-field,
.gj-auth-form {
  display: grid;
  gap: .45rem;
}

.gj-auth-form {
  gap: 1rem;
}

.gj-auth-field label {
  margin: 0;
  color: var(--gj-color-text) !important;
  font-size: .83rem;
  font-weight: 800;
}

.gj-auth-input {
  position: relative;
}

.gj-auth-input > i {
  position: absolute;
  left: .9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gj-color-muted);
  pointer-events: none;
}

.gj-auth-input .form-control,
.gj-auth-input .form-select,
.gj-auth-field > .form-control,
.gj-auth-field > .form-select {
  min-height: 44px;
  color: var(--gj-color-text);
  background: var(--gj-color-surface);
  border-color: var(--gj-color-border);
  border-radius: var(--gj-radius-sm);
}

.gj-auth-input .form-control,
.gj-auth-input .form-select {
  padding-left: 2.55rem;
}

.gj-auth-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start; /* an error under one field must not stretch its neighbor's input */
  gap: .95rem;
}

.gj-auth-grid .gj-auth-field--wide {
  grid-column: 1 / -1;
}

.gj-register__role-form {
  display: grid;
  gap: .85rem;
}

.gj-register__role-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: .85rem;
  width: 100%;
  padding: .95rem;
  color: var(--gj-color-text);
  background: var(--gj-color-surface-muted);
  border: 1px solid var(--gj-color-border);
  border-radius: var(--gj-radius-md);
  text-align: left;
}

.gj-register__role-option:hover,
.gj-register__role-option:focus-visible {
  border-color: var(--gj-color-primary);
  box-shadow: var(--gj-focus-ring);
}

.gj-register__role-icon,
.gj-register__result-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--gj-radius-sm);
  color: var(--gj-color-primary);
  background: var(--gj-color-primary-soft);
}

.gj-register__role-copy {
  display: grid;
  gap: .15rem;
}

.gj-register__role-copy strong,
.gj-register__result-copy strong {
  color: var(--gj-color-text);
}

.gj-register__role-copy small,
.gj-register__result-copy span {
  color: var(--gj-color-muted);
}

.gj-register__state,
.gj-register__summary,
.gj-register__result {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .85rem;
  border: 1px solid var(--gj-color-border);
  border-radius: var(--gj-radius-md);
  background: var(--gj-color-surface);
}

.gj-register__state--error {
  color: #842029;
  background: #f8d7da;
  border-color: #f1aeb5;
}

[data-bs-theme="dark"] .gj-register__state--error {
  color: #ffd8dd;
  background: rgba(132, 32, 41, .36);
  border-color: rgba(248, 215, 218, .28);
}

.gj-register__state--empty {
  align-items: flex-start;
}

.gj-register__summary {
  flex-wrap: wrap;
  color: var(--gj-color-muted);
  background: color-mix(in srgb, var(--gj-color-primary-soft) 48%, var(--gj-color-surface));
}

.gj-register__summary span {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
}

.gj-register__results {
  display: grid;
  gap: .65rem;
}

.gj-register__results-count {
  color: var(--gj-color-muted);
  font-size: .82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.gj-register__result {
  justify-content: space-between;
}

.gj-register__result-copy {
  display: grid;
  gap: .1rem;
  min-width: 0;
  flex: 1 1 auto;
}

.gj-register__result-action,
.gj-register__start-over,
.gj-register__footer a {
  color: var(--gj-color-primary);
  font-weight: 800;
  text-decoration: none;
}

.gj-register__primary {
  width: 100%;
  min-height: 46px;
}

.gj-register__footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  flex-wrap: wrap;
  padding-top: .25rem;
}

/* Registration outcomes and field states. */
/* A neighbor's help text or error must never stretch a control. */
.gj-register__form .gj-auth-grid { align-items: start; }
.gj-register__form .gj-auth-field { align-content: start; }
.gj-register__form { gap: 1.1rem; }
.gj-auth-required { color: #c81e45; }
[data-bs-theme="dark"] .gj-auth-required { color: #fc9aad; }
.gj-auth-help { color: var(--gj-color-muted); font-size: .78rem; }
.gj-auth-field.is-invalid > .form-control,
.gj-auth-field.is-invalid > .form-select { border-color: #dc3545; box-shadow: 0 0 0 3px rgb(220 53 69 / .15); }
.gj-auth-field > .form-control:focus,
.gj-auth-field > .form-select:focus { border-color: var(--app-context, var(--gj-color-primary)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--app-context, var(--gj-color-primary)) 22%, transparent); }

.gj-register__outcome {
  --tone: #16a34a; --tone-soft: #e8f7ee; --tone-ink: #15803d;
  display: grid;
  justify-items: center;
  gap: .55rem;
  padding: 1.5rem 1.25rem;
  text-align: center;
  background: radial-gradient(120% 120% at 50% 0%, var(--tone-soft), var(--gj-color-surface) 70%);
  border: 1px solid color-mix(in srgb, var(--tone) 30%, var(--gj-color-border));
  border-radius: var(--gj-radius-md);
  animation: gj-register-rise .35s ease both;
}
.gj-register__outcome[data-tone="warning"] { --tone: #c27c0e; --tone-soft: #fdf3e1; --tone-ink: #92400e; }
[data-bs-theme="dark"] .gj-register__outcome { --tone: #5ee08f; --tone-soft: rgba(94, 224, 143, .14); --tone-ink: #7ce7a5; }
[data-bs-theme="dark"] .gj-register__outcome[data-tone="warning"] { --tone: #f5c46c; --tone-soft: rgba(245, 196, 108, .15); --tone-ink: #f7cf86; }
.gj-register__outcome-icon {
  display: grid;
  width: 3.4rem;
  height: 3.4rem;
  place-items: center;
  font-size: 1.45rem;
  color: var(--tone-ink);
  background: var(--tone-soft);
  border: 1px solid color-mix(in srgb, var(--tone) 35%, transparent);
  border-radius: 50%;
  box-shadow: 0 0 0 8px color-mix(in srgb, var(--tone) 8%, transparent);
}
.gj-register__outcome h2 { margin: .35rem 0 0; font-size: 1.15rem; font-weight: 800; color: var(--gj-color-text); }
.gj-register__outcome p { max-width: 30rem; margin: 0; color: var(--gj-color-muted); }
.gj-register__outcome p strong { color: var(--gj-color-text); overflow-wrap: anywhere; }
.gj-register__outcome small { max-width: 30rem; color: var(--gj-color-muted); font-size: .8rem; }
.gj-register__outcome-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem; margin-top: .35rem; }
@keyframes gj-register-rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .gj-register__outcome { animation: none; } }

@media (max-width: 991.98px) {
  .gj-register {
    min-height: auto;
    align-items: start;
  }

  .gj-register__panel,
  .gj-register__panel--compact {
    grid-template-columns: 1fr;
  }

  .gj-register__media {
    min-height: 280px;
  }

  .gj-register__workspace {
    max-height: none;
    overflow: visible;
  }
}

@media (max-width: 575.98px) {
  .gj-register {
    padding: .75rem;
  }

  .gj-register__panel {
    border-radius: var(--gj-radius-sm);
  }

  .gj-register__media {
    display: none;
  }

  .gj-register__card,
  .gj-register__workspace {
    padding: 1.1rem;
  }

  .gj-auth-grid,
  .gj-register__search-form {
    grid-template-columns: 1fr;
  }

  .gj-register__section-heading--selected .gj-register__start-over {
    width: 100%;
    margin-left: 0;
  }

  .gj-register__result {
    align-items: flex-start;
    flex-direction: column;
  }
}


/* Auth utility pages v2 */
.gj-auth-flow {
  width: 100%;
  min-height: calc(100vh - 128px);
  display: grid;
  place-items: center;
  padding: var(--gj-auth-shell-pad);
}

.gj-auth-card {
  width: min(520px, 100%);
  display: grid;
  gap: 1.15rem;
  padding: clamp(1.35rem, 4vw, 2.5rem);
  color: var(--gj-color-text);
  background: var(--gj-color-surface);
  border: 1px solid var(--gj-color-border);
  border-radius: var(--gj-radius-md);
  box-shadow: 0 24px 70px rgba(15, 23, 42, .15);
  text-align: center;
}

[data-bs-theme="dark"] .gj-auth-card {
  box-shadow: 0 24px 70px rgba(0, 0, 0, .34);
}

.gj-auth-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: center;
  width: 86px;
  height: 86px;
  border-radius: 999px;
  color: var(--gj-color-primary);
  background: var(--gj-color-primary-soft);
  font-size: 2.75rem;
}

.gj-auth-card__icon--success {
  color: #157347;
  background: rgba(25, 135, 84, .12);
}

.gj-auth-card__icon--danger {
  color: #b42318;
  background: rgba(180, 35, 24, .12);
}

[data-bs-theme="dark"] .gj-auth-card__icon--success {
  color: #75d99f;
  background: rgba(25, 135, 84, .22);
}

[data-bs-theme="dark"] .gj-auth-card__icon--danger {
  color: #ff9b92;
  background: rgba(180, 35, 24, .22);
}

.gj-auth-card h1 {
  margin: 0;
  color: var(--gj-color-text);
  font-size: clamp(1.65rem, 3vw, 2.15rem);
  line-height: 1.08;
  font-weight: 900;
  letter-spacing: 0;
}

.gj-auth-card__copy {
  margin: 0;
  color: var(--gj-color-muted);
  font-size: 1rem;
}

.gj-auth-card__form {
  display: grid;
  gap: .9rem;
  margin-top: .25rem;
  text-align: left;
}

.gj-auth-card__actions {
  display: grid;
  gap: .75rem;
  justify-items: center;
  margin-top: .15rem;
}

.gj-auth-card__actions .gj-btn {
  min-height: 44px;
}

.gj-auth-card__secondary,
.gj-auth-card__secondary:hover,
.gj-auth-card__secondary:focus {
  color: var(--gj-color-primary);
  font-weight: 800;
  text-decoration: none;
}

.gj-auth-card__status--success h1 {
  color: #157347;
}

.gj-auth-card__status--danger h1 {
  color: #b42318;
}

[data-bs-theme="dark"] .gj-auth-card__status--success h1 {
  color: #75d99f;
}

[data-bs-theme="dark"] .gj-auth-card__status--danger h1 {
  color: #ff9b92;
}
