/*
 * Login pages redesign (login, email verification and the four password reset pages), loaded by each of
 * those templates after buttons_redesign.css. Every rule is scoped to main.sd-auth.
 * Brand colours from scoutdecision.css: navy #29364D, green #50D878. Buttons share the "Try For Free"
 * look (buttons_redesign.css tokens).
 * Layout: on large screens a navy panel on the left (the app video darkened behind the site's
 * testimonials, one quote at a time, and every club of the site sliding in two rows) and the form on the
 * right; on tablets and phones the form comes first and only the clubs band stays, below it, so the form
 * fits without scrolling. Markup in accounts/includes/auth_stage.html, motion helpers in auth_stage.js.
 */

/* ------------------------------------------------------------------ Tokens and shell */

.sd-auth {
  --sd-text: #1B2333;
  --sd-body: #3B4658;
  --sd-muted: #5F6A7D;
  --sd-ground: #F2F4F7;
  --sd-field: #F7F8FA;
  --sd-line: #D9DFE7;
  --sd-navy: #29364D;
  --sd-navy-dark: #1F2A3D;
  --sd-navy-deep: #172131;
  --sd-green: #50D878;
  --sd-green-text: #157A43;
  --sd-danger: #B42318;
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  background: #FFFFFF;
  font-family: "Inter", sans-serif;
  color: var(--sd-body);
}

.sd-auth-stage {
  isolation: isolate;
  background: var(--sd-navy-deep);
}

.sd-auth-bg {
  position: absolute;
  z-index: -2;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(3px) saturate(0.7);
  transform: scale(1.06);
}

.sd-auth-stage::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 50% 0%, rgba(80, 216, 120, 0.2) 0%, transparent 70%),
    radial-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px) 0 0 / 22px 22px,
    linear-gradient(160deg, rgba(41, 54, 77, 0.84) 0%, rgba(23, 33, 49, 0.93) 100%);
}

/* ------------------------------------------------------------------ Form (shared) */

.sd-auth-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.75rem;
  min-width: 0;
}

.sd-auth-card {
  width: 100%;
  max-width: 26rem;
}

.sd-auth-logo {
  display: inline-flex;
  margin-bottom: 2rem;
  border-radius: 50%;
  transition: transform .3s ease;
}

.sd-auth-logo:hover {
  transform: rotate(-8deg) scale(1.05);
}

.sd-auth-logo img {
  display: block;
  height: 3rem;
  width: auto;
}

/* Password reset pages: the logo on the left and "Back" to the login on the right */
.sd-auth-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.sd-auth .sd-auth-top .sd-auth-logo {
  margin: 0;
}

.sd-auth .sd-auth-back {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.4375rem 0.875rem 0.4375rem 0.625rem;
  border: 1.5px solid var(--sd-line);
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--sd-body);
  text-decoration: none;
  transition: border-color .2s ease, color .2s ease, background-color .2s ease;
}

.sd-auth .sd-auth-back:hover {
  border-color: var(--sd-navy);
  background: var(--sd-field);
  color: var(--sd-text);
}

.sd-auth .sd-auth-back .feather {
  transition: transform .2s ease;
}

.sd-auth .sd-auth-back:hover .feather {
  transform: translateX(-2px);
}

/* The three steps of the reset as round icons joined by a line: done in green, the current one ringed */
.sd-reset-steps {
  display: flex;
  align-items: center;
  margin: 0 0 1.5rem;
  padding: 0;
  list-style: none;
}

.sd-reset-steps li {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 2.5rem;
  height: 2.5rem;
  border: 1.5px solid var(--sd-line);
  border-radius: 50%;
  background: #FFFFFF;
  font-size: 1rem;
  color: #8C98AB;
}

/* The line before every step but the first, green once that step is reached */
.sd-reset-steps li + li {
  margin-left: 2.75rem;
}

.sd-reset-steps li + li::before {
  content: "";
  position: absolute;
  right: calc(100% + 0.375rem);
  top: 50%;
  width: 2rem;
  height: 2px;
  border-radius: 999px;
  background: var(--sd-line);
}

