/* --- LOGIN PAGE (login.html) --- the site's own pieces: hero photo on the left, the tailor's tape
   down the seam, and the form on the dark navy in the house type (serif italic + mono labels). */
.login-page {
  --split: 44vw;
  min-height: 100vh;
  overflow-x: clip;
  background-color: rgb(10, 12, 20);
  color: #f5f0e1;
}

/* The login form is a continuous page, not a section carousel. */
html:has(.login-page) {
  scroll-snap-type: none;
}

body.login-page > main {
  scroll-snap-align: none;
  scroll-snap-stop: normal;
}

.login-top .footer-logo em {
  display: none;
}

/* the photo's right edge is cut along the thread's path (clip-path set in login.js), so the thread
   looks like it's sewing the photo onto the page */
.login-visual {
  position: fixed;
  inset: 0 auto 0 0;
  width: 100vw; /* only the left part shows (clip-path); the rest is there for the sweep out */
  overflow: hidden;
  transition: clip-path 1.1s cubic-bezier(0.65, 0, 0.35, 1);
}

/* same photo, fade and slow zoom as the home hero */
.login-visual::before {
  content: "";
  position: absolute;
  inset: -30px auto -30px -30px; /* reaches past the edges so the blur doesn't fade them */
  width: calc(var(--split) + 180px); /* framed on the left half; widens to the full screen on the way out */
  background: var(--visual-image, url("../assets/images/hero.jpg")) var(--visual-focus, center) / cover; /* set per section in login.js */
  filter: blur(8px) brightness(0.8); /* soft and dimmed: the form keeps the focus */
  transition:
    width 1.1s cubic-bezier(0.65, 0, 0.35, 1),
    filter 1.1s ease;
  animation: slow-zoom 3s cubic-bezier(0.19, 1, 0.22, 1) both;
}

.login-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, rgba(10, 12, 20, 0.7), transparent 30%),
    linear-gradient(to top, rgb(10, 12, 20), rgba(10, 12, 20, 0.35) 45%, transparent 70%);
}

.login-visual-copy {
  position: absolute;
  left: 40px;
  width: calc(var(--split) - 150px); /* clear of the cut edge and the thread */
  bottom: 48px;
  z-index: 1;
}

.login-visual-copy h6 {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: #f4a300;
  animation: enter-rise 0.9s cubic-bezier(0.19, 1, 0.22, 1) 0.3s both;
}

.login-visual-copy p {
  margin-top: 16px;
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-size: clamp(2.2rem, 3.6vw, 3.4rem);
  line-height: 1;
  animation: enter-rise 1s cubic-bezier(0.19, 1, 0.22, 1) 0.45s both;
}

.login-visual-copy em {
  color: #f4a300;
}

/* needle and thread down the seam: the thread draws itself in loose loops behind the needle (login.js) */
.login-thread {
  position: fixed;
  top: 0;
  left: calc(var(--split) - 60px);
  z-index: 3;
  width: 120px;
  height: 100vh;
  overflow: visible;
  pointer-events: none;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.5));
}

/* the thread: a soft shadow on the cloth, the gold strand, and a twist of lighter fibres along it */
/* the photo's cut edge casts a soft shadow onto the page, like a layer of cloth */
.seam-edge {
  fill: none;
  stroke: rgba(0, 0, 0, 0.55);
  stroke-width: 7;
  transform: translate(3px, 1px);
  filter: blur(4px);
}

