/* Sign-in screen only. Loaded after app.css, so it can lean on the shared
   tokens (--teal, --line, --radius) and only add what this one page needs. */

body.auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1rem;
  overflow-x: hidden;
  /* A slow drift across an oversized gradient: movement without anything
     actually moving on screen, so it stays cheap on a phone. */
  background:
    radial-gradient(1100px 620px at 12% 8%, rgba(255, 255, 255, .55), transparent 62%),
    radial-gradient(900px 520px at 88% 92%, rgba(190, 222, 216, .5), transparent 64%),
    linear-gradient(155deg, #dcece9 0%, #cfe3df 42%, #dfe8e4 100%);
  background-size: 160% 160%, 160% 160%, 200% 200%;
  animation: auth-drift 26s ease-in-out infinite alternate;
}

@keyframes auth-drift {
  from { background-position: 0% 0%, 100% 100%, 0% 50%; }
  to   { background-position: 30% 24%, 70% 74%, 100% 50%; }
}

/* ------------------------------ floating seeds ------------------------------ */
/* The real logo mark, blown across the background like dandelion seeds. */
.seeds { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }

.seeds i {
  position: absolute;
  display: block;
  background-color: #6c9a94;      /* seeds read as shadow on the pale ground */
  -webkit-mask: url("/icons/qht-mark.png") center / contain no-repeat;
  mask: url("/icons/qht-mark.png") center / contain no-repeat;
  opacity: 0;
  animation: seed-float linear infinite;
  will-change: transform, opacity;
}

@keyframes seed-float {
  0%   { transform: translate3d(0, 12vh, 0) rotate(0deg) scale(.85); opacity: 0; }
  12%  { opacity: var(--peak); }
  88%  { opacity: var(--peak); }
  100% { transform: translate3d(var(--drift), -112vh, 0) rotate(var(--spin)) scale(1.1); opacity: 0; }
}

/* ------------------------------- the window ------------------------------- */
.auth-shell {
  position: relative;
  z-index: 1;
  width: min(100%, 940px);
  display: grid;
  grid-template-columns: 1.02fr .98fr;
  background: var(--card);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 24px 60px -26px rgba(20, 60, 56, .38), 0 2px 6px rgba(20, 60, 56, .1);
  animation: shell-in .55s cubic-bezier(.22, 1, .36, 1) both;
}

@keyframes shell-in {
  from { opacity: 0; transform: translateY(18px) scale(.985); }
  to   { opacity: 1; transform: none; }
}

