.client-access-gate[hidden],
.client-access-view[hidden],
.client-opening-link[hidden],
.client-account-suggestion[hidden] {
  display: none !important;
}

.client-access-gate,
.client-access-gate * {
  box-sizing: border-box;
}

.client-access-gate {
  --client-green-950: #063830;
  --client-green-900: #07473d;
  --client-green-700: #08715b;
  --client-green-100: #e9f5f0;
  --client-orange: #e99a22;
  --client-ink: #173f37;
  --client-muted: #687b75;
  --client-line: #dce8e3;
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  overflow: auto;
  padding: clamp(16px, 4vw, 42px);
  color: var(--client-ink);
  font-family: Aptos, "Segoe UI Variable", "Segoe UI", Arial, sans-serif;
}

.client-access-backdrop {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 13% 10%, rgba(237, 172, 69, .16), transparent 28rem),
    radial-gradient(circle at 88% 92%, rgba(69, 153, 126, .22), transparent 31rem),
    linear-gradient(145deg, rgba(3, 43, 37, .82), rgba(7, 71, 61, .76)),
    url("../images/market-access-background.webp") center / cover no-repeat;
  background-color: #063d35;
  backdrop-filter: blur(9px);
}

.client-access-dialog {
  position: relative;
  width: min(620px, 100%);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: 26px;
  background: rgba(255, 255, 255, .985);
  box-shadow: 0 36px 100px rgba(0, 28, 23, .38), 0 2px 7px rgba(0, 24, 20, .1);
  animation: client-dialog-enter .45s cubic-bezier(.2, .75, .2, 1) both;
}

.client-access-dialog::before {
  position: absolute;
  top: 0;
  right: 74px;
  left: 74px;
  z-index: 2;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: linear-gradient(90deg, transparent, var(--client-orange), transparent);
  content: "";
}

.client-access-brand {
  display: flex;
  min-height: 84px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px clamp(24px, 6vw, 40px) 13px;
}

.client-access-brand img {
  display: block;
  width: 176px;
  height: 48px;
  object-fit: contain;
}

.client-secure-badge {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  border: 1px solid #cfe3da;
  border-radius: 999px;
  background: #f4faf7;
  color: var(--client-green-700);
  font-size: 11px;
  font-weight: 750;
  white-space: nowrap;
}

.client-secure-badge > span {
  display: grid;
  width: 17px;
  height: 17px;
  place-items: center;
  border-radius: 50%;
  background: var(--client-green-700);
  color: #fff;
  font-size: 10px;
}

.client-access-steps {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  margin: 0;
  padding: 14px clamp(24px, 6vw, 40px) 17px;
  border-top: 1px solid #edf3f0;
  border-bottom: 1px solid var(--client-line);
  background: #fbfdfc;
  list-style: none;
}

.client-access-steps::before {
  position: absolute;
  top: 29px;
  right: calc(25% + 40px);
  left: calc(25% + 40px);
  height: 1px;
  background: #d6e4de;
  content: "";
}

.client-access-steps li {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 6px;
  color: #8a9893;
  font-size: 10px;
  text-align: center;
}

.client-access-steps li > span {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid #ccdad5;
  border-radius: 50%;
  background: #fff;
  color: #71847d;
  font-size: 11px;
  font-weight: 800;
  transition: border-color .2s ease, background-color .2s ease, color .2s ease, box-shadow .2s ease;
}

.client-access-steps li strong {
  font-weight: 700;
}

.client-access-steps li.is-active,
.client-access-steps li.is-complete {
  color: var(--client-green-700);
}

.client-access-steps li.is-active > span {
  border-color: var(--client-green-700);
  background: var(--client-green-700);
  color: #fff;
  box-shadow: 0 0 0 5px rgba(8, 113, 91, .1);
}

.client-access-steps li.is-complete > span {
  border-color: #91c4b2;
  background: var(--client-green-100);
  color: var(--client-green-700);
}

