:root { --web-announcement-height: 0px; }

html.has-web-announcement-banner {
  --web-announcement-height: 52px;
}

html.has-web-announcement-banner body {
  padding-top: var(--web-announcement-height);
}

html.has-web-announcement-popup,
html.has-web-announcement-popup body {
  overflow: hidden;
}

[data-web-header] {
  position: sticky;
  top: var(--web-announcement-height);
  z-index: 950;
  transition: transform 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
  will-change: transform;
}

[data-web-header].has-scrolled {
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 10px 30px rgba(26, 45, 78, .08);
  backdrop-filter: blur(16px);
}

[data-web-header].is-scroll-hidden {
  transform: translateY(calc(-100% - var(--web-announcement-height)));
}

html.has-web-announcement-banner .auth-page {
  min-height: calc(100dvh - var(--web-announcement-height));
}

html.has-web-announcement-banner .auth-layout {
  min-height: calc(100dvh - 82px - var(--web-announcement-height));
}

@media (min-width: 821px) and (min-height: 700px) {
  html.has-web-announcement-banner .auth-page {
    height: calc(100dvh - var(--web-announcement-height));
    min-height: 0;
  }

  html.has-web-announcement-banner .auth-layout {
    height: calc(100dvh - 82px - var(--web-announcement-height));
    min-height: 0;
  }

  html.has-web-announcement-banner .auth-card {
    max-height: calc(100dvh - 130px - var(--web-announcement-height));
  }
}

.web-announcement-banner {
  position: fixed;
  inset: 0 0 auto;
  z-index: 1000;
  height: var(--web-announcement-height);
  padding: 4px max(18px, env(safe-area-inset-right)) 4px max(18px, env(safe-area-inset-left));
  overflow: hidden;
  color: #17345a;
  background: #eef5ff;
  border-bottom: 1px solid #dbe9fb;
  font-family: 'Poppins', system-ui, sans-serif;
}

.web-announcement-banner[data-severity='success'] {
  color: #134f36;
  background: #effaf4;
  border-color: #ccebd9;
}

.web-announcement-banner[data-severity='warning'] {
  color: #624615;
  background: #fff8e8;
  border-color: #f0dfb7;
}

.web-announcement-banner[data-severity='critical'] {
  color: #762f35;
  background: #fff1f2;
  border-color: #f2cdd1;
}

.web-announcement-banner__inner {
  width: min(1180px, 100%);
  height: 100%;
  min-height: 44px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.web-announcement-banner__copy {
  min-width: 0;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  text-align: center;
  font-size: 12px;
  line-height: 1.5;
}

.web-announcement-banner__copy strong {
  flex: none;
  font-size: 12px;
}

.web-announcement-banner__copy span {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  overflow-wrap: anywhere;
  overflow: hidden;
}

.web-announcement-banner__icon {
  flex: 0 0 auto;
}

.web-announcement-action,
.web-announcement-text-button,
.web-announcement-icon-button,
.web-scroll-top {
  min-width: 44px;
  min-height: 44px;
  border: 0;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font: 600 12px/1 'Poppins', system-ui, sans-serif;
  cursor: pointer;
}

.web-announcement-action {
  padding: 0 14px;
  color: #fff;
  background: #267ff2;
  text-decoration: none;
  white-space: nowrap;
}

.web-announcement-text-button {
  padding: 0 10px;
  color: inherit;
  background: transparent;
}

.web-announcement-icon-button {
  flex: 0 0 44px;
  padding: 0;
  color: inherit;
  background: rgba(255, 255, 255, .56);
}

.web-announcement-action:focus-visible,
.web-announcement-text-button:focus-visible,
.web-announcement-icon-button:focus-visible,
.web-scroll-top:focus-visible {
  outline: 3px solid rgba(38, 127, 242, .42);
  outline-offset: 2px;
}

.web-announcement-overlay {
  position: fixed;
  inset: 0;
  z-index: 1100;
  padding: max(18px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
  display: grid;
  place-items: center;
  background: rgba(12, 22, 38, .52);
  backdrop-filter: blur(5px);
}

.web-announcement-dialog {
  width: min(500px, 100%);
  max-height: min(760px, calc(100dvh - 36px));
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, .66);
  border-radius: 24px;
  color: #17171a;
  background: #fff;
  box-shadow: 0 28px 90px rgba(12, 22, 38, .28);
  font-family: 'Poppins', system-ui, sans-serif;
}

.web-announcement-dialog__image {
  width: 100%;
  max-height: 260px;
  display: block;
  object-fit: cover;
}

.web-announcement-dialog__body {
  padding: 28px;
}

.web-announcement-dialog__heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.web-announcement-dialog__title {
  margin: 0;
  font-size: clamp(22px, 5vw, 30px);
  line-height: 1.15;
  letter-spacing: -.035em;
}

.web-announcement-dialog__message {
  margin: 15px 0 0;
  color: #5b6270;
  font-size: 14px;
  line-height: 1.75;
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.web-announcement-dialog__severity {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  color: #267ff2;
  background: #eef5ff;
}

.web-announcement-dialog[data-severity='success'] .web-announcement-dialog__severity {
  color: #168657;
  background: #effaf4;
}

.web-announcement-dialog[data-severity='warning'] .web-announcement-dialog__severity {
  color: #936411;
  background: #fff8e8;
}

.web-announcement-dialog[data-severity='critical'] .web-announcement-dialog__severity {
  color: #b23b47;
  background: #fff1f2;
}

.web-announcement-dialog__actions {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.web-scroll-top {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 900;
  width: 44px;
  height: 44px;
  padding: 0;
  color: #fff;
  background: #267ff2;
  box-shadow: 0 12px 30px rgba(38, 127, 242, .3);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.web-scroll-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

@media (max-width: 720px) {
  html.has-web-announcement-banner {
    --web-announcement-height: 76px;
  }

  html.has-web-announcement-banner .auth-layout {
    min-height: auto;
  }

  .web-announcement-banner__inner {
    align-items: flex-start;
    justify-content: flex-start;
    gap: 8px;
  }

  .web-announcement-banner__copy {
    flex: 1;
    display: grid;
    justify-content: stretch;
    gap: 2px;
    text-align: left;
  }

  .web-announcement-banner__copy strong,
  .web-announcement-banner__copy span {
    font-size: 11px;
  }

  .web-announcement-banner__copy span {
    -webkit-line-clamp: 2;
  }

  .web-announcement-banner .web-announcement-action,
  .web-announcement-banner .web-announcement-text-button {
    width: 44px;
    padding: 0;
    font-size: 0;
  }

  .web-announcement-dialog {
    border-radius: 20px;
  }

  .web-announcement-dialog__body {
    padding: 22px;
  }

  .web-announcement-dialog__actions {
    display: grid;
  }

  .web-announcement-dialog__actions .web-announcement-action,
  .web-announcement-dialog__actions .web-announcement-text-button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  [data-web-header],
  .web-scroll-top {
    transition: none;
    scroll-behavior: auto;
  }
}