.thread path {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.thread-shadow {
  stroke: rgba(0, 0, 0, 0.6);
  stroke-width: 2.6;
  transform: translate(1.2px, 2px);
  filter: blur(1px);
}

.thread-body {
  stroke: #e89b06;
  stroke-width: 2;
}

/* the twisted plies: short dark bands across the thread, like the ridges of a twisted cord */
.thread path.thread-ply {
  stroke: rgba(122, 64, 0, 0.55);
  stroke-width: 2;
  stroke-dasharray: 0.9 1.6;
  stroke-linecap: butt;
}

.thread-twist {
  stroke: #ffd37a;
  stroke-width: 0.7;
  stroke-dasharray: 1.2 1.3;
  stroke-dashoffset: 0.6;
  opacity: 0.75;
}

.thread-body,
.thread-ply,
.thread-twist {
  filter: url(#fibre);
}

.thread-mask {
  fill: none;
  stroke: white;
  stroke-width: 10;
}

/* holes: fade in as the needle reaches them */
.thread-holes > g {
  opacity: 0;
  transition: opacity 0.5s ease;
}

.thread-holes > g.is-open {
  opacity: 1;
}

.thread-holes .lip {
  fill: none;
  stroke: rgba(245, 240, 225, 0.22);
  stroke-width: 0.7;
  stroke-linecap: round;
}

.thread-holes .slit {
  fill: rgb(2, 3, 6);
}

.needle-body {
  fill: url(#needle-steel);
}

.needle-shine {
  fill: none;
  stroke: rgba(255, 255, 255, 0.85);
  stroke-width: 0.35;
  stroke-linecap: round;
}

/* the eye: an opening with a thin gold rim */
.needle-eye {
  fill: none;
  stroke: #e8a317;
  stroke-width: 0.45;
}

.needle-tail {
  fill: none;
  stroke: #e89b06;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.login-top {
  position: relative;
  z-index: 4;
}

.login {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 136px);
  margin-left: var(--split);
  padding: 20px 64px 64px;
  box-sizing: border-box;
}

.login-form {
  width: min(420px, 100%);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.login-form > * {
  animation: enter-rise 0.8s cubic-bezier(0.19, 1, 0.22, 1) both;
}

.login-form > :nth-child(2) {
  animation-delay: 0.1s;
}

.login-form > :nth-child(3) {
  animation-delay: 0.2s;
}

.login-form > :nth-child(n + 4) {
  animation-delay: 0.3s;
}

/* reset: arriving from a "forgot password" email, only the new-password fields show */
.login-form:not([data-mode="reset"]) .reset-only,
.login-form[data-mode="reset"]
  :is(.login-only, .signup-only:not(.new-password), .login-tabs, .login-socials, .login-divider, .email-field),
.login-form[data-mode="login"] .signup-only,
.login-form[data-mode="signup"] .login-only {
  display: none;
}

.login-form h6 {
  display: flex;
  align-items: center;
  gap: 16px;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: #f4a300;
}

.login-form h6::before {
  content: "";
  width: 40px;
  height: 1px;
  background-color: #f4a300;
}

.login-title {
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(3rem, 5vw, 4.2rem);
  line-height: 0.95;
}

.login-title em {
  color: #f4a300;
}

/* heading and subtitle rise in again whenever the mode switches */
.login-title > span,
.login-sub > span {
  display: inline-block;
  animation: enter-rise 0.6s cubic-bezier(0.19, 1, 0.22, 1);
}

.login-sub {
  font-family: "Inter", sans-serif;
  font-size: 0.9rem;
  line-height: 1.6;
  color: rgba(245, 240, 225, 0.7);
}

/* Log in / Sign up: text tabs with a gold underline that slides across */
.login-tabs {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: 8px;
  border-bottom: 1px solid rgba(245, 240, 225, 0.15);
}

.login-tabs::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 50%;
  height: 2px;
  background-color: #f4a300;
  transition: translate 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}

.login-form[data-mode="signup"] .login-tabs::after {
  translate: 100% 0;
}

.login-tabs button {
  padding: 14px 0;
  background: none;
  color: rgba(245, 240, 225, 0.62);
  font-size: 11px;
  transition: color 0.3s ease;
}

.login-tabs button:hover {
  background: none;
  color: #f5f0e1;
}

.login-tabs button[aria-selected="true"] {
  color: #f4a300;
}

.login-socials {
  display: grid;
  gap: 10px;
}

.login-social {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 20px;
  background: transparent;
  border: 1px solid rgba(245, 240, 225, 0.2);
  color: #f5f0e1;
  transition:
    border-color 0.3s ease,
    background-color 0.3s ease;
}

.login-social:hover {
  border-color: #f4a300;
  background-color: rgba(244, 163, 0, 0.08);
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: rgba(245, 240, 225, 0.62);
}

.login-divider::before,
.login-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background-color: rgba(245, 240, 225, 0.12);
}

/* underlined inputs whose label sits on the line, then lifts into a mono caption */
.float-field {
  position: relative;
  padding-top: 14px;
}

.float-field input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 0;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(245, 240, 225, 0.3);
  border-radius: 0;
  color: #f5f0e1;
  font-family: "Inter", sans-serif;
  font-size: 1rem;
  color-scheme: dark;
  transition: border-color 0.3s ease;
}

