/* Login has its own responsive composition; it should never inherit gallery width. */
body.auth-body {
  min-width: 0 !important;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  background: #050505 !important;
  color: #eceae5 !important;
}

.auth-body .container-fluid {
  min-height: 100vh;
  min-height: 100dvh;
}

.auth-shell {
  display: grid;
  grid-template-columns: minmax(25rem, 46%) minmax(30rem, 1fr);
  min-height: 100vh;
  min-height: 100dvh;
  background: #050505;
}

.auth-visual {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  background: #10100f;
}

.auth-visual-image,
.auth-visual-shade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.auth-visual-image {
  object-fit: cover;
  object-position: center 30%;
  filter: saturate(0.78) contrast(1.04) brightness(0.82);
}

.auth-visual-shade {
  background:
    linear-gradient(180deg, rgba(5, 5, 5, 0.04) 28%, rgba(5, 5, 5, 0.82) 100%),
    linear-gradient(90deg, rgba(5, 5, 5, 0.06), transparent 36%);
}

.auth-visual-copy {
  position: absolute;
  z-index: 1;
  right: clamp(2rem, 5vw, 5rem);
  bottom: clamp(2.5rem, 7vh, 6rem);
  left: clamp(2rem, 5vw, 5rem);
  max-width: 42rem;
}

.auth-eyebrow {
  margin: 0 0 1.1rem;
  color: #aaa9a5;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  line-height: 1.4;
  text-transform: uppercase;
}

.auth-visual-copy h2 {
  margin: 0;
  color: #f4f2ed;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(2.5rem, 4vw, 4.75rem);
  font-weight: 300;
  letter-spacing: -0.04em;
  line-height: 0.88;
}

.auth-visual-copy h2 span {
  display: block;
  white-space: nowrap;
}

.auth-visual-note {
  max-width: 27rem;
  margin: 1.5rem 0 0;
  color: rgba(244, 242, 237, 0.72);
  font-size: clamp(0.82rem, 1vw, 0.96rem);
  line-height: 1.6;
}

.auth-access {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  box-sizing: border-box;
  min-width: 0;
  padding: clamp(2rem, 5vw, 4.5rem);
  background:
    radial-gradient(circle at 80% 12%, rgba(255, 255, 255, 0.035), transparent 34%),
    #080808;
}

.auth-access::before {
  position: absolute;
  z-index: 1;
  top: 8%;
  bottom: 8%;
  left: 0;
  width: 1px;
  background: linear-gradient(
    180deg,
    transparent,
    rgba(255, 255, 255, 0.08) 22%,
    rgba(255, 255, 255, 0.18) 50%,
    rgba(255, 255, 255, 0.07) 78%,
    transparent
  );
  box-shadow: 0 0 22px rgba(255, 255, 255, 0.055);
  content: '';
  pointer-events: none;
}

.auth-brand {
  justify-self: start;
  color: #e9e6df !important;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.35rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1;
  text-decoration: none !important;
}

.auth-form-wrap {
  align-self: center;
  width: min(100%, 27rem);
  margin: clamp(2.5rem, 7vh, 6rem) auto;
}

.auth-heading {
  margin-bottom: clamp(2rem, 4vh, 3rem);
}

.auth-heading .auth-eyebrow {
  margin-bottom: 0.85rem;
}

.auth-heading h1 {
  margin: 0;
  color: #f1efea;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(2.8rem, 4.2vw, 4.35rem);
  font-weight: 300;
  letter-spacing: -0.045em;
  line-height: 0.94;
}

.auth-heading > p:last-child {
  max-width: 23rem;
  margin: 1rem 0 0;
  color: #888783;
  font-size: 0.9rem;
  line-height: 1.55;
}

.auth-form {
  display: grid;
  gap: 1.1rem;
}

.auth-field {
  display: grid;
  gap: 0.48rem;
}

.auth-field label {
  margin: 0;
  color: #a4a39f;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.64rem;
  font-weight: 500;
  letter-spacing: 0.11em;
  line-height: 1.3;
  text-transform: uppercase;
}

