/* Unified DCOREP access surface shared by the landing modal and /login. */

.login-modal {
  padding: clamp(0.75rem, 3vw, 2rem);
}

.login-modal .modal-backdrop {
  background: rgba(3, 3, 2, 0.72);
  backdrop-filter: blur(5px) saturate(80%);
}

.auth-gate {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 3.15rem minmax(0, 1fr);
  width: min(32rem, 100%);
  max-height: calc(100dvh - 2rem);
  overflow: hidden auto;
  border: 1px solid rgba(247, 244, 237, 0.15);
  border-radius: 1.05rem;
  background:
    linear-gradient(145deg, rgba(255, 90, 10, 0.035), transparent 36%),
    rgba(10, 10, 9, 0.97);
  color: #f4f1e9;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.045),
    0 2.4rem 7rem rgba(0, 0, 0, 0.62);
  animation: authGateIn 480ms var(--spring) both;
}

.auth-gate::before {
  position: absolute;
  top: -1px;
  right: 3.25rem;
  left: 3.15rem;
  height: 1px;
  background: linear-gradient(90deg, #ff5a0a, rgba(255, 90, 10, 0.08) 48%, transparent 86%);
  content: "";
  pointer-events: none;
}

.auth-gate-rail {
  display: grid;
  grid-template-rows: auto minmax(4rem, 1fr) auto;
  justify-items: center;
  gap: 0.8rem;
  padding: 1.35rem 0 1.25rem;
  border-right: 1px solid rgba(247, 244, 237, 0.08);
  color: rgba(247, 244, 237, 0.36);
  font: 0.48rem/1 "JetBrains Mono", ui-monospace, monospace;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.auth-gate-rail i {
  width: 1px;
  min-height: 3rem;
  background: linear-gradient(#ff5a0a, rgba(255, 90, 10, 0.04));
}

.auth-gate-rail small {
  font: inherit;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

.auth-gate-content {
  min-width: 0;
  padding: 1.4rem 1.55rem 1.35rem;
}

.auth-gate-header,
.auth-gate-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.auth-gate-wordmark {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 0.7rem;
}

.auth-gate-mark {
  display: grid;
  grid-template-columns: repeat(3, 0.16rem);
  align-items: end;
  flex: 0 0 auto;
  width: 1.65rem;
  height: 1.65rem;
  gap: 0.13rem;
  padding: 0.4rem;
  border: 1px solid rgba(255, 90, 10, 0.58);
  color: #ff6a24;
}

.auth-gate-mark i {
  width: 100%;
  background: currentColor;
}

.auth-gate-mark i:nth-child(1) { height: 38%; opacity: 0.58; }
.auth-gate-mark i:nth-child(2) { height: 72%; opacity: 0.8; }
.auth-gate-mark i:nth-child(3) { height: 100%; }

.auth-gate-wordmark > span:last-child {
  display: grid;
  min-width: 0;
  line-height: 1.05;
}

.auth-gate-wordmark strong {
  color: rgba(247, 244, 237, 0.86);
  font-size: 0.69rem;
  font-weight: 620;
  letter-spacing: 0.025em;
}

.auth-gate-wordmark small {
  margin-top: 0.22rem;
  overflow: hidden;
  color: rgba(247, 244, 237, 0.34);
  font: 0.47rem/1.2 "JetBrains Mono", ui-monospace, monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-gate-live,
.auth-gate-footer {
  color: rgba(247, 244, 237, 0.36);
  font: 0.48rem/1.2 "JetBrains Mono", ui-monospace, monospace;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.auth-gate-live,
.auth-gate-footer > span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
}

.auth-gate-live i,
.auth-gate-footer i {
  width: 0.32rem;
  height: 0.32rem;
  border-radius: 50%;
  background: #70d79b;
}

.auth-gate-copy {
  margin: clamp(2.8rem, 8vh, 4.8rem) 0 2rem;
}

.auth-gate-kicker {
  margin: 0 0 0.8rem;
  color: #ff6a24;
  font: 0.54rem/1.2 "JetBrains Mono", ui-monospace, monospace;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.auth-gate-copy h2 {
  margin: 0;
  color: #f7f4ed;
  font-size: clamp(2.55rem, 6vw, 3.55rem);
  font-weight: 520;
  letter-spacing: -0.065em;
  line-height: 0.96;
}

.auth-gate-copy > p:last-child {
  max-width: 31rem;
  margin: 1rem 0 0;
  color: rgba(247, 244, 237, 0.46);
  font-size: 0.74rem;
  line-height: 1.55;
}

.auth-gate-form {
  gap: 0;
}

.auth-gate .auth-line-field {
  position: relative;
  gap: 0.25rem;
  padding: 0.72rem 0 0.3rem;
  border: 0;
  border-bottom: 1px solid rgba(247, 244, 237, 0.1);
}

.auth-gate .auth-line-field:last-of-type {
  border-bottom: 1px solid rgba(247, 244, 237, 0.1);
}

.auth-gate .auth-line-field::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 1px;
  background: #ff6a24;
  content: "";
  pointer-events: none;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 260ms cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-gate .auth-line-field > span {
  color: rgba(247, 244, 237, 0.48);
  font: 0.52rem/1.2 "JetBrains Mono", ui-monospace, monospace;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.auth-gate .auth-line-field input {
  height: 2.7rem;
  padding: 0;
  border: 0;
  border-radius: 0;
  outline: 0;
  background: transparent;
  color: #f7f4ed;
  box-shadow: none;
  caret-color: #ff6a24;
  font-size: 0.8rem;
}

.auth-gate .auth-line-field input::placeholder {
  color: rgba(247, 244, 237, 0.22);
}

.auth-gate .auth-line-field:focus-within {
  border-bottom-color: rgba(247, 244, 237, 0.16);
}

.auth-gate .auth-line-field:focus-within::after {
  transform: scaleX(1);
}

.auth-gate .auth-line-field input:focus,
.auth-gate .auth-line-field input:hover {
  border: 0;
  background: transparent;
  box-shadow: none;
}

.auth-gate .auth-line-field input:-webkit-autofill,
.auth-gate .auth-line-field input:-webkit-autofill:hover,
.auth-gate .auth-line-field input:-webkit-autofill:focus {
  border: 0;
  -webkit-text-fill-color: #f7f4ed;
  caret-color: #ff6a24;
  box-shadow: 0 0 0 1000px rgba(10, 10, 9, 0.98) inset;
}

.auth-gate .terminal-error {
  min-height: 2.15rem;
  margin: 0;
  padding: 0.55rem 0 0.2rem;
  color: #ff9a80;
  font-size: 0.64rem;
}

.auth-gate-submit {
  min-height: 3.1rem;
  margin-top: 0.35rem;
  padding: 0 1rem;
  border-color: #ff6a24;
  border-radius: 0.48rem;
  background: #ff6a24;
  color: #180a04;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.auth-gate-submit:hover:not(:disabled) {
  background: #ff8050;
  transform: translateY(-1px);
}

.auth-gate-submit:active:not(:disabled) {
  transform: translateY(1px) scale(0.99);
}

.auth-gate-footer {
  margin-top: 1.25rem;
  padding-top: 0.9rem;
  border-top: 1px solid rgba(247, 244, 237, 0.08);
}

.auth-gate .modal-close {
  top: 1rem;
  right: 1rem;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.42rem;
  background: rgba(247, 244, 237, 0.025);
}

.auth-gate .modal-close:hover {
  border-color: rgba(255, 106, 36, 0.58);
  color: #ff6a24;
  transform: none;
}

.auth-gate-modal .auth-gate-header {
  padding-right: 2.6rem;
}

.unified-login-page {
  position: relative;
  display: grid;
  min-height: 100dvh;
  overflow: hidden;
  background: #050505;
}

.unified-login-page::after {
  display: none;
}

.unified-login-page .auth-ambient-canvas {
  z-index: -4;
  opacity: 0.74;
}

.unified-login-page .ambient-grain {
  opacity: 0.018;
}

.auth-particle-watermark {
  z-index: -1;
  opacity: 0.16;
}

.unified-login-header {
  z-index: 8;
}

.unified-login-header .gate-login svg {
  order: -1;
}

.auth-standalone-shell {
  position: relative;
  z-index: 3;
  display: grid;
  place-items: center;
  min-height: 100dvh;
  padding: 6.5rem 1.5rem 2.5rem;
}

.auth-gate-standalone {
  width: min(32rem, calc(100vw - 3rem));
}

@keyframes authGateIn {
  from { opacity: 0; transform: translate3d(0, 0.8rem, 0) scale(0.985); }
  to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}

@media (max-width: 42rem) {
  .login-modal {
    align-items: end;
    padding: 0.65rem;
  }

  .auth-gate {
    grid-template-columns: 0.25rem minmax(0, 1fr);
    width: 100%;
    max-height: calc(100dvh - 1.3rem);
    border-radius: 0.85rem;
  }

  .auth-gate::before {
    right: 3rem;
    left: 0.25rem;
  }

  .auth-gate-rail {
    display: block;
    padding: 0;
    border: 0;
    background: linear-gradient(#ff5a0a, rgba(255, 90, 10, 0.08) 70%, transparent);
  }

  .auth-gate-rail > * {
    display: none;
  }

  .auth-gate-content {
    padding: 1.15rem 1rem 1rem;
  }

  .auth-gate-copy {
    margin: clamp(2.2rem, 7vh, 3.2rem) 0 1.45rem;
  }

  .auth-gate-copy h2 {
    font-size: clamp(2.35rem, 12vw, 3rem);
  }

  .auth-gate-copy > p:last-child {
    max-width: 28rem;
    font-size: 0.7rem;
  }

  .auth-gate .auth-line-field input {
    height: 2.8rem;
    font-size: 0.82rem;
  }

  .auth-gate-submit {
    min-height: 3.2rem;
  }

  .auth-gate-footer {
    margin-top: 1rem;
  }

  .auth-standalone-shell {
    align-items: center;
    padding: 5.6rem 0.65rem 1rem;
  }

  .auth-gate-standalone {
    width: 100%;
  }

  .auth-particle-watermark {
    opacity: 0.1;
  }
}

@media (max-height: 42rem) and (min-width: 42.01rem) {
  .auth-gate-copy {
    margin-block: 1.5rem 1rem;
  }

  .auth-gate-content {
    padding-block: 1rem;
  }

  .auth-gate-footer {
    margin-top: 0.8rem;
  }
}

@media (max-height: 28rem) and (min-width: 36rem) {
  .login-modal {
    align-items: center;
  }

  .auth-gate-content {
    display: grid;
    grid-template-columns: minmax(12rem, 0.72fr) minmax(16rem, 1fr);
    grid-template-areas:
      "header header"
      "copy form"
      "footer footer";
    column-gap: 1.5rem;
    padding: 0.8rem 1rem 0.7rem;
  }

  .auth-gate-header {
    grid-area: header;
  }

  .auth-gate-copy {
    grid-area: copy;
    align-self: center;
    margin: 1rem 0 0.6rem;
  }

  .auth-gate-copy h2 {
    font-size: clamp(2rem, 6vw, 2.65rem);
  }

  .auth-gate-copy > p:last-child {
    max-width: 30ch;
    margin-top: 0.65rem;
    font-size: 0.66rem;
  }

  .auth-gate-form {
    grid-area: form;
    align-self: center;
    padding-top: 0.7rem;
  }

  .auth-gate .auth-line-field {
    padding-top: 0.4rem;
  }

  .auth-gate .auth-line-field input {
    height: 2.15rem;
  }

  .auth-gate .terminal-error {
    min-height: 1.45rem;
    padding-top: 0.3rem;
  }

  .auth-gate-submit {
    min-height: 2.65rem;
    margin-top: 0.15rem;
  }

  .auth-gate-footer {
    grid-area: footer;
    margin-top: 0.5rem;
    padding-top: 0.55rem;
  }

  .auth-standalone-shell {
    padding-block: 4rem 0.7rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-gate {
    animation: none;
  }
}