.float-field input:focus {
  outline: none;
  border-bottom-color: #f4a300;
}

.float-field label {
  position: absolute;
  left: 0;
  top: 24px;
  font-family: "Inter", sans-serif;
  font-size: 1rem;
  color: rgba(245, 240, 225, 0.62);
  pointer-events: none;
  transition:
    top 0.3s cubic-bezier(0.19, 1, 0.22, 1),
    font-size 0.3s ease,
    letter-spacing 0.3s ease,
    color 0.3s ease;
}

.float-field input:focus + label,
.float-field input:not(:placeholder-shown) + label {
  top: 0;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: rgba(245, 240, 225, 0.6);
}

.float-field input:focus + label {
  color: #f4a300;
}

.float-field input:-webkit-autofill {
  -webkit-text-fill-color: #f5f0e1;
  transition: background-color 600000s 0s;
}

.float-field:has(.password-toggle) input {
  padding-right: 60px;
}

.password-toggle {
  position: absolute;
  right: 0;
  bottom: 8px;
  padding: 4px 0;
  background: none;
  color: rgba(245, 240, 225, 0.6);
}

.password-toggle:hover {
  background: none;
  color: #f4a300;
}

.login-forgot {
  align-self: flex-end;
  margin-top: -6px;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.15em;
  color: rgba(245, 240, 225, 0.55);
  text-decoration: none;
  transition: color 0.3s ease;
}

.login-forgot:hover {
  color: #f4a300;
}

.login-submit {
  margin-top: 6px;
  padding: 17px;
}