.sd-reset-steps li.is-done,
.sd-reset-steps li.is-current {
  border-color: var(--sd-green);
}

.sd-reset-steps li.is-done {
  background: var(--sd-green);
  color: var(--sd-navy-dark);
}

.sd-reset-steps li.is-current {
  background: rgba(80, 216, 120, 0.14);
  color: var(--sd-green-text);
  box-shadow: 0 0 0 4px rgba(80, 216, 120, 0.18);
}

.sd-reset-steps li.is-done + li::before,
.sd-reset-steps li.is-done + li.is-current::before {
  background: var(--sd-green);
}

/* Fields with an icon inside on the left */
.sd-auth .sd-auth-field {
  position: relative;
}

.sd-auth .sd-auth-field > .feather {
  position: absolute;
  /* Above the field, which Bootstrap's input group raises to 5 while it has focus */
  z-index: 6;
  left: 1.125rem;
  top: 1.6875rem;
  transform: translateY(-50%);
  font-size: 1.125rem;
  color: #8C98AB;
  pointer-events: none;
  transition: color .2s ease;
}

.sd-auth .sd-auth-field .form-control {
  padding-left: 3rem;
}

.sd-auth .sd-auth-field:focus-within > .feather {
  color: var(--sd-green-text);
}

/* Round icon above the title on the verification and password pages */
.sd-auth-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  margin-bottom: 1.25rem;
  border-radius: 1rem;
  background: rgba(80, 216, 120, 0.14);
  box-shadow: inset 0 0 0 1px rgba(80, 216, 120, 0.3);
  font-size: 1.375rem;
  color: var(--sd-green-text);
}

.sd-auth .sd-auth-eyebrow {
  margin: 0 0 0.5rem;
  font-size: 0.8125rem;
  line-height: 1.4;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--sd-green-text);
}

.sd-auth .sd-auth-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.75rem;
  margin: 0 0 0.75rem;
  font-size: clamp(2rem, 3vw, 2.625rem);
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -1px;
  color: var(--sd-text);
}

/* "or Register" next to the login title */
.sd-auth .sd-auth-title small {
  margin: 0;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--sd-muted);
}

.sd-auth .sd-auth-title small a {
  font-weight: 700;
  color: var(--sd-green-text);
  text-decoration: underline;
  text-decoration-color: rgba(21, 122, 67, 0.35);
  text-underline-offset: 3px;
}

.sd-auth .sd-auth-title small a:hover {
  text-decoration-color: currentColor;
}

.sd-auth .sd-auth-title .feather {
  font-size: 0.7em;
  color: var(--sd-green-text);
}

.sd-auth .sd-auth-text {
  margin: 0 0 1rem;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--sd-muted);
}

.sd-auth form {
  margin-top: 1.5rem;
}

/* Fields: tall, rounded, a green ring on focus */
.sd-auth .input-group {
  display: block;
}

.sd-auth .form-control {
  width: 100%;
  height: 3.375rem;
  padding: 0 1.125rem;
  border: 1.5px solid var(--sd-line);
  border-radius: 0.75rem !important;
  background: var(--sd-field);
  font-size: 1rem;
  color: var(--sd-text);
  box-shadow: none;
  transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}

.sd-auth .form-control::placeholder {
  color: #8C98AB;
}

.sd-auth .form-control:hover {
  border-color: #B9C3D0;
}

.sd-auth .form-control:focus {
  border-color: var(--sd-green);
  background: #FFFFFF;
  box-shadow: 0 0 0 4px rgba(80, 216, 120, 0.2);
  outline: 0;
}

/* Errors as a soft red note under the field */
.sd-auth .form-warnings {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin: 0.5rem 0 0;
  padding: 0.625rem 0.875rem;
  border-radius: 0.75rem;
  background: #FEF3F2;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--sd-danger);
}

.sd-auth .form-warnings ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* "Forgot password? Click here." under the password */
.sd-auth .sd-auth-forgot {
  display: block;
  margin-top: 0.625rem;
  font-size: 0.875rem;
  text-align: right;
  color: var(--sd-muted);
}

