/*
 * SPDX-FileCopyrightText: 2026 André Menhard
 * SPDX-License-Identifier: LicenseRef-OmniShare-Proprietary
 */

/*
 * Identity proof marks have one owner. The selected treatment adapts to the
 * invitation, layered completion, and identity-pass compositions without
 * turning proof into a second call to action.
 */

.auth-invite-context {
  grid-template-columns: clamp(140px, 25%, 152px) minmax(0, 1fr);
}

.auth-identity-pass {
  position: relative;
  isolation: isolate;
}

.auth-identity-pass__body {
  grid-template-rows: minmax(0, 1fr) auto auto;
}

.auth-proof-mark {
  --auth-proof-fill:
    color-mix(in srgb, var(--auth-paper-strong) 76%, transparent);
  --auth-proof-ink:
    color-mix(in srgb, var(--auth-ink) 78%, var(--auth-accent-deep));
  --auth-proof-line:
    color-mix(in srgb, var(--auth-accent) 24%, var(--auth-line));
  --auth-proof-shadow: 0 9px 24px rgba(28, 19, 38, 0.1);

  position: absolute;
  z-index: 5;
  display: inline-flex;
  width: fit-content;
  max-width: calc(100% - 24px);
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0;
  padding: 0;
  color: var(--auth-proof-ink);
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  font-size: var(--auth-type-caption);
  font-weight: var(--auth-weight-strong);
  letter-spacing: 0;
  line-height: var(--auth-leading-caption);
  text-align: center;
  text-transform: none;
  white-space: normal;
  pointer-events: none;
  animation: auth-proof-mark-enter 280ms 140ms var(--auth-ease) both;
}

.auth-proof-mark .auth-icon {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  stroke-width: 2.15;
}

.auth-proof-mark .auth-icon path {
  stroke-dasharray: none;
  stroke-dashoffset: 0;
  animation: none;
}

.auth-completion__proof .auth-proof-mark {
  --auth-proof-fill: rgba(246, 242, 250, 0.13);
  --auth-proof-ink: rgba(255, 255, 255, 0.9);
  --auth-proof-line: rgba(255, 255, 255, 0.23);
  --auth-proof-shadow: 0 12px 28px rgba(1, 5, 16, 0.19);
}

/* Attached top-right treatments share the card's top and right borders. */

html[data-auth-proof-treatment="corner-glass"] .auth-proof-mark,
html[data-auth-proof-treatment="corner-ink"] .auth-proof-mark {
  top: 0;
  right: 0;
  padding: 9px 12px 9px 11px;
  border-width: 0 0 1px 1px;
  border-style: solid;
  border-color: var(--auth-proof-line);
  border-radius: 0 calc(var(--auth-radius) - 1px) 0 13px;
}

html[data-auth-proof-treatment="corner-glass"] .auth-proof-mark {
  background: var(--auth-proof-fill);
  box-shadow:
    inset 1px -1px rgba(255, 255, 255, 0.16),
    var(--auth-proof-shadow);
  -webkit-backdrop-filter: blur(14px) saturate(1.08);
  backdrop-filter: blur(14px) saturate(1.08);
}

html[data-auth-proof-treatment="corner-ink"] .auth-proof-mark {
  color: #fff;
  background:
    linear-gradient(
      135deg,
      color-mix(in srgb, var(--auth-ink) 94%, var(--auth-accent)),
      color-mix(in srgb, var(--auth-ink) 78%, var(--auth-accent-deep))
    );
  border-color: color-mix(in srgb, var(--auth-accent) 30%, var(--auth-ink));
  box-shadow: 0 9px 22px rgba(18, 12, 24, 0.16);
}

/* Inset glass keeps all four edges visible and floats inside the card. */

html[data-auth-proof-treatment="inset-glass"] .auth-proof-mark {
  top: 13px;
  right: 13px;
  padding: 7px 10px;
  background: var(--auth-proof-fill);
  border: 1px solid var(--auth-proof-line);
  border-radius: 999px;
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.22),
    var(--auth-proof-shadow);
  -webkit-backdrop-filter: blur(14px) saturate(1.08);
  backdrop-filter: blur(14px) saturate(1.08);
}

/* Artwork glass moves proof onto the identity image instead of the copy. */

html[data-auth-proof-treatment="media-glass"] .auth-proof-mark {
  top: 12px;
  left: 12px;
  padding: 7px 10px;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(10, 12, 24, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.13),
    0 9px 22px rgba(1, 5, 16, 0.18);
  -webkit-backdrop-filter: blur(12px) saturate(1.08);
  backdrop-filter: blur(12px) saturate(1.08);
}

