/*
 * Lock screen ("Portico"): a dark brand panel beside the sign-in forms.
 * Loaded after styles.css so it owns every lock-screen rule; nothing here
 * applies once the shell is unlocked.
 *
 * All three faces are self-hosted and subset to Latin text; the portal must
 * not depend on a font CDN. Fraunces is additionally pinned to one optical
 * size with only the 300-400 weight span it uses, taking it from 67 KB to
 * 20 KB. Tenor Sans sets the wordmark and the resort names, Cormorant
 * Garamond italic the house line, Fraunces the sign-in headings. Marcellus
 * is declared here but used only by the CRM navigation rail.
 */

@font-face {
  font-family: Fraunces;
  src: url("assets/fonts/fraunces-display.woff2") format("woff2");
  font-weight: 300 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Cormorant Garamond";
  src: url("assets/fonts/cormorant-garamond-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  /* Retained for the CRM navigation rail, which names Marcellus but declares
     no face of its own. The lock screen no longer uses it. */
  font-family: Marcellus;
  src: url("assets/fonts/marcellus.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Tenor Sans";
  src: url("assets/fonts/tenor-sans.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* The account-setup panel is far taller than the sign-in panel, so the page
   scrolls rather than clipping it on a short window. */
body.locked {
  overflow: auto;
}

.lock-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 46fr) minmax(0, 54fr);
  background: var(--surface);
}

.lock-screen[hidden] {
  display: none;
}

/* Brand panel ---------------------------------------------------------- */

.lock-brand {
  position: relative;
  overflow: hidden;
  display: grid;
  align-content: space-between;
  gap: 28px;
  padding: clamp(24px, 3.2vw, 40px) clamp(22px, 3vw, 38px);
  background: var(--heading-color);
  color: #f2efe9;
}

/* A single skewed band crossing the panel every 11s. Transform only, so it
   stays on the compositor and never repaints the panel. */
.lock-brand::after {
  content: "";
  position: absolute;
  top: -60%;
  left: -40%;
  width: 40%;
  height: 220%;
  background: linear-gradient(
    90deg,
    transparent,
    color-mix(in srgb, var(--brand-gold-light) 13%, transparent),
    transparent
  );
  transform: rotate(14deg) translate3d(-40%, 0, 0);
  animation: lock-sheen 11s ease-in-out infinite;
  pointer-events: none;
}

@keyframes lock-sheen {
  0%, 62% { transform: rotate(14deg) translate3d(-40%, 0, 0); opacity: 0; }
  70% { opacity: 1; }
  100% { transform: rotate(14deg) translate3d(360%, 0, 0); opacity: 0; }
}

.lock-logo {
  position: relative;
  z-index: 2;
  width: 104px;
  height: 64px;
  object-fit: contain;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 620ms ease-out, transform 620ms ease-out;
}

.lock-logo.is-visible {
  opacity: 1;
  transform: none;
}

.lock-wordmark {
  position: relative;
  z-index: 2;
  margin: 0;
  justify-self: start;
  font-family: "Tenor Sans", ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(1.68rem, 4.65vw, 2.67rem);
  line-height: 1.22;
  letter-spacing: 0.16em;
  /* Tracking is trailing-side only, so indent by one step to keep the optical
     left edge flush with the logo and the house line below. */
  text-indent: 0.16em;
  color: var(--brand-gold-light);
}

.lock-wordmark-word {
  display: block;
}

/* The wordmark writes itself left to right, 42ms per letter, then the
   connector rule draws under PORTAL. Transform and opacity only. */
.lock-wordmark-char {
  display: inline-block;
  white-space: pre;
  animation: lock-rise 620ms cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(var(--i) * 42ms);
}

.lock-wordmark .lock-wordmark-step {
  position: relative;
  padding-left: 2.1em;
}

/* The rule bridges the indent so the offset reads as deliberate, and draws
   itself once the last letter has landed. */
.lock-wordmark .lock-wordmark-step::before {
  content: "";
  position: absolute;
  left: 0.1em;
  top: 50%;
  width: 1.55em;
  height: 1px;
  background: var(--brand-gold);
  transform-origin: left center;
  animation: lock-draw 560ms cubic-bezier(0.22, 1, 0.36, 1) 700ms both;
}

@keyframes lock-draw {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

.lock-marquee {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 14px;
}

.lock-signature {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  font-size: clamp(1.46rem, 3.55vw, 2.3rem);
  font-weight: 400;
  font-style: italic;
  line-height: 1.2;
  letter-spacing: 0.01em;
  color: var(--brand-gold-light);
  animation: lock-rise 900ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.lock-rotator {
  position: relative;
  height: 2.8em;
  overflow: hidden;
  font-family: "Tenor Sans", ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(0.94rem, 2.2vw, 1.35rem);
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1.25;
  color: rgba(242, 239, 233, 0.82);
}

.lock-rotator span {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: translateY(0.5em);
  transition: opacity 620ms ease, transform 720ms cubic-bezier(0.22, 1, 0.36, 1);
}

.lock-rotator span.is-current {
  opacity: 1;
  transform: none;
}

.lock-rotator em {
  font-style: normal;
  color: var(--brand-gold-light);
}

.lock-rule {
  position: relative;
  height: 1px;
  margin-top: 4px;
  background: rgba(242, 239, 233, 0.16);
}

.lock-rule::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 34%;
  background: var(--brand-gold);
  animation: lock-tick 11s ease-in-out infinite;
}

@keyframes lock-tick {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(190%); }
}

@keyframes lock-rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

/* Form panel ----------------------------------------------------------- */

.lock-forms {
  display: grid;
  place-items: center;
  padding: clamp(28px, 4vw, 56px) clamp(22px, 4vw, 56px);
}

.lock-layout {
  width: min(376px, 100%);
}

.lock-panel {
  width: 100%;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.lock-panel h1 {
  margin: 0;
  font-family: Fraunces, Georgia, "Times New Roman", serif;
  font-size: 2rem;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--heading-color);
}

.lock-intro {
  margin: 6px 0 24px;
  color: var(--muted);
  font-size: 0.86rem;
}

.lock-panel .eyebrow {
  margin-bottom: 6px;
}

.lock-field {
  margin-bottom: 14px;
}

.lock-field input {
  width: 100%;
  min-height: 46px;
  border-radius: 8px;
}

.lock-field input:focus-visible {
  border-color: var(--brand-gold);
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-gold) 13%, transparent);
}