.client-access-content {
  padding: clamp(28px, 5vw, 38px) clamp(24px, 7vw, 48px) clamp(30px, 5vw, 40px);
}

.client-access-view {
  animation: client-view-enter .3s ease both;
}

.client-access-heading {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 15px;
  align-items: center;
}

.client-access-icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid #cce3d9;
  border-radius: 15px;
  background: linear-gradient(145deg, #f4fbf8, #e5f3ed);
  color: var(--client-green-700);
  box-shadow: 0 7px 18px rgba(8, 92, 75, .08);
  font-size: 21px;
  font-weight: 800;
}

.client-code-mark {
  border-color: #f1d4a5;
  background: #fff7e9;
  color: #a9660d;
}

.client-access-kicker {
  margin: 0 0 5px;
  color: var(--client-green-700);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .13em;
}

.client-access-heading h1,
.client-access-heading h2 {
  margin: 0;
  color: var(--client-green-950);
  font-size: clamp(23px, 4vw, 29px);
  font-weight: 720;
  letter-spacing: -.025em;
  line-height: 1.15;
}

.client-access-intro {
  margin: 18px 0 25px;
  color: var(--client-muted);
  font-size: 14px;
  line-height: 1.65;
}

.client-access-form {
  display: grid;
  gap: 9px;
}

.client-access-form label {
  margin-top: 3px;
  color: #294f47;
  font-size: 12px;
  font-weight: 760;
}

.client-access-form input {
  width: 100%;
  min-height: 54px;
  padding: 13px 15px;
  border: 1px solid #b8cbc4;
  border-radius: 12px;
  outline: 0;
  background: #fff;
  color: var(--client-ink);
  font: inherit;
  font-size: 15px;
  transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}

.client-access-form input::placeholder {
  color: #a0aea9;
}

.client-access-form input:hover {
  border-color: #8faaa0;
}

.client-access-form input:focus {
  border-color: var(--client-green-700);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(8, 113, 91, .12);
}

.client-access-form input[aria-invalid="true"] {
  border-color: #bd5a60;
  background: #fffafa;
}

.client-access-form input + label {
  margin-top: 9px;
}

.client-field-wrap {
  position: relative;
}

.client-field-wrap input {
  padding-left: 49px;
}

.client-field-icon {
  position: absolute;
  top: 50%;
  left: 16px;
  z-index: 1;
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 7px;
  background: var(--client-green-100);
  color: var(--client-green-700);
  font-size: 12px;
  font-weight: 850;
  transform: translateY(-50%);
}

