/* UGC Insights sign-in page (app/Views/login.php), over vendored Bootstrap 5.3.8.
   Fonts and --ugc-* tokens come from ../ugc-theme.css, loaded first. */

:root {
  --auth-display: var(--ugc-display);
  --auth-text: var(--ugc-text);
  --auth-ease: cubic-bezier(0.16, 1, 0.3, 1);
}

::selection {
  background: var(--ugc-green);
  color: #fff;
}

/* ---------- Page: brand bottom-left, card top-right, footer under brand ---------- */
body.auth {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 452px;
  grid-template-rows: 1fr auto;
  column-gap: 40px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  padding: 0 clamp(32px, 8.33vw, 120px) 40px clamp(32px, 6.67vw, 96px);
  background: #00301C;
  color: var(--ugc-ink);
  font: 400 15px/1.45 var(--auth-text);
}

/* Fixed so the photo and wash still cover the page when a short screen scrolls. */
.auth__photo,
.auth__wash {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.auth__photo {
  background-image: var(--auth-photo, none);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* No photo: one smooth field. The photo wash's mid stops crease over flat green. */
.auth__wash {
  background: linear-gradient(100deg, #00301C 0%, #00653A 100%);
}

/* Positioned so they paint above the fixed photo layers. */
.auth__brand,
.auth__main,
.auth__foot {
  position: relative;
  z-index: 1;
  min-width: 0;
}

/* ---------- Brand ---------- */
.auth__brand {
  grid-column: 1;
  grid-row: 1;
  align-self: end;
  margin-bottom: 82px;
  color: #fff;
  animation: auth-rise .8s var(--auth-ease) both;
}

.auth__bars {
  display: flex;
  gap: 7px;
  height: 30px;
}

.auth__bars i {
  display: block;
  width: 22px;
  background: var(--ugc-red);
  transform: skewX(-24deg);
}

.auth__bars i.auth__bars-slab {
  width: 96px;
  background: #fff;
  opacity: .92;
}

.auth__title {
  margin: 26px 0 0;
  font: 700 clamp(64px, 6.67vw, 96px)/0.92 var(--auth-display);
  letter-spacing: -0.01em;
  color: #fff;
}

.auth__tagline {
  max-width: 32ch;
  margin: 20px 0 0;
  font-size: 19px;
  color: #CFE3D7;
}

.auth__foot {
  grid-column: 1;
  grid-row: 2;
  font-size: 13px;
  color: #B9D3C4;
}

.auth__foot strong,
.auth__foot span {
  display: block;
}

.auth__foot strong {
  font-weight: 500;
  color: #fff;
}

/* ---------- Receipt card and TEST carbon copies ---------- */
.auth__main {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: start;
  padding: clamp(32px, 11.5vh, 104px) 0 56px;
}

.auth-stack {
  position: relative;
  width: 452px;
  animation: auth-rise .8s var(--auth-ease) .08s both;
}

.auth-copy {
  position: absolute;
  inset: 0;
  border-radius: 3px;
}

.auth-copy--yellow {
  background: var(--ugc-yellow);
  transform: translate(8px, 8px);
}

.auth-copy--pink {
  background: var(--ugc-pink);
  transform: translate(16px, 16px);
}

.auth-card {
  position: relative;
  overflow: hidden;
  background: #fff;
  border-radius: 3px;
  box-shadow: 0 18px 40px rgba(0, 20, 10, .32);
  text-align: left;
}

.auth-card__body {
  padding: 28px 28px 26px;
}

.auth-card__body h2 {
  margin: 0;
  font: 600 30px/1.1 var(--auth-display);
  color: var(--ugc-ink);
}

.auth-card__lead {
  margin: 6px 0 0;
  color: var(--ugc-ink-2);
  text-wrap: pretty;
}

/* Bootstrap alert, re-cut to the card: square corners, red only for the error. */
.auth-card .alert {
  margin: 16px 0 0;
  padding: 9px 12px;
  border: 1px solid var(--ugc-red);
  border-radius: 3px;
  background: #FDEDEF;
  color: #9E1220;
  font-size: 14px;
  overflow-wrap: anywhere;
}

/* ---------- Boxed fields ---------- */
.auth-fields {
  margin-top: 22px;
  border: 1px solid var(--ugc-ink);
}

.auth-cell {
  position: relative;
  padding: 9px 14px 10px;
}

.auth-cell + .auth-cell {
  border-top: 1px solid var(--ugc-ink);
}

.auth-cell:focus-within {
  outline: 2px solid var(--ugc-green);
  outline-offset: -2px;
}

/* After focus so the error stays red until the user types. */
.auth-cell--invalid {
  outline: 2px solid var(--ugc-red);
  outline-offset: -2px;
}

.auth-cell--invalid:focus-within {
  outline-color: var(--ugc-red);
}

.auth-cell__label {
  display: block;
  margin: 0;
  font: 600 12px/1 var(--auth-display);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ugc-ink-2);
}

.auth-cell--invalid .auth-cell__label {
  color: var(--ugc-red);
}

.auth-cell__input {
  display: block;
  width: 100%;
  height: 22px;
  margin-top: 7px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ugc-ink);
  caret-color: var(--ugc-green);
  font: 400 17px/22px var(--auth-text);
}

/* Darker than a typical placeholder gray to clear 4.5:1 contrast on white. */
.auth-cell__input::placeholder {
  color: #697389;
  opacity: 1;
}

/* Room for the eye toggle. Fixed on #password so browsers without :has() still get it. */
#password.auth-cell__input,
.auth-cell:has(.auth-cell__toggle) .auth-cell__input {
  padding-right: 36px;
}

/* Keep autofilled cells white with ink text instead of the browser tint. */
.auth-cell__input:-webkit-autofill,
.auth-cell__input:-webkit-autofill:hover,
.auth-cell__input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 40px #fff inset;
  -webkit-text-fill-color: var(--ugc-ink);
  caret-color: var(--ugc-green);
  transition: background-color 9999s ease-out 0s;
}

