/*
 * GRW sign-in theme (LOGIN_THEME=grw). Loaded after sheq-auth.css, and only when the theme is on: see
 * frontend/templates/auth/themes/grw/. Every rule is scoped to .grw-auth, so the standard page cannot change.
 *
 * The picture uploaded in Super Admin › Login Page fills the curved panel on the left (.grw-auth__photo). A teal tint
 * over it, darkest behind the headline, is what keeps the white words readable on ANY photo: do not make it lighter
 * because today's photo suits it. Behind the panel's edge, two bands in the colours of GRW's logo ovals.
 * Colours: GRW teal #096068 (their Settings › Theme side menu), the logo's ovals #0E6B70 and #6FADB5, deep teal
 * #0B4F54 for words. Contrast on white: #0B4F54 9.3:1, #096068 7.3:1, #4E6E72 5.5:1, placeholders #5D7478 5.0:1.
 *
 * Desktop (980px and wider): the panel's edge is a quarter of a very large oval, as the mockup at 1440 x 900; the card
 * sits on the light side. Narrower: the panel becomes a band across the top with an oval lower edge, the card below it.
 */
.grw-auth {
  --grw-teal: #096068;
  --grw-teal-deep: #0B4F54;
  --grw-oval-dark: #0E6B70;
  --grw-oval-light: #6FADB5;
  --grw-teal-pale: #BFE3E7;
  --grw-muted: #4E6E72;
  --grw-placeholder: #5D7478;
  --grw-field-line: #BFD3D5;
  --grw-hairline: #D5E3E4;
  --grw-stripe-light: #DCE9EA;
  --grw-mist: #F2F6F6;
  --grw-white: #FFFFFF;

  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background: var(--grw-mist);
  color: var(--grw-teal-deep);
  font-family: "Inter", "Poppins", system-ui, sans-serif;
  font-weight: 400;
  font-size: 14px;
}

/* --- the curved panel and its two bands ------------------------------------------------------------------------ */
.grw-auth__oval {
  position: absolute;
  top: -22.2vh;
  width: 76.4vw;
  /* 144.4vh on a screen the page fits; on a short screen, where the card makes the page scroll, it still reaches
     22.2vh below the page's bottom, so the panel and the credit line never end on the light background. */
  height: calc(100% + 44.4vh);
  border-radius: 50%;
  display: block;
  pointer-events: none;
}
.grw-auth__oval--outer {
  left: -17.2vw;
  background: var(--grw-oval-dark);
}
.grw-auth__oval--inner {
  left: -19.7vw;
  background: var(--grw-oval-light);
}
.grw-auth__media {
  left: -22.2vw;
  overflow: hidden;
  background: var(--grw-teal-deep);
}
.grw-auth__photo,
.grw-auth__tint {
  position: absolute;
  inset: 0;
  display: block;
}
/* The photo covers only the part of the oval that is on screen, so its centre is the middle of what shows. */
.grw-auth__photo {
  left: 29%;
  background-color: var(--grw-teal);
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}
.grw-auth__tint {
  background: linear-gradient(90deg, rgba(5, 58, 63, 0.95) 0%, rgba(5, 58, 63, 0.92) 29%, rgba(9, 96, 104, 0.82) 50%, rgba(9, 96, 104, 0.5) 80%, rgba(9, 96, 104, 0.3) 100%);
}

/* --- the logo's stripes and underline ------------------------------------------------------------------------- */
.grw-auth__stripes {
  position: absolute;
  left: 0;
  top: max(68vh, calc(19.5vh + 330px));
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: none;
}
.grw-auth__stripes i {
  display: block;
  height: 8px;
  background: rgba(255, 255, 255, 0.92);
}
.grw-auth__stripes i:nth-child(1) { width: 10.4vw; }
.grw-auth__stripes i:nth-child(2) { width: 12.5vw; }
.grw-auth__stripes i:nth-child(3) { width: 14.6vw; }
.grw-auth__stripes i:nth-child(4) { width: 16.7vw; }
.grw-auth__stripes i:nth-child(5) { width: 18.75vw; }
.grw-auth__underline {
  position: absolute;
  left: 0;
  top: max(77.8vh, calc(19.5vh + 418px));
  width: 50.3vw;
  height: 4px;
  display: block;
  background: rgba(255, 255, 255, 0.92);
  pointer-events: none;
}
.grw-auth__stripes--light {
  top: auto;
  left: auto;
  right: 0;
  bottom: 96px;
  align-items: flex-end;
}
.grw-auth__stripes--light i {
  background: var(--grw-stripe-light);
}
.grw-auth__stripes--light i:nth-child(1) { width: 120px; }
.grw-auth__stripes--light i:nth-child(2) { width: 150px; }
.grw-auth__stripes--light i:nth-child(3) { width: 180px; }
.grw-auth__stripes--light i:nth-child(4) { width: 210px; }