/* ------------------------------- brand panel ------------------------------- */
.auth-brand {
  position: relative;
  overflow: hidden;
  padding: 2.6rem 2.2rem;
  color: #3d5a56;
  background-color: #d8e9e5;
  background-image: linear-gradient(160deg, #e6f2ef 0%, #d8e9e5 48%, #e7efe8 100%);
  border-right: 1px solid #cbe2de;
  display: grid;
  align-content: center;
  gap: 1.25rem;
}

/* an oversized mark bled off the corner, as a watermark */
.auth-brand::after {
  content: "";
  position: absolute;
  right: -22%; bottom: -26%;
  width: 78%; aspect-ratio: 482 / 426;
  background-color: #7fada7;
  opacity: .22;
  -webkit-mask: url("/icons/qht-mark.png") center / contain no-repeat;
  mask: url("/icons/qht-mark.png") center / contain no-repeat;
  animation: watermark-turn 90s linear infinite;
}

@keyframes watermark-turn { to { transform: rotate(360deg); } }

.auth-brand > * { position: relative; }

.auth-brand .brandmark {
  width: 104px; height: 132px;                 /* 495 x 630 artwork */
  background-color: var(--teal-dark);
}

.auth-brand h1 { color: var(--ink); font-size: 1.55rem; margin: 0; letter-spacing: -.01em; }
.auth-brand .lede { color: #46625e; margin: 0; max-width: 34ch; }

.auth-points { list-style: none; padding: 0; margin: 0; display: grid; gap: .7rem; }

.auth-points li {
  display: flex; gap: .65rem; align-items: center;
  font-size: .88rem; color: #3d5a56;
  animation: point-in .5s ease-out both;
}
.auth-points li:nth-child(1) { animation-delay: .18s; }
.auth-points li:nth-child(2) { animation-delay: .28s; }
.auth-points li:nth-child(3) { animation-delay: .38s; }

@keyframes point-in {
  from { opacity: 0; transform: translateX(-10px); }
  to   { opacity: 1; transform: none; }
}

.auth-points .ic {
  flex: 0 0 auto;
  width: 30px; height: 30px; border-radius: 9px;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, .72);
  border: 1px solid #cbe2de;
}
.auth-points svg {
  width: 15px; height: 15px; stroke: #2f6f68; fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

/* -------------------------------- form side -------------------------------- */
.auth-form { padding: 2.6rem 2.2rem; display: grid; align-content: center; }
.auth-form .head { margin-bottom: 1.4rem; }
.auth-form .head h2 { font-size: 1.3rem; margin-bottom: .2rem; }
.auth-form .head p { margin: 0; }

/* the logo only appears here once the brand panel is gone (small screens) */
.auth-form .head .qht-logo { display: none; }

/* --------------------------- floating-label fields --------------------------- */
/* The label starts where the text will go and lifts into the top of the box
   once there is a value, so the form reads as three lines instead of six. */
.f-float { position: relative; margin-bottom: 1.05rem; }

.f-float > label {
  position: absolute;
  left: .85rem; top: .5rem;
  margin: 0;
  font-size: .72rem;
  font-weight: 600;
  color: var(--teal-dark);
  pointer-events: none;
  transition: top .16s ease, font-size .16s ease, color .16s ease;
}

.f-float input {
  width: 100%;
  height: 56px;
  padding: 1.35rem .85rem .4rem;
  font-size: .95rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  transition: border-color .16s ease, box-shadow .16s ease;
}

.f-float input::placeholder { color: transparent; }

.f-float input:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(13, 148, 136, .14);
}

/* Resting state: nothing typed and not focused, so the label sits on the line
   where the text will go. :has() keeps this working even though the password
   input gets wrapped by the reveal button. */
.f-float:has(input:placeholder-shown:not(:focus)) > label {
  top: 1.05rem;
  font-size: .95rem;
  font-weight: 500;
  color: var(--muted);
}

/* This file loads after app.css, so the field padding above would otherwise
   win and let the text run underneath the reveal button. */
.f-float .pw-field input { padding-right: 2.7rem; }

.caps {
  margin: .4rem 0 0;
  font-size: .74rem;
  color: var(--amber);
  display: flex; gap: .35rem; align-items: center;
}
/* display:flex above would otherwise beat the browser's own [hidden] rule */
.caps[hidden] { display: none; }

/* --------------------------------- button --------------------------------- */
.auth-form .btn.block {
  position: relative;
  overflow: hidden;
  height: 50px;
  font-size: .98rem;
  transition: transform .12s ease, box-shadow .16s ease;
}
.auth-form .btn.block:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px -8px rgba(13, 148, 136, .8);
}
.auth-form .btn.block:active:not(:disabled) { transform: translateY(0); }

/* click ripple, positioned by the click handler */
.ripple {
  position: absolute;
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
  background: rgba(255, 255, 255, .45);
  animation: ripple .5s ease-out forwards;
  pointer-events: none;
}
@keyframes ripple { to { transform: translate(-50%, -50%) scale(1); opacity: 0; } }

.spinner {
  width: 15px; height: 15px;
  border: 2px solid rgba(255, 255, 255, .4);
  border-top-color: #fff;
  border-radius: 50%;
  display: inline-block;
  vertical-align: -2px;
  margin-right: .5rem;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* a wrong password should be felt, not just read */
.shake { animation: shake .4s ease; }
@keyframes shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-7px); }
  40%, 60% { transform: translateX(7px); }
}

.auth-foot { margin-top: 1.1rem; text-align: center; }

/* -------------------------------- narrow -------------------------------- */
@media (max-width: 899px) {
  .auth-shell { grid-template-columns: 1fr; width: min(100%, 430px); border-radius: 18px; }
  .auth-brand { display: none; }
  .auth-form { padding: 1.9rem 1.4rem; }
  .auth-form .head { text-align: center; }
  .auth-form .head .qht-logo {
    display: block;
    width: 84px; height: 107px;
    margin: 0 auto .7rem;
    color: var(--teal-dark);
  }
}

@media (prefers-reduced-motion: reduce) {
  body.auth, .seeds i, .auth-brand::after, .auth-shell, .auth-points li { animation: none; }
  .seeds i { opacity: .12; }
  .auth-form .btn.block:hover:not(:disabled) { transform: none; }
}