.client-access-form button,
.client-opening-link {
  display: inline-flex;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 10px;
  padding: 12px 20px;
  border: 1px solid var(--client-green-700);
  border-radius: 12px;
  background: linear-gradient(135deg, var(--client-green-700), #09614f);
  box-shadow: 0 10px 23px rgba(8, 113, 91, .2);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 780;
  text-decoration: none;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, background-color .16s ease;
}

.client-access-form button > span:last-child {
  font-size: 19px;
  line-height: 1;
}

.client-access-form button:hover,
.client-access-form button:focus-visible {
  box-shadow: 0 13px 27px rgba(8, 92, 75, .26);
  transform: translateY(-1px);
}

.client-access-form button:focus-visible,
.client-opening-link:focus-visible,
.client-back-button:focus-visible,
.client-code-actions button:focus-visible {
  outline: 3px solid rgba(233, 154, 34, .35);
  outline-offset: 3px;
}

.client-access-form button:disabled {
  cursor: wait;
  box-shadow: none;
  opacity: .68;
  transform: none;
}

.client-access-form .client-account-suggestion {
  min-height: 42px;
  justify-content: space-between;
  margin-top: 0;
  padding: 9px 12px;
  border-color: #c9ddd5;
  background: #f4f9f7;
  box-shadow: none;
  color: #46665d;
  font-size: 11px;
  font-weight: 700;
  text-align: left;
}

.client-access-form .client-account-suggestion strong {
  color: var(--client-green-700);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.client-access-form .client-account-suggestion:hover,
.client-access-form .client-account-suggestion:focus-visible {
  border-color: var(--client-green-700);
  background: var(--client-green-100);
  box-shadow: none;
  transform: none;
}

.client-access-hint {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin: 2px 0 0;
  color: #71827c;
  font-size: 11px;
  line-height: 1.5;
}

.client-access-hint > span {
  flex: 0 0 auto;
  color: var(--client-green-700);
  font-weight: 900;
}

.client-access-status {
  display: none;
  margin-top: 15px;
  padding: 12px 14px 12px 42px;
  border: 1px solid #efc7c7;
  border-radius: 11px;
  background: #fff7f7;
  color: #87343a;
  font-size: 12px;
  line-height: 1.5;
}

.client-access-status::before {
  float: left;
  margin-left: -27px;
  content: "!";
  font-weight: 900;
}

.client-access-status.is-visible {
  display: block;
  animation: client-status-enter .22s ease both;
}

.client-access-status.success {
  border-color: #b8dcca;
  background: #f1faf6;
  color: #075a49;
}

.client-access-status.success::before {
  content: "✓";
}

.client-opening-link {
  width: 100%;
  border-color: #dfbd87;
  background: #fffaf1;
  box-shadow: none;
  color: #80520e;
}

.client-opening-link:hover {
  background: #fff4df;
}

.client-back-button {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 7px;
  margin: -8px 0 18px;
  padding: 5px 1px;
  border: 0;
  background: transparent;
  color: var(--client-green-700);
  font: inherit;
  font-size: 12px;
  font-weight: 740;
  cursor: pointer;
}

.client-back-button:hover {
  color: var(--client-green-950);
}

.client-reassurance {
  display: grid;
  grid-template-columns: 27px 1fr;
  gap: 10px;
  align-items: start;
  margin: -7px 0 20px;
  padding: 12px 14px;
  border: 1px solid #d6e7e0;
  border-radius: 12px;
  background: #f6faf8;
}

.client-reassurance > span {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border-radius: 50%;
  background: var(--client-green-100);
  color: var(--client-green-700);
  font-family: Georgia, serif;
  font-size: 13px;
  font-weight: 800;
}

.client-reassurance p {
  margin: 1px 0 0;
  color: #5d746c;
  font-size: 11px;
  line-height: 1.5;
}

.client-code-input {
  min-height: 68px !important;
  padding-left: calc(15px + .28em) !important;
  border-width: 2px !important;
  background: #fbfdfc !important;
  color: var(--client-green-950) !important;
  font-size: clamp(26px, 7vw, 34px) !important;
  font-variant-numeric: tabular-nums;
  font-weight: 800 !important;
  letter-spacing: .28em;
  text-align: center;
}

.client-code-input::placeholder {
  color: #c7d3cf;
  opacity: 1;
}

.client-code-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 8px;
  margin-top: 16px;
  color: #71827c;
  font-size: 11px;
}

.client-code-actions button {
  min-height: 34px;
  padding: 4px 7px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--client-green-700);
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  cursor: pointer;
}

.client-code-actions button:hover {
  background: var(--client-green-100);
  text-decoration: none;
}

.client-code-actions button:disabled {
  cursor: default;
  opacity: .58;
}

.client-access-dialog > footer {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px clamp(20px, 5vw, 32px);
  border-top: 1px solid var(--client-line);
  background: #fbfdfc;
  color: #71827c;
  font-size: 10px;
  line-height: 1.45;
  text-align: center;
}

.client-access-dialog > footer > span {
  color: var(--client-orange);
  font-size: 8px;
}