.auth-cell__toggle {
  position: absolute;
  right: 7px;
  bottom: 5px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--ugc-ink-2);
  font-size: 18px;
  line-height: 1;
}

.auth-cell__toggle:hover {
  color: var(--ugc-ink);
}

/* ---------- Sign in button ---------- */
.btn-signin {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 52px;
  margin-top: 18px;
  padding: 0 16px;
  border: 0;
  border-radius: 3px;
  background: var(--ugc-green);
  color: #fff;
  font: 600 18px/1 var(--auth-display);
  letter-spacing: .04em;
  transition: background-color .18s var(--auth-ease);
}

.btn-signin:hover {
  background: var(--ugc-green-deep);
}

.btn-signin .arrow {
  font-size: 18px;
  transition: transform .18s var(--auth-ease);
}

.btn-signin:hover .arrow {
  transform: translateX(4px);
}

.btn-signin:disabled {
  background: var(--ugc-green-deep);
  cursor: progress;
}

.btn-signin:focus-visible {
  outline: 2px solid var(--ugc-green);
  outline-offset: 2px;
}

/* The cell already shows the focus ring, so the toggle gets a solid fill, not a second ring. */
.auth-cell__toggle:focus-visible {
  outline: 0;
  color: #fff;
  background: var(--ugc-green);
}

/* ---------- Divider, Google, TEST strip ---------- */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: var(--ugc-ink-2);
  font-size: 13px;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--ugc-rule);
}

.auth-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 28px;
  border-top: 1px solid #E2CF7E;
  background: var(--ugc-yellow);
  color: #5B4A0E;
  font: 600 13px/1.3 var(--auth-display);
  letter-spacing: .1em;
  text-transform: uppercase;
}