html[data-auth-proof-treatment="media-glass"]
  .auth-completion__proof
  .auth-proof-mark {
  right: 12px;
  left: auto;
}

html[data-auth-proof-treatment="media-glass"]
  .auth-identity-pass
  .auth-proof-mark {
  right: calc(64.705% + 12px);
  left: auto;
}

/* Edge flag sits on the right boundary without claiming the top corner. */

html[data-auth-proof-treatment="edge-flag"] .auth-proof-mark {
  top: 50%;
  right: 0;
  padding: 8px 11px 8px 10px;
  background: var(--auth-proof-fill);
  border-width: 1px 0 1px 1px;
  border-style: solid;
  border-color: var(--auth-proof-line);
  border-radius: 12px 0 0 12px;
  box-shadow: var(--auth-proof-shadow);
  transform: translateY(-50%);
  -webkit-backdrop-filter: blur(12px) saturate(1.06);
  backdrop-filter: blur(12px) saturate(1.06);
}

html[data-auth-proof-treatment="edge-flag"]
  .auth-invite-context__identity {
  padding-right: 108px;
}

html[data-auth-proof-treatment="edge-flag"] .auth-identity-pass__body {
  padding-right: 112px;
}

/* Inline proof behaves like a quiet signature instead of a badge. */

html[data-auth-proof-treatment="inline-signature"] .auth-proof-mark {
  top: 17px;
  right: 20px;
  gap: 5px;
  color:
    color-mix(in srgb, var(--auth-accent-deep) 76%, var(--auth-ink-faint));
  font-size: var(--auth-type-micro);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

html[data-auth-proof-treatment="inline-signature"]
  .auth-completion__proof
  .auth-proof-mark {
  color: rgba(255, 255, 255, 0.72);
}

/* Full-width rail gives proof a structural lower edge. */

html[data-auth-proof-treatment="bottom-rail"] .auth-proof-mark {
  right: 0;
  bottom: 0;
  left: 0;
  width: auto;
  max-width: none;
  min-height: 36px;
  padding: 8px 16px;
  background:
    linear-gradient(
      90deg,
      color-mix(in srgb, var(--auth-proof-fill) 82%, transparent),
      var(--auth-proof-fill)
    );
  border-top: 1px solid var(--auth-proof-line);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.13);
  -webkit-backdrop-filter: blur(12px) saturate(1.06);
  backdrop-filter: blur(12px) saturate(1.06);
}

html[data-auth-proof-treatment="bottom-rail"] .auth-invite-context {
  min-height: 168px;
}

html[data-auth-proof-treatment="bottom-rail"]
  .auth-invite-context__media {
  min-height: 166px;
}

html[data-auth-proof-treatment="bottom-rail"]
  .auth-invite-context__identity {
  padding-bottom: 48px;
}

html[data-auth-proof-treatment="bottom-rail"]
  .auth-completion__proof
  .auth-proof-mark {
  bottom: 40px;
}

html[data-auth-proof-treatment="bottom-rail"] .auth-completion__proof {
  padding-bottom: 104px;
}

html[data-auth-proof-treatment="bottom-rail"] .auth-identity-pass__body {
  padding-bottom: 58px;
}

html[data-auth-proof-treatment="bottom-rail"]
  .auth-identity-pass
  .auth-proof-mark {
  left: 35.295%;
}

/* Compact seal keeps the semantic check while hiding only its visual label. */

html[data-auth-proof-treatment="check-seal"] .auth-proof-mark {
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  padding: 0;
  background: var(--auth-proof-fill);
  border: 1px solid var(--auth-proof-line);
  border-radius: 50%;
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.2),
    var(--auth-proof-shadow);
  -webkit-backdrop-filter: blur(12px) saturate(1.06);
  backdrop-filter: blur(12px) saturate(1.06);
}

html[data-auth-proof-treatment="check-seal"]
  .auth-proof-mark__label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html[data-auth-proof-treatment="removed"] .auth-proof-mark {
  display: none;
}

@keyframes auth-proof-mark-enter {
  from {
    opacity: 0;
    transform: translateY(-3px);
  }
}

html[data-auth-proof-treatment="edge-flag"] .auth-proof-mark {
  animation-name: auth-proof-mark-edge-enter;
}

@keyframes auth-proof-mark-edge-enter {
  from {
    opacity: 0;
    transform: translate(4px, -50%);
  }
}