/* signed in: a gold wash sweeps across the button, then "Logged in" rises with a tick drawing itself */
.login-submit {
  position: relative;
  overflow: hidden;
}
.login-submit span {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.login-submit::before {
  content: "";
  position: absolute;
  inset: 0;
  background: #f4a300;
  transform: scaleX(0);
  transform-origin: left;
}
.login-submit.is-done {
  color: #0a0c14;
  pointer-events: none;
}
.login-submit.is-done::before {
  animation: login-wash 0.55s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}
.login-submit.is-done span {
  animation: login-rise 0.45s 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.login-submit.is-done svg path {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 24;
  stroke-dashoffset: 24;
  animation: login-tick 0.4s 0.6s ease-out forwards;
}
@keyframes login-wash {
  to {
    transform: scaleX(1);
  }
}
@keyframes login-rise {
  from {
    opacity: 0;
    translate: 0 70%;
  }
}
@keyframes login-tick {
  to {
    stroke-dashoffset: 0;
  }
}

.login-note {
  min-height: 1.2em;
  margin-top: -8px;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: #f4a300;
}

.login-terms {
  margin-top: -8px;
  font-family: "Inter", sans-serif;
  font-size: 0.75rem;
  line-height: 1.6;
  color: rgba(245, 240, 225, 0.62);
}

.login-terms a {
  color: rgba(245, 240, 225, 0.75);
  transition: color 0.3s ease;
}

.login-terms a:hover {
  color: #f4a300;
}

/* narrow screens: photo becomes a short banner on top; no thread */
@media (max-width: 800px) {
  .login-page {
    --split: 0px;
  }

  .login-visual {
    position: relative;
    width: auto;
    height: 38vh;
    clip-path: none !important;
  }

  .login-visual::before {
    width: auto;
    right: -30px;
  }

  .login-visual-copy {
    width: auto;
    right: 40px;
  }

  .login-thread {
    display: none;
  }

  .login-top {
    position: absolute;
    inset: 0 0 auto 0;
  }

  .login {
    padding: 40px 20px 60px;
  }
}

@media (max-width: 700px) {
  .login-visual {
    height: min(34svh, 280px);
  }

  .login-visual-copy {
    right: 22px;
    left: 22px;
    bottom: 24px;
  }

  .login-visual-copy p {
    font-size: clamp(1.9rem, 10vw, 2.6rem);
  }

  .login-top .commission-top {
    padding: max(14px, env(safe-area-inset-top)) 16px 12px;
  }

  .login {
    min-height: 0;
    padding: 32px 18px 48px;
  }

  .login-form {
    gap: 16px;
  }

  .login-forgot {
    padding: 12px 0; /* a thumb-sized target around the small text */
  }
}

/* sign-up password rules: grey until met, then gold with a tick */
.password-rules {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: -8px;
  list-style: none;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  color: rgba(245, 240, 225, 0.62);
}

.password-rules li {
  transition: color 0.3s ease;
}

.password-rules li::before {
  content: "\25CB";
  margin-right: 6px;
}

.password-rules li.is-met {
  color: #f4a300;
}

.password-rules li.is-met::before {
  content: "\2713";
}

/* Confirm password slides in once the password passes */
.login-form > .confirm-field {
  animation: enter-rise 0.6s cubic-bezier(0.19, 1, 0.22, 1) both;
}

.confirm-message {
  display: block;
  min-height: 1em;
  margin-top: 8px;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
}

.confirm-field.is-match .confirm-message {
  color: #f4a300;
}

.confirm-field.is-mismatch .confirm-message {
  color: #ff7a6b;
}

.confirm-field.is-mismatch input {
  border-bottom-color: #ff7a6b;
}

/* Login: header doesn't drop in; the back link glides in from the right edge, and back out when clicked (login.js) */
.login-page .login-top {
  animation: none;
}

.login-top .commission-back {
  animation: slide-in-right 1.6s cubic-bezier(0.22, 1, 0.36, 1) 0.3s backwards;
  transition:
    color 0.3s ease,
    translate 1s cubic-bezier(0.45, 0, 0.55, 1),
    opacity 0.9s ease;
}

.login-top .commission-back.is-leaving {
  translate: calc(100% + 60px) 0;
  opacity: 0;
}

/* Leaving the login page (login.js): form and thread ease away, photo sweeps across and sharpens,
   then the section's colour covers everything for the hand-off */
.login,
.login-thread,
.login-visual-copy {
  transition:
    opacity 0.6s ease,
    translate 0.8s cubic-bezier(0.65, 0, 0.35, 1);
}

body.is-leaving .login {
  opacity: 0;
  translate: 60px 0;
}

body.is-leaving .login-thread,
body.is-leaving .login-visual-copy {
  opacity: 0;
}

body.is-leaving .login-visual::before {
  width: calc(100vw + 60px);
  filter: blur(0) brightness(1);
}

.login-leave-veil {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.login-leave-veil.is-on {
  opacity: 1;
}

/* Login page when you came from Services: the plain Services cream instead of a photo, with dark text */
.scene-light .login-visual::before {
  background: #f5f0e1;
  filter: none;
  animation: none;
}

.scene-light .login-visual::after {
  display: none;
}

.scene-light .login-visual-copy p,
.scene-light .login-top .footer-logo {
  color: #1a1a1a;
}

/* Login page when you came from a section with no photo and a dark colour (Reviews): a plain panel in that colour */
.scene-plain .login-visual::before {
  background: var(--visual-plain);
  filter: none;
  animation: none;
}

.scene-plain .login-visual::after {
  background: radial-gradient(ellipse 70% 50% at 20% 100%, rgba(244, 163, 0, 0.14), transparent);
}

/* Reviews scene: a large gold quote mark behind the panel's headline */
.scene-plain .login-visual-copy::before {
  content: "“";
  position: absolute;
  left: -12px;
  bottom: 100%;
  font-family: "Cormorant Garamond", serif;
  font-size: 16rem;
  line-height: 0.6;
  color: rgba(244, 163, 0, 0.35);
  animation: enter-rise 1.1s cubic-bezier(0.19, 1, 0.22, 1) 0.3s both;
}

@keyframes slide-in-right {
  from {
    translate: calc(100% + 60px) 0;
    opacity: 0;
  }
}