/* ---------- Spinners, shake, entrance (starts visible: the page is used daily) ---------- */
.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(0, 0, 0, .1);
  border-top-color: var(--ugc-green);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.btn-spinner {
  display: inline-block;
  width: 1.05rem;
  height: 1.05rem;
  border: 2px solid rgba(255, 255, 255, .5);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.shake { animation: shake .4s ease; }

@keyframes auth-rise {
  from { opacity: .6; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .auth__brand,
  .auth-stack,
  .shake { animation: none; }
  .btn-signin,
  .btn-signin .arrow { transition: none; }
}

/* ---------- Short desktops (1366x768 laptops give ~650px): keep strip and footer in view ---------- */
@media (min-width: 992px) and (max-height: 720px) {
  body.auth {
    padding-bottom: 24px;
  }

  .auth__main {
    padding: 24px 0;
  }

  .auth-card__body {
    padding: 18px 28px 20px;
  }
}

/* ---------- Phones and tablets: one column, brand above card, page scrolls ---------- */
@media (max-width: 991.98px) {
  body.auth {
    display: flex;
    flex-direction: column;
    padding: 40px 16px 28px;
  }

  .auth__brand,
  .auth__main,
  .auth__foot {
    width: 100%;
    max-width: 452px;
    margin-inline: auto;
  }

  .auth__brand {
    margin-bottom: 28px;
  }

  .auth__bars {
    gap: 5px;
    height: 22px;
  }

  .auth__bars i {
    width: 16px;
  }

  .auth__bars i.auth__bars-slab {
    width: 70px;
  }

  .auth__title {
    margin-top: 18px;
    font-size: 48px;
  }

  .auth__tagline {
    margin-top: 12px;
    font-size: 17px;
  }

  .auth__main {
    padding: 0;
  }

  .auth-stack {
    width: 100%;
  }

  /* Smaller offsets so the copies stay inside the 16px gutter. */
  .auth-stack--test {
    width: calc(100% - 10px);
    margin-bottom: 10px;
  }

  .auth-copy--yellow {
    transform: translate(5px, 5px);
  }

  .auth-copy--pink {
    transform: translate(10px, 10px);
  }

  .auth-card__body {
    padding: 22px 20px 24px;
  }

  .auth-strip {
    padding: 10px 20px;
  }

  .auth__foot {
    margin-top: 28px;
  }
}

/* ---------- Marketing background (login-bg.png): white page, the image carries the brand ---------- */
body.auth--photo {
  background: #fff;
}

.auth--photo .auth__wash {
  display: none;
}

/* Wordmark sits top-left and the laptop bottom-left; 40% keeps both in view on wide, short viewports. */
.auth--photo .auth__photo {
  background-position: left 40%;
}

/* The image already shows the title and logo; the h1 stays for screen readers. */
.auth--photo .auth__brand {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  animation: none;
}

/* Bottom-left belongs to the laptop art, so the footer moves under the card. */
body.auth--photo {
  grid-template-rows: auto 1fr;
}

.auth--photo .auth__main {
  grid-row: 1;
  padding-bottom: 20px;
}

/* White backing keeps the small text readable over the wave lines. */
.auth--photo .auth__foot {
  grid-column: 2;
  grid-row: 2;
  align-self: start;
  justify-self: start;
  padding: 8px 12px;
  border-radius: 3px;
  background: rgba(255, 255, 255, .92);
  color: var(--ugc-ink-2);
}

.auth--photo .auth__foot strong {
  color: var(--ugc-ink);
}

/* On white the dark-field shadow reads as a smudge; a softer lift plus a hairline keeps the edge. */
.auth--photo .auth-card {
  box-shadow: 0 0 0 1px rgba(31, 42, 68, .1), 0 16px 36px rgba(0, 40, 20, .16);
}

/* Below 1200px the card would cover the wordmark, so stack: cropped brand banner, card, footer. */
@media (max-width: 1199.98px) {
  body.auth--photo {
    display: flex;
    flex-direction: column;
    padding: 32px 16px 28px;
  }

  .auth--photo .auth__main,
  .auth--photo .auth__foot {
    width: 100%;
    max-width: 452px;
    margin-inline: auto;
  }

  .auth--photo .auth__main {
    padding: 0;
  }

  .auth--photo .auth__foot {
    margin-top: 28px;
    padding: 0;
    background: none;
  }

  /* Crop to the wordmark + logo (image px x 175-735, y 60-490 of 1920x1080). */
  .auth--photo .auth__photo {
    position: relative;
    inset: auto;
    width: min(100%, 320px);
    margin: 0 auto 24px;
    aspect-ratio: 560 / 430;
    background-size: 342.857% auto;
    background-position: 12.868% 9.231%;
  }
}