@media (max-width: 720px) {
  /*
   * At the 16px root default this reserve is exactly zero, preserving the
   * authored composition. It grows with user text size so an absolute proof
   * mark can never occupy the invitation copy's first line.
   */
  .auth-invite-context {
    --auth-proof-text-reserve: max(0px, calc(3.625rem - 58px));
  }

  .auth-invite-context {
    grid-template-columns: 120px minmax(0, 1fr);
    grid-template-rows: auto;
  }

  .auth-invite-context__media {
    grid-row: 1;
  }

  .auth-invite-context__identity {
    grid-row: 1;
    padding: 20px 16px;
  }

  html[data-auth-proof-treatment="corner-glass"]
    .auth-invite-context__identity,
  html[data-auth-proof-treatment="corner-ink"]
    .auth-invite-context__identity,
  html[data-auth-proof-treatment="inset-glass"]
    .auth-invite-context__identity {
    padding-top: calc(42px + var(--auth-proof-text-reserve));
  }

  html[data-auth-proof-treatment="edge-flag"]
    .auth-invite-context__identity {
    padding-top: calc(44px + var(--auth-proof-text-reserve));
    padding-right: 16px;
  }

  html[data-auth-proof-treatment="edge-flag"]
    .auth-invite-context
    .auth-proof-mark {
    top: 12px;
    transform: none;
  }

  html[data-auth-proof-treatment="inline-signature"]
    .auth-invite-context__identity {
    padding-top: calc(20px + var(--auth-proof-text-reserve));
  }

  html[data-auth-proof-treatment="bottom-rail"]
    .auth-invite-context__identity {
    padding-bottom:
      calc(48px + max(0px, calc(2.25rem - 36px)));
  }
}

@media (min-width: 281px) and (max-width: 720px) {
  html[data-auth-proof-treatment="media-glass"]
    .auth-invite-context__identity {
    padding-top: calc(20px + var(--auth-proof-text-reserve));
  }
}

@media (max-width: 520px) {
  .auth-completion__proof {
    --auth-proof-scale-shift: max(0px, calc(1rem - 16px));

    padding-bottom: 48px;
  }

  html[data-auth-proof-treatment="inset-glass"]
    .auth-completion__proof
    .auth-proof-mark {
    top: max(0px, calc(13px - var(--auth-proof-scale-shift)));
  }

  html[data-auth-proof-treatment="media-glass"]
    .auth-completion__proof
    .auth-proof-mark {
    top: max(0px, calc(12px - var(--auth-proof-scale-shift)));
  }

  html[data-auth-proof-treatment="corner-glass"]
    .auth-completion__proof-copy,
  html[data-auth-proof-treatment="corner-ink"]
    .auth-completion__proof-copy,
  html[data-auth-proof-treatment="inset-glass"]
    .auth-completion__proof-copy,
  html[data-auth-proof-treatment="media-glass"]
    .auth-completion__proof-copy,
  html[data-auth-proof-treatment="edge-flag"]
    .auth-completion__proof-copy,
  html[data-auth-proof-treatment="inline-signature"]
    .auth-completion__proof-copy {
    top: min(4px, var(--auth-proof-scale-shift));
  }

  .auth-identity-pass__body {
    grid-template-rows: auto auto auto;
  }

  /*
   * The reserve is zero at the product's 16px root default. At larger user
   * text sizes it lets the art grow before the edition and monogram render,
   * keeping those semantic labels clear of the proof treatment.
   */
  html[data-auth-proof-treatment="corner-glass"]
    .auth-identity-pass__edition,
  html[data-auth-proof-treatment="corner-ink"]
    .auth-identity-pass__edition,
  html[data-auth-proof-treatment="inset-glass"]
    .auth-identity-pass__edition,
  html[data-auth-proof-treatment="media-glass"]
    .auth-identity-pass__edition,
  html[data-auth-proof-treatment="inline-signature"]
    .auth-identity-pass__edition {
    margin-top: max(0px, calc(4.25rem - 68px));
  }

  html[data-auth-proof-treatment="edge-flag"]
    .auth-identity-pass__edition {
    margin-top: max(0px, calc(6.25rem - 100px));
  }

  html[data-auth-proof-treatment="edge-flag"]
    .auth-completion__proof
    .auth-proof-mark {
    top: max(0px, calc(12px - var(--auth-proof-scale-shift)));
    transform: none;
  }

  html[data-auth-proof-treatment="edge-flag"]
    .auth-identity-pass__body {
    padding-right: 18px;
  }

  html[data-auth-proof-treatment="edge-flag"]
    .auth-identity-pass
    .auth-proof-mark {
    top: 66px;
    color: rgba(255, 255, 255, 0.92);
    background: rgba(10, 12, 24, 0.3);
    border-color: rgba(255, 255, 255, 0.24);
  }

  html[data-auth-proof-treatment="media-glass"]
    .auth-identity-pass
    .auth-proof-mark {
    right: 12px;
  }

  html[data-auth-proof-treatment="inline-signature"]
    .auth-identity-pass
    .auth-proof-mark {
    color: rgba(255, 255, 255, 0.78);
  }

  html[data-auth-proof-treatment="bottom-rail"]
    .auth-identity-pass
    .auth-proof-mark {
    left: 0;
  }
}

