.studio-opening {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  padding: 24px;
  overflow: auto;
  background-color: #15171b;
  background-image:
    radial-gradient(ellipse at center, #15171bf5 0%, #15171b80 62%, #15171b55 100%),
    url("/app/login-art.webp");
  background-position: center, center 43%;
  background-size: cover;
  color: #f5ebdb;
  text-align: center;
}

.studio-opening-logo {
  display: block;
  width: clamp(84px, 16vw, 112px);
  height: auto;
}

.studio-opening-status {
  margin: 0;
  font-size: .95rem;
  letter-spacing: .015em;
}

.studio-opening-progress {
  width: 98px;
  height: 3px;
  overflow: hidden;
  border-radius: 999px;
  background: #f5ebdb30;
}

.studio-opening-progress::before {
  display: block;
  width: 42%;
  height: 100%;
  border-radius: inherit;
  background: #d7bd98;
  content: "";
  animation: studio-opening-sweep 1.4s ease-in-out infinite alternate;
}

@keyframes studio-opening-sweep {
  from { transform: translateX(0); }
  to { transform: translateX(138%); }
}

@media (prefers-reduced-motion: reduce) {
  .studio-opening-progress::before { animation: none; }
}

#studioAuth {
  --auth-paper: #f9f7f3;
  --auth-ink: #1b1d20;
  --auth-muted: #635f59;
  --auth-border: #d9d3c9;
  --auth-cream: #f5ebdb;
  --auth-display: "Cormorant Garamond", Georgia, serif;
  --auth-ease: cubic-bezier(.2,.7,.25,1);
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
  align-items: stretch;
  gap: clamp(16px, 2vw, 32px);
  padding: 18px;
  overflow: auto;
  background: var(--auth-paper);
  color: var(--auth-ink);
  font: 400 16px/1.5 Figtree, system-ui, sans-serif;
  color-scheme: light;
}

#studioAuth [hidden] { display: none !important; }

.studio-auth-visual {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-rows: auto 1fr;
  align-items: start;
  overflow: hidden;
  padding: clamp(28px, 4vw, 64px);
  min-height: 620px;
  border-radius: 22px;
  background: #17191c;
  color: var(--auth-cream);
}

.studio-auth-art {
  position: absolute;
  z-index: -2;
  inset: -4%;
  background: #17191c url("/app/login-art.webp") 50% 40% / cover no-repeat;
  animation: studio-auth-drift 15s ease-in-out infinite alternate;
}

.studio-auth-visual::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background:
    linear-gradient(0deg, #15171b 0%, #15171bbf 24%, transparent 70%),
    linear-gradient(90deg, #16171ab3, transparent 65%);
  pointer-events: none;
}

.studio-auth-logo {
  display: block;
  width: 74px;
  height: auto;
}

.studio-auth-hero {
  align-self: end;
  max-width: 420px;
  margin-block: 0 22px;
}

.studio-auth-hero-title {
  margin: 0;
  font: 600 clamp(3.6rem, 6vw, 6.4rem)/.87 var(--auth-display);
  letter-spacing: -.065em;
  text-wrap: balance;
}

.studio-auth-hero-title em {
  color: #dac6a8;
  font-weight: 600;
}

.studio-auth-hero-copy {
  margin: 20px 0 0;
  max-width: 31ch;
  color: #e2d8ca;
  font-size: .98rem;
}

.studio-auth-main {
  display: grid;
  place-items: center;
  min-width: 0;
  padding: clamp(20px, 5vw, 72px) clamp(16px, 3.5vw, 48px);
}

.studio-auth-content {
  width: min(100%, 390px);
}

.studio-auth-content[data-entering] {
  animation: studio-auth-enter .38s var(--auth-ease) both;
}

.studio-auth-content h1 {
  margin: 0 0 8px;
  color: var(--auth-ink);
  font: 700 clamp(2.65rem, 4.4vw, 4rem)/.95 var(--auth-display);
  letter-spacing: -.051em;
  text-wrap: balance;
}

.studio-auth-message {
  margin: 0 0 28px;
  color: var(--auth-muted);
  font-size: .96rem;
  overflow-wrap: anywhere;
}

.studio-auth-message:is([data-tone="success"], [data-tone="error"]) {
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid transparent;
  border-radius: 10px;
}

.studio-auth-message[data-tone="success"] {
  color: #14553d;
  border-color: #b8dbca;
  background: #e9f4ed;
}

.studio-auth-message[data-tone="error"] {
  color: #862d2a;
  border-color: #ebc9c2;
  background: #faebe7;
}

.studio-auth-success {
  display: grid;
  place-items: center;
  width: 49px;
  height: 49px;
  margin-bottom: 18px;
  border: 1px solid #b8dbca;
  border-radius: 15px;
  color: #14553d;
  background: #e9f4ed;
}

.studio-auth-success svg { width: 22px; height: 22px; }

.studio-auth-form {
  display: grid;
  gap: 16px;
}

.studio-auth-field {
  display: grid;
  min-width: 0;
  gap: 6px;
}

.studio-auth-field label {
  font-size: .89rem;
  font-weight: 700;
}

.studio-auth-control {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 52px;
  padding-inline: 12px;
  gap: 8px;
  border: 1px solid var(--auth-border);
  border-radius: 11px;
  background: #fff;
}

.studio-auth-control:focus-within {
  border-color: #75634d;
  box-shadow: 0 0 0 3px #ad977336;
}

#studioAuth .studio-auth-control input {
  flex: 1;
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 0;
  border: 0;
  background: transparent;
  outline: 0;
  box-shadow: none;
  font: inherit;
  color: var(--auth-ink);
}