.lock-panel button {
  width: 100%;
  min-height: 46px;
  border-radius: 8px;
}

.lock-error {
  margin: 12px 0 0;
  color: var(--error);
  font-size: 0.86rem;
  font-weight: 700;
}

.lock-error.success {
  color: var(--ok);
}

.auth-copy,
.password-policy,
.auth-status {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.55;
}

.auth-status {
  margin: 12px 0 0;
  color: var(--ok);
  font-weight: 700;
}

.lock-panel .auth-link-button {
  min-height: 34px;
  margin-top: 8px;
  border: 0;
  color: var(--strong);
  background: transparent;
  box-shadow: none;
}

.lock-panel .auth-link-button:hover {
  text-decoration: underline;
}

.verification-code {
  text-align: center;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}

.password-policy {
  margin-top: -3px;
  font-size: 0.76rem;
}

/* Stacked layout ------------------------------------------------------- */

@media (max-width: 760px) {
  .lock-screen {
    grid-template-columns: minmax(0, 1fr);
  }

  .lock-brand {
    gap: 20px;
    padding: 22px 22px 26px;
  }

  .lock-wordmark {
    font-size: 1.58rem;
  }

  .lock-signature {
    font-size: 1.83rem;
  }

  .lock-rotator {
    font-size: 0.98rem;
  }

  .lock-forms {
    padding: 30px 22px 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lock-brand::after,
  .lock-rule::after,
  .lock-signature,
  .lock-wordmark,
  .lock-wordmark-char,
  .lock-wordmark .lock-wordmark-step::before {
    animation: none;
  }

  .lock-brand::after {
    opacity: 0;
  }

  .lock-logo,
  .lock-rotator span {
    transform: none;
    transition: none;
  }
}