.client-session-chip {
  position: absolute;
  top: 18px;
  right: 64px;
  left: auto;
  z-index: 44;
  display: flex;
  min-height: 32px;
  align-items: center;
  gap: 7px;
  padding: 3px 4px 3px 8px;
  border: 1px solid rgba(7, 63, 56, .16);
  border-radius: 999px;
  background: rgba(255, 255, 255, .9);
  box-shadow: 0 7px 20px rgba(7, 63, 56, .08);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: 10px;
}

.client-session-indicator {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: #1aa662;
  box-shadow: 0 0 0 3px rgba(26, 166, 98, .12);
}

.client-session-chip strong {
  color: #31544c;
  font-size: 10px;
  letter-spacing: .04em;
}

.client-session-chip button {
  display: grid;
  width: 24px;
  height: 24px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #0b4b43;
  color: #fff;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
}

.client-session-chip button:hover { background: #13715f; }
.client-session-chip button:focus-visible { outline: 3px solid rgba(243, 154, 16, .38); outline-offset: 2px; }

.mobile-session-logout {
  display: none;
}

@media (max-width: 768px) {
  .client-session-chip {
    display: none;
  }

  .mobile-session-logout {
    display: grid;
    position: absolute;
    left: 0;
    bottom: 5px;
    z-index: 2;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    padding: 0;
    place-items: center;
    border: 1px solid rgba(7, 63, 56, .2);
    border-radius: 50%;
    background: #fff;
    color: #0b4b43;
    box-shadow: 0 5px 14px rgba(7, 63, 56, .1);
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
  }

  .mobile-session-logout:focus-visible {
    outline: 3px solid rgba(243, 154, 16, .38);
    outline-offset: 2px;
  }
}

.client-access-locked #clientProtectedContent {
  filter: blur(2px);
  user-select: none;
  pointer-events: none;
}

@keyframes client-dialog-enter {
  from { opacity: 0; transform: translateY(14px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes client-view-enter {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes client-status-enter {
  from { opacity: 0; transform: translateY(-3px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 640px) {
  .client-access-backdrop {
    background:
      radial-gradient(circle at 88% 14%, rgba(237, 172, 69, .14), transparent 17rem),
      linear-gradient(155deg, rgba(3, 43, 37, .3), rgba(7, 71, 61, .24)),
      url("../images/market-access-background.webp") right center / auto 100% no-repeat;
    background-color: #063d35;
  }

  .client-access-gate {
    align-items: start;
    padding: 10px;
  }

  .client-access-dialog {
    margin-block: auto;
    border-radius: 20px;
  }

  .client-access-brand {
    min-height: 70px;
    padding: 13px 20px 10px;
  }

  .client-access-brand img {
    width: 150px;
    height: 42px;
  }

  .client-secure-badge {
    padding: 5px 8px;
    font-size: 0;
  }

  .client-secure-badge > span {
    font-size: 10px;
  }

  .client-access-steps {
    padding: 12px 16px 14px;
  }

  .client-access-steps::before {
    top: 27px;
    right: calc(25% + 25px);
    left: calc(25% + 25px);
  }

  .client-access-steps li > span {
    width: 28px;
    height: 28px;
  }

  .client-access-steps li strong {
    font-size: 9px;
  }

  .client-access-content {
    padding: 26px 20px 27px;
  }

  .client-access-heading {
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 12px;
  }

  .client-access-icon {
    width: 42px;
    height: 42px;
    border-radius: 13px;
    font-size: 18px;
  }

  .client-access-heading h1,
  .client-access-heading h2 {
    font-size: clamp(21px, 6.5vw, 26px);
  }

  .client-access-intro {
    margin: 15px 0 21px;
    font-size: 13px;
  }

  .client-access-form input {
    min-height: 52px;
  }

  .client-access-dialog > footer {
    padding-block: 10px;
  }

}

@media (max-height: 720px) and (min-width: 641px) {
  .client-access-gate {
    align-items: start;
    padding-block: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .client-access-dialog,
  .client-access-view,
  .client-access-status {
    animation: none !important;
  }

  .client-access-gate *,
  .client-access-gate *::before,
  .client-access-gate *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