/* --- GRW's logo and the headline ------------------------------------------------------------------------------- */
.grw-auth__brand {
  position: absolute;
  z-index: 1;
  left: 7.8vw;
  top: 19.5vh;
  width: min(520px, 38vw);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
}
/* GRW's own oval is teal; on the teal panel it would lose its edge, so it sits on a white plate. Solid white, because
   the logo file has a white background (grw-logo.jpg: the original grw.png less the black strip down its right edge). */
.grw-auth__plate {
  display: block;
  padding: 16px 22px;
  border-radius: 20px;
  background: var(--grw-white);
  box-shadow: 0 16px 40px rgba(3, 40, 44, 0.35);
}
.grw-auth__logo {
  display: block;
  width: min(230px, 18vw);
  height: auto;
}
.grw-auth .grw-auth__headline {
  margin: 12px 0 0;
  font-family: "Jost", "Inter", sans-serif;
  font-weight: 600;
  font-size: clamp(44px, 4.3vw, 62px);
  line-height: 1;
  letter-spacing: 0.01em;
  color: var(--grw-white);
}
.grw-auth .grw-auth__lede {
  margin: 0;
  max-width: 420px;
  font-size: 18px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.9);
}

/* --- the card ------------------------------------------------------------------------------------------------- */
.grw-auth__panel {
  position: relative;
  z-index: 1;
  box-sizing: border-box;
  min-height: 100vh;
  width: min(456px, calc(37.2vw - 32px));
  margin-left: 62.8vw;
  padding: 48px 0 80px;
  display: flex;
  align-items: center;
}
.grw-auth__card {
  width: 100%;
  box-sizing: border-box;
  padding: 40px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow: inset 0 1px 0 var(--grw-white), 0 34px 80px rgba(5, 58, 63, 0.22);
  display: flex;
  flex-direction: column;
}
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .grw-auth__card {
    background: rgba(255, 255, 255, 0.86);
    -webkit-backdrop-filter: blur(24px) saturate(150%);
            backdrop-filter: blur(24px) saturate(150%);
  }
}
.grw-auth__sheq {
  display: block;
  align-self: center;
  width: auto;
  max-width: 100%;
  height: 92px;
}
.grw-auth .grw-auth__title {
  margin: 28px 0 0;
  font-family: "Jost", "Inter", sans-serif;
  font-weight: 600;
  font-size: 34px;
  line-height: 1.1;
  color: var(--grw-teal-deep);
}
.grw-auth__rule {
  display: flex;
  gap: 4px;
  margin: 12px 0 14px;
}
.grw-auth__rule i {
  display: block;
  width: 36px;
  height: 4px;
  background: var(--grw-teal);
}
.grw-auth__rule i + i {
  width: 14px;
  background: var(--grw-oval-light);
}
.grw-auth .grw-auth__sub {
  margin: 0 0 26px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--grw-muted);
}

/* --- the shared form, restyled (its markup is the page's own and the same under every theme) ----------------- */
.grw-auth .login100-form {
  display: block;
}
.grw-auth .wrap-input100 {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 12px;
  border-bottom: 0;
}
.grw-auth .m-b-23 {
  margin-bottom: 20px;
}
.grw-auth .label-input100,
.grw-auth .label-input100--muted {
  padding-left: 0;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--grw-teal-deep);
}
.grw-auth .sheq-auth-hint {
  color: var(--grw-muted);
}
.grw-auth .auth-aside-link,
.grw-auth .auth-aside-link:hover,
.grw-auth .auth-aside-link:focus {
  font-size: 13px;
  font-weight: 600;
  color: var(--grw-teal);
}
.grw-auth .auth-aside-link:hover {
  color: var(--grw-teal-deep);
  text-decoration: underline;
}
.grw-auth .auth-aside-link:focus-visible {
  border-radius: 4px;
  box-shadow: 0 0 0 3px rgba(9, 96, 104, 0.35);
}
.grw-auth .input100 {
  flex: 1 0 100%;
  height: 52px;
  padding: 0 16px 0 48px;
  border: 1px solid var(--grw-field-line);
  border-radius: 12px;
  background: var(--grw-white);
  color: var(--grw-teal-deep);
  font-family: inherit;
  font-size: 16px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.grw-auth .input100::placeholder {
  color: var(--grw-placeholder);
}
.grw-auth .input100:focus {
  border-color: var(--grw-teal);
  box-shadow: 0 0 0 4px rgba(9, 96, 104, 0.18);
}
/* A browser that autofills a saved login paints its own pale-blue field: an inset shadow is the only lever it honours. */
.grw-auth .input100:-webkit-autofill,
.grw-auth .input100:-webkit-autofill:hover {
  -webkit-text-fill-color: var(--grw-teal-deep);
  caret-color: var(--grw-teal-deep);
  box-shadow: 0 0 0 1000px var(--grw-white) inset;
}
.grw-auth .input100:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--grw-teal-deep);
  caret-color: var(--grw-teal-deep);
  box-shadow: 0 0 0 1000px var(--grw-white) inset, 0 0 0 4px rgba(9, 96, 104, 0.18);
}
.grw-auth .focus-input100 {
  top: auto;
  bottom: 0;
  height: 52px;
}
.grw-auth .focus-input100::before {
  display: none;
}
.grw-auth .focus-input100::after,
.grw-auth .input100:focus + .focus-input100::after,
.grw-auth .has-val.input100 + .focus-input100::after {
  left: 16px;
  top: 0;
  bottom: 0;
  height: 100%;
  color: var(--grw-teal);
}
.grw-auth .m-t-50,
.grw-auth .m-t-30 {
  margin-top: 28px;
}
.grw-auth .login100-form-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 56px;
  border-radius: 12px;
  background: var(--grw-teal);
  color: var(--grw-white);
  font-family: "Jost", "Inter", sans-serif;
  font-weight: 600;
  font-size: 19px;
  letter-spacing: 0.04em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 14px 30px rgba(9, 96, 104, 0.35);
  transition: background-color 0.2s;
}
.grw-auth .login100-form-btn::after {
  content: "";
  width: 18px;
  height: 18px;
  background: var(--grw-teal-pale);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 5l7 7-7 7' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 5l7 7-7 7' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}
