/*
 * Sign in, register, two-factor, password help and emailed links (D-167): the public look of the home page (blue-led, D-168).
 * The palette, display face, grain, glows, seal mark and tape come from shared/theme/public.css (root: pvPublic).
 * Wide screens: a story panel on the left, the form in a taped card on the right. Phones: header + card.
 */

.pvAuth,
.pvAuth *,
.pvAuth *::before,
.pvAuth *::after {
  box-sizing: border-box;
}

.pvAuth {
  /* Full-height controls on the card regardless of density (the shared rules follow --pv-field-h). */
  --pv-field-h: var(--pv-control-h-lg);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  min-height: 100vh;
  overflow-x: clip;
}

/* ---------------------------------------------------------------- the story: an ink panel */
.pvAuth__story {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: clamp(1.5rem, 4vw, 3.5rem);
  overflow: hidden;
  background: var(--pv-brand-ink);
  color: var(--pv-brand-paper);
}

/* The W that ends in a tick, very large and very quiet, in the corner. */
.pvAuth__watermark {
  position: absolute;
  right: -6%;
  bottom: -4%;
  width: 62%;
  aspect-ratio: 54 / 40;
  background: color-mix(in srgb, var(--pv-brand-tick) 14%, transparent);
  -webkit-mask: url("../../shared/img/public/w-tick.svg") center / contain no-repeat;
  mask: url("../../shared/img/public/w-tick.svg") center / contain no-repeat;
  pointer-events: none;
}

.pvAuth__brandRow {
  position: relative;
  display: flex;
}

.pvAuth__brand {
  display: inline-flex;
  align-items: center;
  gap: var(--pv-space-3);
  color: inherit;
  text-decoration: none;
  border-radius: var(--pv-radius);
}

.pvAuth__brand:focus-visible {
  outline: 2px solid var(--pv-brand-tick);
  outline-offset: 4px;
}

.pvAuth__home:focus-visible {
  outline: none;
}

html .pvAuth__home:focus-visible .sapMText {
  text-decoration: underline;
}

/* On ink the logo is the green tile with the ink tick, in either theme. */
html .pvPublic .pvPublic__mark.pvAuth__mark {
  background-image: url("../../shared/img/markwise-mark-dark.svg");
}

.pvAuth__brand:has(img) .pvPublic__mark {
  display: none;
}

html .pvAuth__logo img,
html img.pvAuth__logo {
  max-height: 44px;
  max-width: 220px;
  object-fit: contain;
}

html .pvAuth .pvAuth__orgName.sapMText {
  color: var(--pv-brand-paper);
}

.pvAuth__storyBody {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--pv-space-3);
  margin: auto 0;
  max-width: 30rem;
}

html .pvAuth .pvAuth__storyTitle.sapMTitle {
  font-family: var(--pv-public-display);
  font-size: clamp(2.25rem, 3.6vw, 3.25rem);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -.035em;
  color: var(--pv-brand-paper);
}

html .pvAuth .pvAuth__storyAccent.sapMText {
  font-family: var(--pv-public-display);
  font-size: clamp(1.375rem, 2vw, 1.75rem);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -.02em;
  color: var(--pv-brand-tick);
}

.pvAuth__points {
  display: flex;
  flex-direction: column;
  gap: var(--pv-space-4);
  margin: var(--pv-space-8) 0 0;
  padding: var(--pv-space-6) 0 0;
  border-top: 1px solid color-mix(in srgb, var(--pv-brand-paper) 18%, transparent);
  list-style: none;
}

.pvAuth__point {
  display: flex;
  align-items: flex-start;
  gap: var(--pv-space-3);
}

html .pvAuth .pvAuth__point .sapMText {
  font-size: var(--pv-fs-lg);
  line-height: 1.45;
  color: var(--pv-brand-paper);
}

.pvAuth__tick {
  flex: none;
  width: 1.125rem;
  height: 1.125rem;
  margin-top: 3px;
  background: url("../../shared/img/public/tick.svg") center / contain no-repeat;
}

html .pvAuth .pvAuth__storyFoot.sapMText {
  position: relative;
  font-size: var(--pv-fs-md);
  color: var(--pv-brand-on-ink-soft);
}

.pvAuth__side {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--pv-space-6);
  padding: var(--pv-space-10) var(--pv-space-6);
}

.pvAuth__home {
  display: inline-flex;
  align-items: center;
  gap: var(--pv-space-2);
  align-self: center;
  width: 100%;
  max-width: 440px;
  padding: var(--pv-space-1) 0;
  color: var(--pv-public-ink-soft);
  font-weight: var(--pv-fw-semibold);
  text-decoration: none;
  transition: color var(--pv-dur-fast);
}

.pvAuth__home:hover {
  color: var(--pv-public-primary);
}

html .pvAuth__home .sapUiIcon {
  color: inherit;
  font-size: .9rem;
}

.pvAuth__card {
  width: 100%;
  max-width: 440px;
  padding: var(--pv-space-10) var(--pv-space-8) var(--pv-space-8);
  border: 1px solid var(--pv-public-line);
  border-radius: 16px;
  background: var(--pv-public-card);
  box-shadow: var(--pv-public-shadow);
}

html .pvAuth__stack > .sapMFlexItem {
  margin-bottom: var(--pv-space-4);
}

html .pvAuth__stack > .sapMFlexItem:last-child {
  margin-bottom: 0;
}

html .pvAuth__title.sapMTitle {
  font-size: 2rem;
  line-height: 1.12;
}

html .pvAuth .sapMInputBaseContentWrapper,
html .pvAuth .sapMBtnInner {
  height: var(--pv-control-h-lg);
}

html .pvAuth .sapMInputBaseInner,
html .pvAuth .sapMBtnContent {
  line-height: calc(var(--pv-control-h-lg) - 2px);
}

html .pvAuth .sapMBtnIcon + .sapMBtnContent,
html .pvAuth .sapMBtnContent + .sapMBtnIcon {
  margin-inline: var(--pv-space-2) 0;
}

.pvAuth__switch {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-top: var(--pv-space-2);
  padding-top: var(--pv-space-4);
  border-top: 1px dashed var(--pv-public-line);
}

/* "Keep me signed in" and "Forgot password?" on one line. */
.pvAuth__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--pv-space-3);
  flex-wrap: wrap;
}

.pvAuth__footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--pv-space-1);
}

html .pvAuth__powered.sapMText {
  color: var(--pv-public-ink-soft);
  font-size: var(--pv-fs-sm);
}

/* ---------------------------------------------------------------- narrower screens: header + card */
@media (max-width: 960px) {
  .pvAuth {
    grid-template-columns: minmax(0, 1fr);
  }

  /* The story shrinks to a header: brand only. */
  .pvAuth__story {
    position: relative;
    height: auto;
    padding: var(--pv-space-4) var(--pv-space-5);
  }

  .pvAuth__storyBody,
  html .pvAuth .pvAuth__storyFoot.sapMText,
  .pvAuth__watermark {
    display: none;
  }

  .pvAuth__brandRow {
    justify-content: center;
  }

  .pvAuth__side {
    justify-content: flex-start;
    padding: var(--pv-space-6) var(--pv-space-4) var(--pv-space-8);
  }
}

@media (max-width: 480px) {
  .pvAuth__card {
    padding: var(--pv-space-8) var(--pv-space-5) var(--pv-space-6);
    border-radius: 14px;
  }

  html .pvAuth__title.sapMTitle {
    font-size: 1.75rem;
  }
}