#studioAuth .studio-auth-control input::placeholder {
  color: #77716a;
  opacity: 1;
}

.studio-auth-control > svg {
  width: 18px;
  height: 18px;
  flex: none;
  color: #6d6459;
}

.studio-auth-hint {
  color: var(--auth-muted);
  font-size: .82rem;
}

#studioAuth button {
  appearance: none;
  border: 0;
  color: var(--auth-ink);
  background: transparent;
  font: inherit;
  cursor: pointer;
}

#studioAuth button:focus-visible {
  outline: 2px solid #8b6b4f;
  outline-offset: 3px;
}

#studioAuth button:disabled {
  opacity: .68;
  cursor: wait;
}

#studioAuth .studio-auth-link {
  min-height: 44px;
  padding: 4px;
  border-radius: 6px;
  font-size: .86rem;
  font-weight: 700;
  text-underline-offset: 4px;
}

#studioAuth .studio-auth-link:hover { text-decoration: underline; }

#studioAuth .studio-auth-recover {
  justify-self: end;
  margin: -9px -4px -5px 0;
}

#studioAuth .studio-auth-submit {
  position: relative;
  display: block;
  width: 100%;
  min-height: 52px;
  padding: 10px 42px;
  border-radius: 11px;
  background: #222326;
  color: #fff;
  font-weight: 700;
  transition: background-color .18s ease;
}

#studioAuth .studio-auth-submit:hover { background: #393735; }
#studioAuth .studio-auth-submit svg,
#studioAuth .studio-auth-submit[aria-busy="true"]::after {
  position: absolute;
  inset-inline-end: 15px;
  inset-block-start: 50%;
  width: 18px;
  height: 18px;
  translate: 0 -50%;
}

#studioAuth .studio-auth-submit[aria-busy="true"] svg { display: none; }
#studioAuth .studio-auth-submit[aria-busy="true"]::after {
  content: "";
  border: 2px solid #ffffff55;
  border-top-color: #fff;
  border-radius: 50%;
  animation: studio-auth-spin .8s linear infinite;
}

.studio-auth-alternate {
  margin: 0;
  padding-top: 7px;
  border-top: 1px solid var(--auth-border);
  text-align: center;
  color: var(--auth-muted);
  font-size: .89rem;
}

.studio-auth-actions {
  display: grid;
  gap: 9px;
}

.studio-auth-text-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 16px;
}

@keyframes studio-auth-drift {
  from { transform: translate3d(-1%, 0, 0) scale(1); }
  to { transform: translate3d(1%, -.8%, 0) scale(1.065); }
}
@keyframes studio-auth-enter {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes studio-auth-spin { to { transform: rotate(360deg); } }

@media (max-width: 790px) {
  #studioAuth {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    gap: 0;
    padding: 0;
  }

  .studio-auth-visual {
    min-height: 126px;
    grid-template: auto / 1fr;
    align-items: center;
    padding: max(18px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right))
      18px max(20px, env(safe-area-inset-left));
    border-radius: 0 0 20px 20px;
  }

  .studio-auth-logo { width: 53px; }
  .studio-auth-hero { display: none; }
  .studio-auth-art { background-position: center 36%; }

  .studio-auth-main {
    align-items: start;
    padding: clamp(25px, 7vw, 58px) max(21px, env(safe-area-inset-right))
      max(24px, env(safe-area-inset-bottom)) max(21px, env(safe-area-inset-left));
  }

  .studio-auth-message { margin-bottom: 21px; }
}

@media (prefers-reduced-motion: reduce) {
  #studioAuth .studio-auth-art,
  #studioAuth .studio-auth-content,
  #studioAuth .studio-auth-submit[aria-busy="true"]::after {
    animation: none;
  }

  #studioAuth .studio-auth-submit { transition: none; }
}