.grw-auth .login100-form-btn:hover {
  background: var(--grw-teal-deep);
}
.grw-auth .login100-form-btn:focus-visible {
  outline: 3px solid var(--grw-oval-light);
  outline-offset: 3px;
}

/* --- credit and version --------------------------------------------------------------------------------------- */
.grw-auth .grw-auth__credit {
  position: absolute;
  z-index: 1;
  left: 7.8vw;
  bottom: 30px;
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.85);
}
.grw-auth .grw-auth__version {
  position: absolute;
  z-index: 1;
  right: 28px;
  bottom: 24px;
  margin: 0;
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid var(--grw-hairline);
  background: var(--grw-white);
  font-size: 12px;
  line-height: 1.5;
  color: var(--grw-muted);
}

/* --- narrower screens: the panel becomes a band across the top ------------------------------------------------ */
@media (max-width: 979px) {
  .grw-auth__oval {
    left: -65vw;
    width: 230vw;
    height: 700px;
  }
  .grw-auth__oval--outer { top: -334px; }
  .grw-auth__oval--inner { top: -352px; }
  .grw-auth__media { top: -370px; }
  /* On screen: the middle 43% of the oval's width and its lowest 330px. */
  .grw-auth__photo {
    top: 52.9%;
    left: 28.3%;
    right: 28.3%;
  }
  .grw-auth__tint {
    background: linear-gradient(180deg, rgba(5, 58, 63, 0.9) 52.9%, rgba(9, 96, 104, 0.74) 80%, rgba(9, 96, 104, 0.55) 100%);
  }
  .grw-auth__underline,
  .grw-auth .grw-auth__lede,
  .grw-auth .grw-auth__credit {
    display: none;
  }
  .grw-auth__stripes {
    top: 176px;
    gap: 4px;
  }
  .grw-auth__stripes i {
    height: 5px;
  }
  .grw-auth__stripes i:nth-child(1) { width: 60px; }
  .grw-auth__stripes i:nth-child(2) { width: 75px; }
  .grw-auth__stripes i:nth-child(3) { width: 90px; }
  .grw-auth__stripes i:nth-child(4) { width: 105px; }
  .grw-auth__stripes i:nth-child(5) { width: 120px; }
  /* On a phone the card reaches the light side's corner, where these would show behind it. */
  .grw-auth__stripes--light {
    display: none;
  }
  .grw-auth__brand {
    left: 24px;
    top: 44px;
    width: auto;
    gap: 14px;
  }
  .grw-auth__plate {
    padding: 10px 14px;
    border-radius: 14px;
  }
  .grw-auth__logo {
    width: 132px;
  }
  .grw-auth .grw-auth__headline {
    margin: 0;
    font-size: 30px;
  }
  .grw-auth__panel {
    display: block;
    width: auto;
    max-width: 476px;
    margin: 0 auto;
    padding: 236px 16px 76px;
  }
  .grw-auth__card {
    padding: 24px 22px 22px;
    border-radius: 24px;
  }
  .grw-auth__sheq {
    height: 70px;
  }
  .grw-auth .grw-auth__title {
    margin-top: 20px;
    font-size: 30px;
  }
  .grw-auth .grw-auth__version {
    left: 0;
    right: 0;
    bottom: 22px;
    width: max-content;
    margin: 0 auto;
  }
}
