/* ============================================================
   SACRAMENTO — portada de acceso
   Vive separada de la biblioteca y del canvas.
   ============================================================ */

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 9000;
  overflow: hidden;
  min-height: 100svh;
  background: #f7f6f2;
  color: #11110f;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
}

body.auth-signed-in .auth-gate { display: none; }

.home-orbit {
  position: absolute;
  inset: 0;
  overflow: hidden;
  opacity: 1;
  transition: opacity .8s ease;
  pointer-events: none;
}

body.auth-pending .home-orbit { opacity: 0; }

.home-orbit-item {
  position: absolute;
  top: 0;
  left: 0;
  margin: 0;
  will-change: transform, opacity;
  transform-origin: center;
}

.home-orbit-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(.82) contrast(.96);
}

.home-shell {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 100svh;
  padding: 42px 24px 70px;
}

.auth-login {
  width: min(100%, 362px);
  padding: 28px 16px 22px;
  text-align: center;
  background: #f7f6f2;
}

.home-wordmark {
  margin: 0;
  line-height: 0;
}

.home-wordmark img {
  display: block;
  width: clamp(230px, 30vw, 380px);
  max-width: 100%;
  height: auto;
  margin: 0 auto;
}

.home-tagline {
  margin: 14px 0 29px;
  color: #78766f;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: .035em;
}

.auth-entry,
.auth-recovery,
.auth-notice {
  opacity: 1;
  transition: opacity .3s ease;
}

body.auth-pending .auth-entry,
body.auth-pending .auth-recovery,
body.auth-pending .auth-notice {
  visibility: hidden;
  opacity: 0;
}

.auth-entry[hidden],
.auth-recovery[hidden],
.auth-notice[hidden],
.home-form[hidden],
.home-recovery-success[hidden] { display: none; }

.home-btn {
  width: 100%;
  min-height: 44px;
  border: 1px solid #171714;
  border-radius: 0;
  background: transparent;
  color: #171714;
  font: inherit;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .025em;
  cursor: pointer;
  transition: background .18s ease, color .18s ease, opacity .18s ease;
}

.home-btn:hover { background: #171714; color: #fff; }
.home-btn:focus-visible,
.home-link:focus-visible,
.home-password-toggle:focus-visible,
.home-field input:focus-visible {
  outline: 2px solid #171714;
  outline-offset: 3px;
}
.home-btn:disabled { cursor: wait; opacity: .45; }
.home-btn-primary { background: #171714; color: #fff; }
.home-btn-primary:hover { background: #393832; }

.home-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  margin: 19px 0 17px;
  color: #aaa79e;
  font-size: 9px;
}
.home-divider::before,
.home-divider::after { content: ""; height: 1px; background: #dcd9d1; }

.home-form { display: grid; gap: 12px; text-align: left; }
.home-field { display: grid; gap: 6px; }
.home-field[hidden] { display: none; }
.home-field label {
  color: #6e6c65;
  font-size: 8px;
  font-weight: 500;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.home-field input {
  width: 100%;
  height: 42px;
  padding: 0 1px;
  border: 0;
  border-bottom: 1px solid #bbb8af;
  border-radius: 0;
  background: transparent;
  color: #171714;
  font: inherit;
  font-size: 13px;
  appearance: none;
}
.home-field input::placeholder { color: #aaa79e; }
.home-field input:focus { border-color: #171714; outline: none; }
.home-submit { margin-top: 7px; }

.home-password-row { position: relative; }
.home-password-row input { padding-right: 62px; }
.home-password-toggle {
  position: absolute;
  right: 1px;
  top: 50%;
  transform: translateY(-50%);
  padding: 4px 0 4px 8px;
  border: 0;
  background: #f7f6f2;
  color: #77756e;
  font: inherit;
  font-size: 8.5px;
  text-decoration: underline;
  text-decoration-color: #c7c4bb;
  text-underline-offset: 3px;
  cursor: pointer;
}

.auth-notice,
.home-recovery-success { color: #66645d; font-size: 11px; line-height: 1.65; }
.home-notice-lead,
.home-recovery-success p { margin: 0 0 12px; }
.home-notice-email {
  margin: 0 0 12px;
  color: #171714;
  font-size: 12px;
  overflow-wrap: anywhere;
}
.home-notice-copy { margin: 0 0 24px; }
.home-recovery-success .home-btn { margin-top: 24px; }

.home-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 16px;
}

.home-link {
  padding: 0;
  border: 0;
  background: none;
  color: #77756e;
  font: inherit;
  font-size: 9.5px;
  line-height: 1.4;
  text-decoration: underline;
  text-decoration-color: #c7c4bb;
  text-underline-offset: 3px;
  cursor: pointer;
}
.home-link:hover { color: #171714; text-decoration-color: #171714; }

.auth-status {
  min-height: 19px;
  margin: 17px 0 0;
  color: #77756e;
  font-size: 10px;
  line-height: 1.55;
}
.auth-status:empty { margin-top: 0; min-height: 0; }
.auth-status.error { color: #9a3d28; }
.auth-status.success { color: #4f6654; }

.home-founder {
  position: fixed;
  z-index: 3;
  left: 50%;
  bottom: max(17px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: max-content;
  color: #aaa79e;
  font-size: 8.5px;
  letter-spacing: .055em;
}

@media (max-width: 900px) {
  .auth-login { width: min(100%, 352px); }
  .home-orbit-item:nth-child(n+12) { display: none; }
}

@media (max-width: 600px) {
  .home-shell { align-items: start; padding: 48px 20px 68px; overflow-y: auto; }
  .auth-login { width: min(100%, 340px); padding: 18px 12px 20px; }
  .home-wordmark img { width: min(268px, 100%); }
  .home-tagline { margin: 12px 0 24px; }
  .home-orbit { opacity: .5; }
  .home-orbit-item:nth-child(n+7) { display: none; }
  .home-actions { align-items: flex-start; }
  .home-founder { font-size: 8px; }
}

@media (max-height: 720px) and (min-width: 601px) {
  .home-shell { padding: 12px 24px 42px; }
  .auth-login { padding: 8px 16px 10px; }
  .home-tagline { margin: 9px 0 13px; }
  .home-btn { min-height: 39px; }
  .home-divider { margin: 10px 0; }
  .home-form { gap: 6px; }
  .home-field { gap: 3px; }
  .home-field input { height: 33px; }
  .home-submit { margin-top: 5px; }
  .home-actions { margin-top: 11px; }
  .auth-status { margin-top: 9px; }
}

@media (prefers-reduced-motion: reduce) {
  .home-orbit, .auth-entry { transition: none; }
  .home-orbit-item { will-change: auto; }
  .home-btn { transition: none; }
}