.sd-auth .sd-auth-forgot a,
.sd-auth .sd-auth-forgot .hover-effect-cta {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--sd-green-text) !important;
}

.sd-auth .sd-auth-forgot a:hover .hover-effect-cta {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* "Save Details" checkbox */
.sd-auth .checkbox label {
  font-size: 0.9375rem;
  color: var(--sd-body);
}

/* Buttons: the same look as "Try For Free" (buttons_redesign.css tokens), across the form */
.sd-auth .btn.button-create,
.sd-auth .btn.button-outline-create {
  display: block;
  width: 100%;
  height: auto;
  font-size: var(--sd-btn-font-size, 1.25rem);
  font-weight: var(--sd-btn-font-weight, 700);
  line-height: var(--sd-btn-line-height, 1.5);
  padding: var(--sd-btn-padding-y, 0.5rem) var(--sd-btn-padding-x, 1.5rem);
  border: var(--sd-btn-border-width, 1.5px) solid var(--sd-btn-primary-bg, #50D878);
  border-radius: var(--sd-btn-radius, 0.5rem);
  background-color: var(--sd-btn-primary-bg, #50D878);
  letter-spacing: 0;
  text-transform: none;
  color: var(--sd-btn-primary-color, #1F2A3D);
  box-shadow: none;
  transition: var(--sd-btn-transition, color .2s ease, background-color .2s ease, border-color .2s ease);
}

.sd-auth .btn.button-create:is(:hover, :focus-visible, :active):not(:disabled) {
  color: var(--sd-btn-primary-color, #1F2A3D);
  background-color: var(--sd-btn-primary-bg-hover, #6BE08E);
  border-color: var(--sd-btn-primary-bg-hover, #6BE08E);
}

/* Disabled until the security check passes (login) */
.sd-auth .btn.button-create:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* "Login" after a reset: the secondary look (outlined, filled on hover) */
.sd-auth .btn.button-outline-create {
  color: var(--sd-btn-secondary-color, #29364D);
  background-color: transparent;
  border-color: var(--sd-btn-secondary-color, #29364D);
}

.sd-auth .btn.button-outline-create:is(:hover, :focus-visible, :active) {
  color: var(--sd-btn-secondary-color-hover, #FFFFFF);
  background-color: var(--sd-btn-secondary-color, #29364D);
  border-color: var(--sd-btn-secondary-color, #29364D);
}

.sd-auth .btn:focus-visible {
  outline: 0;
  box-shadow: var(--sd-btn-focus-ring, 0 0 0 0.25rem rgba(80, 216, 120, 0.35));
}

/* A link wrapping a button takes the full width too */
.sd-auth .sd-auth-card a:has(> .btn) {
  display: block;
}

/* Copyright and legal links */
.sd-auth-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.375rem;
  width: 100%;
  max-width: 26rem;
  text-align: center;
}

.sd-auth .sd-auth-footer p {
  margin: 0;
  font-size: 0.8125rem;
  color: #8C98AB;
}

.sd-auth .sd-auth-footer .footer-wrapper-bottom-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sd-auth .sd-auth-footer a {
  font-size: 0.8125rem;
  color: var(--sd-muted);
  text-decoration: none;
}

.sd-auth .sd-auth-footer a:hover {
  color: var(--sd-text);
  text-decoration: underline;
}

.sd-auth .sd-auth-footer .dot-divider {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #B9C3D0;
}

/* ------------------------------------------------------------------ Layout: navy panel beside the form */

.sd-auth {
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
}

.sd-auth-stage {
  grid-column: 1;
  grid-row: 1;
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  padding: 3rem clamp(2rem, 5vw, 5rem);
}

/* Green light along the edge, as on the other dark panels of the site */
.sd-auth-stage::after {
  content: "";
  position: absolute;
  top: 10%;
  bottom: 10%;
  right: 0;
  width: 1px;
  background: linear-gradient(180deg, transparent 0%, rgba(80, 216, 120, 0.55) 50%, transparent 100%);
}

.sd-auth-panel {
  grid-column: 2;
  grid-row: 1;
  padding: 3rem clamp(1.5rem, 4vw, 4rem) 1.75rem;
}

.sd-auth-card {
  margin-block: auto;
  animation: sd-auth-in .7s cubic-bezier(.2, .8, .2, 1) both;
}

@keyframes sd-auth-in {
  from { opacity: 0; translate: 0 1rem; }
  to { opacity: 1; translate: 0 0; }
}

.sd-auth-footer {
  padding-top: 1.25rem;
  border-top: 1px solid var(--sd-ground);
}

/* ------------------------------------------------------------------ Panel: testimonials and club crests */

.sd-auth-proof {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  width: 100%;
  max-width: 34rem;
}

/* Heading with the short green line under it */
.sd-auth-proof-title {
  position: relative;
  margin: 0 0 0.5rem;
  padding-bottom: 1.125rem;
  font-size: clamp(1.75rem, 2.6vw, 2.5rem);
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.03em;
  text-wrap: balance;
  color: #FFFFFF;
  animation: sd-auth-in .8s cubic-bezier(.2, .8, .2, 1) .1s both;
}

.sd-auth-proof-title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 3.5rem;
  height: 0.25rem;
  border-radius: 999px;
  background: var(--sd-green);
}

/* The quotes stacked in one place; one at a time comes in, stays 6 s and leaves (18 s loop) */
.sd-auth-proof-quotes {
  display: grid;
}

.sd-auth-proof-quote {
  grid-area: 1 / 1;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.5rem;
  margin: 0;
  padding: 2rem 1.75rem 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 1.25rem;
  background: rgba(17, 24, 39, 0.45);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.8);
  opacity: 0;
  animation: sd-auth-proof-quote 18s ease-in-out infinite;
  animation-delay: calc(.4s + var(--i) * 6s);
}

@keyframes sd-auth-proof-quote {
  0% { opacity: 0; transform: translateY(1rem); visibility: visible; }
  4%, 30% { opacity: 1; transform: none; visibility: visible; }
  34% { opacity: 0; transform: translateY(-0.75rem); visibility: hidden; }
  100% { opacity: 0; visibility: hidden; }
}

/* Large green opening quote mark */
.sd-auth-proof-quote::before {
  content: "\201C";
  position: absolute;
  top: -0.25rem;
  left: 1.25rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 5rem;
  line-height: 1;
  font-weight: 700;
  color: var(--sd-green);
  opacity: 0.9;
}

.sd-auth-proof-quote blockquote {
  margin: 0;
  padding-top: 0.75rem;
  font-size: 1.125rem;
  line-height: 1.55;
  font-weight: 500;
  color: #FFFFFF;
}

/* Author: round photo with the club crest, name and role */
.sd-auth-proof-quote figcaption {
  display: flex;
  align-items: center;
  gap: 0.875rem;
}

.sd-auth-proof-avatar {
  position: relative;
  flex: none;
  width: 3rem;
  height: 3rem;
}

.sd-auth-proof-avatar > img:first-child {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 2px var(--sd-green);
}

.sd-auth-proof-badge {
  position: absolute;
  right: -0.375rem;
  bottom: -0.25rem;
  width: 1.375rem;
  height: 1.375rem;
  padding: 0.125rem;
  border-radius: 50%;
  background: #FFFFFF;
  object-fit: contain;
}

.sd-auth-proof-quote figcaption b {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  color: #FFFFFF;
}

.sd-auth-proof-quote figcaption small {
  display: block;
  font-size: 0.8125rem;
  color: #C9D2E0;
}

/* One line per quote, filling while it is shown */
.sd-auth-proof-dots {
  display: flex;
  gap: 0.375rem;
}

.sd-auth-proof-dots i {
  position: relative;
  overflow: hidden;
  width: 2rem;
  height: 0.25rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
}

.sd-auth-proof-dots i::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--sd-green);
  transform: scaleX(0);
  transform-origin: 0 50%;
  animation: sd-auth-proof-dot 18s linear infinite;
  animation-delay: calc(.4s + var(--i) * 6s);
}

@keyframes sd-auth-proof-dot {
  0% { transform: scaleX(0); opacity: 1; }
  33% { transform: scaleX(1); opacity: 1; }
  34%, 100% { transform: scaleX(0); opacity: 0; }
}

/* Crests of the clubs, under the "Trusted by..." heading of the site */
.sd-auth-proof-clubs {
  margin-top: 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sd-auth-proof-clubs-title {
  margin: 0 0 1rem;
  font-size: 0.75rem;
  line-height: 1.4;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8C98AB;
}

/* Two rows of crests sliding in opposite directions, fading out at the edges; the rows are doubled by
   auth_stage.js so the loop has no seam, and they stop while pointed at */
.sd-auth-proof-marquee {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000000 8%, #000000 92%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0%, #000000 8%, #000000 92%, transparent 100%);
}

.sd-auth-proof-row {
  display: flex;
  gap: 0.625rem;
  width: max-content;
  padding: 0.25rem 0;
  animation: sd-auth-proof-slide 70s linear infinite;
}

.sd-auth-proof-row--back {
  animation-direction: reverse;
}

.sd-auth-proof-marquee:hover .sd-auth-proof-row {
  animation-play-state: paused;
}

.sd-auth-proof-row img {
  flex: none;
  width: 3rem;
  height: 3rem;
  padding: 0.375rem;
  border-radius: 50%;
  background: #FFFFFF;
  object-fit: contain;
  box-shadow: 0 8px 16px -8px rgba(0, 0, 0, 0.7);
  transition: transform .2s ease;
}

.sd-auth-proof-row img:hover {
  transform: scale(1.12);
}

@keyframes sd-auth-proof-slide {
  to { transform: translateX(-50%); }
}

/* ------------------------------------------------------------------ Tablets and phones */

/* The form first, then only the clubs band below it; the heading and the testimonials are hidden so the
   form fits without scrolling */
@media (max-width: 991.98px) {
  .sd-auth {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 1fr auto;
  }

  .sd-auth-panel {
    grid-column: 1;
    grid-row: 1;
    padding: 2.25rem 1.5rem 1.5rem;
  }

  .sd-auth-card {
    margin-block: 0 auto;
  }

  .sd-auth-stage {
    grid-column: 1;
    grid-row: 2;
    position: relative;
    height: auto;
    padding: 1.25rem 1.5rem;
  }

  /* The green light along the top edge of the band */
  .sd-auth-stage::after {
    top: 0;
    bottom: auto;
    left: 10%;
    right: 10%;
    width: auto;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(80, 216, 120, 0.55) 50%, transparent 100%);
  }

  .sd-auth-proof {
    gap: 1.25rem;
    max-width: 40rem;
  }

  .sd-auth-proof-title,
  .sd-auth-proof-quotes,
  .sd-auth-proof-dots {
    display: none;
  }

  .sd-auth-proof-clubs {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
  }
}

@media (max-width: 575.98px) {
  .sd-auth-panel {
    padding: 1.75rem 1rem 1.5rem;
  }

  .sd-auth-stage {
    padding: 1rem;
  }

  .sd-auth-proof-row img {
    width: 2.25rem;
    height: 2.25rem;
    padding: 0.25rem;
  }

  .sd-auth .sd-auth-title {
    font-size: 2rem;
  }
}

/* ------------------------------------------------------------------ Without motion */

@media (prefers-reduced-motion: reduce) {
  .sd-auth-card,
  .sd-auth-proof-title,
  .sd-auth-proof-dots i::after,
  .sd-auth-proof-row,
  .sd-auth-proof-quote {
    animation: none;
  }

  /* The crests wrap instead of sliding */
  .sd-auth-proof-row {
    flex-wrap: wrap;
    width: auto;
  }

  /* Only the first quote, shown still */
  .sd-auth-proof-quote:first-child {
    opacity: 1;
  }

  .sd-auth-proof-dots {
    display: none;
  }

  .sd-auth-logo,
  .sd-auth .btn,
  .sd-auth .sd-auth-back,
  .sd-auth .sd-auth-back .feather,
  .sd-auth .form-control {
    transition: none;
  }
}