.auth-field input {
  box-sizing: border-box;
  width: 100%;
  min-height: 52px;
  margin: 0;
  padding: 0 0.95rem;
  border: 1px solid #2b2b29 !important;
  border-radius: 6px !important;
  outline: none;
  background: #10100f !important;
  color: #f2f0eb !important;
  font-family: 'DM Sans', 'Inter', sans-serif !important;
  font-size: 1rem !important;
  line-height: 1;
  box-shadow: none !important;
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.auth-field input::placeholder {
  color: #5d5d59;
  opacity: 1;
}

.auth-field input:hover {
  border-color: #454542 !important;
}

.auth-field input:focus-visible {
  border-color: #bdbbb4 !important;
  background: #131312 !important;
  box-shadow: 0 0 0 3px rgba(236, 234, 229, 0.1) !important;
}

.auth-submit {
  box-sizing: border-box;
  min-height: 52px;
  margin-top: 0.45rem;
  padding: 0 1rem;
  border: 1px solid #e7e5df !important;
  border-radius: 999px !important;
  background: #e7e5df !important;
  color: #090909 !important;
  font-family: 'DM Sans', 'Inter', sans-serif !important;
  font-size: 0.82rem !important;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.auth-submit:hover {
  border-color: #fff !important;
  background: #fff !important;
}

.auth-submit:active {
  transform: translateY(1px);
}

.auth-submit:focus-visible,
.auth-access-request a:focus-visible,
.auth-brand:focus-visible {
  outline: 2px solid #f0eee8;
  outline-offset: 4px;
}

.auth-access-request {
  margin: 1.35rem 0 0;
  color: #777672;
  font-size: 0.78rem;
  line-height: 1.5;
  text-align: center;
}

.auth-access-request a {
  color: #d4d2cc !important;
  font-weight: 500;
  text-decoration: none !important;
}

.auth-access-request a:hover {
  color: #fff !important;
}

.auth-error {
  margin: -1rem 0 1.35rem;
  padding: 0.85rem 0.95rem;
  border: 1px solid #65403f;
  border-radius: 6px;
  background: #1b1111;
  color: #d9aaa7;
  font-size: 0.82rem;
  line-height: 1.45;
}

.auth-footnote {
  align-self: end;
  margin: 0;
  color: #4f4f4c;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  line-height: 1.5;
  text-transform: uppercase;
}

/* iPad portrait: the photograph becomes a cinematic header, not a cramped column. */
@media (max-width: 1023px) and (min-width: 700px) {
  .auth-shell {
    grid-template-columns: 1fr;
    grid-template-rows: 34svh auto;
  }

  .auth-visual {
    min-height: 34svh;
  }

  .auth-visual-image {
    object-position: center 28%;
  }

  .auth-visual-copy {
    right: clamp(2.5rem, 7vw, 5rem);
    bottom: 2.25rem;
    left: clamp(2.5rem, 7vw, 5rem);
  }

  .auth-visual-copy h2 {
    font-size: clamp(3.2rem, 7.4vw, 4.7rem);
  }

  .auth-visual-note {
    display: none;
  }

  .auth-access {
    min-height: 66svh;
    padding: 2.5rem clamp(2.5rem, 9vw, 6rem);
  }

  .auth-access::before {
    top: 0;
    right: 8%;
    bottom: auto;
    left: 8%;
    width: auto;
    height: 1px;
    background: linear-gradient(
      90deg,
      transparent,
      rgba(255, 255, 255, 0.08) 22%,
      rgba(255, 255, 255, 0.18) 50%,
      rgba(255, 255, 255, 0.07) 78%,
      transparent
    );
    box-shadow: 0 0 22px rgba(255, 255, 255, 0.055);
  }

  .auth-form-wrap {
    width: min(100%, 31rem);
    margin: 3rem auto;
  }
}

/* Phones prioritize the task. The image is intentionally removed, not squeezed. */
@media (max-width: 699px) {
  .auth-shell {
    display: block;
  }

  .auth-visual {
    display: none;
  }

  .auth-access {
    min-height: 100vh;
    min-height: 100dvh;
    padding:
      max(1.5rem, env(safe-area-inset-top))
      max(1.35rem, env(safe-area-inset-right))
      max(1.25rem, env(safe-area-inset-bottom))
      max(1.35rem, env(safe-area-inset-left));
  }

  .auth-access::before {
    display: none;
  }

  .auth-brand {
    font-size: 1.3rem;
  }

  .auth-form-wrap {
    width: 100%;
    margin: clamp(3.5rem, 11vh, 6.5rem) auto 3rem;
  }

  .auth-heading {
    margin-bottom: 2rem;
  }

  .auth-heading h1 {
    font-size: clamp(3rem, 15vw, 4.2rem);
  }

  .auth-heading > p:last-child {
    max-width: 21rem;
    font-size: 0.88rem;
  }

  .auth-field input,
  .auth-submit {
    min-height: 54px;
  }

  .auth-footnote {
    font-size: 0.56rem;
  }
}

@media (max-height: 720px) and (min-width: 1024px) {
  .auth-access {
    padding-top: 1.6rem;
    padding-bottom: 1.6rem;
  }

  .auth-form-wrap {
    margin-top: 1.75rem;
    margin-bottom: 1.75rem;
  }

  .auth-heading {
    margin-bottom: 1.5rem;
  }

  .auth-heading h1 {
    font-size: 3rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-field input,
  .auth-submit {
    transition: none;
  }
}