@media (max-width: 360px) {
  html[data-auth-proof-treatment="inline-signature"]
    .auth-invite-context__identity {
    padding-top: calc(44px + var(--auth-proof-text-reserve));
  }
}

@media (min-width: 521px) {
  html[data-auth-proof-treatment="media-glass"]
    .auth-identity-pass__edition {
    margin-top: 34px;
  }
}

@media (max-width: 280px) {
  .auth-invite-context {
    --auth-proof-media-reserve: max(0px, calc(5rem - 80px));

    grid-template-columns: minmax(0, 1fr);
    grid-template-rows:
      calc(104px + var(--auth-proof-media-reserve))
      auto;
  }

  .auth-invite-context__media {
    grid-row: 1;
    grid-column: 1;
  }

  .auth-invite-context__identity {
    grid-row: 2;
    grid-column: 1;
    padding: 16px;
  }

  html[data-auth-proof-treatment="corner-glass"]
    .auth-invite-context__identity,
  html[data-auth-proof-treatment="corner-ink"]
    .auth-invite-context__identity,
  html[data-auth-proof-treatment="inset-glass"]
    .auth-invite-context__identity {
    padding-top: 16px;
  }

  html[data-auth-proof-treatment="corner-glass"]
    .auth-invite-context
    .auth-proof-mark,
  html[data-auth-proof-treatment="inset-glass"]
    .auth-invite-context
    .auth-proof-mark,
  html[data-auth-proof-treatment="check-seal"]
    .auth-invite-context
    .auth-proof-mark {
    --auth-proof-fill: rgba(10, 12, 24, 0.3);
    --auth-proof-ink: rgba(255, 255, 255, 0.92);
    --auth-proof-line: rgba(255, 255, 255, 0.24);
  }

  html[data-auth-proof-treatment="inline-signature"]
    .auth-invite-context
    .auth-proof-mark {
    top: calc(120px + var(--auth-proof-media-reserve));
    right: 16px;
  }

  html[data-auth-proof-treatment="inline-signature"]
    .auth-invite-context__identity {
    padding-top: 40px;
  }

  html[data-auth-proof-treatment="edge-flag"]
    .auth-invite-context
    .auth-proof-mark {
    top: max(12px, calc(52px - var(--auth-proof-media-reserve)));
    color: rgba(255, 255, 255, 0.92);
    background: rgba(10, 12, 24, 0.3);
    border-color: rgba(255, 255, 255, 0.24);
  }

  html[data-auth-proof-treatment="edge-flag"]
    .auth-invite-context__identity {
    padding-top: 16px;
    padding-right: 16px;
  }

  html[data-auth-proof-treatment="bottom-rail"] .auth-invite-context {
    min-height: 0;
    grid-template-rows:
      calc(104px + var(--auth-proof-media-reserve))
      auto;
  }

  html[data-auth-proof-treatment="bottom-rail"]
    .auth-invite-context__media {
    min-height: 104px;
  }

  html[data-auth-proof-treatment="bottom-rail"]
    .auth-invite-context__identity {
    padding-bottom: 52px;
  }
}

html[data-auth-motion="still"] .auth-proof-mark {
  animation: none;
}

@media (prefers-reduced-motion: reduce) {
  .auth-proof-mark {
    animation: none;
  }
}

@media (forced-colors: active) {
  html[data-auth-proof-treatment] .auth-proof-mark,
  html[data-auth-proof-treatment]
    .auth-completion__proof
    .auth-proof-mark {
    color: CanvasText;
    background: Canvas;
    border: 1px solid CanvasText;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  html[data-auth-proof-treatment="inline-signature"] .auth-proof-mark {
    background: transparent;
    border: 0;
  }

  html[data-auth-proof-treatment="removed"] .auth-proof-mark {
    display: none;
  }
}
