/* Application shell, header, navigation, authentication, and footer */

.sw-shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--background);
}

.sw-shell-assessment {
  position: relative;
  isolation: isolate;
  overflow: clip;
}

.sw-shell-assessment::before,
.sw-shell-assessment::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.sw-shell-assessment::before {
  background:
    linear-gradient(135deg, rgb(255 255 255 / 0.7), rgb(255 255 255 / 0.18)),
    repeating-linear-gradient(
      118deg,
      transparent 0,
      transparent 22px,
      var(--survey-art-line) 22px,
      var(--survey-art-line) 23px,
      transparent 23px,
      transparent 78px
    ),
    repeating-linear-gradient(
      28deg,
      transparent 0,
      transparent 34px,
      var(--survey-art-line-soft) 34px,
      var(--survey-art-line-soft) 35px,
      transparent 35px,
      transparent 108px
    );
  opacity: 0.95;
}

.sw-shell-assessment::after {
  inset: 22% auto auto 72%;
  width: 34rem;
  height: 34rem;
  border-radius: 9999px;
  background: radial-gradient(
    circle,
    var(--survey-art-glow) 0,
    rgb(255 255 255 / 0) 72%
  );
  opacity: 0.9;
  transform: translate(-50%, -50%);
}

.sw-shell-assessment > * {
  position: relative;
  z-index: 1;
}

.sw-shell-header-stack {
  position: sticky;
  top: 0;
  z-index: 30;
}

.sw-app-header {
  position: relative;
  z-index: 1;
  padding-top: 0;
  background: rgb(0 0 54 / 0.95);
  backdrop-filter: blur(8px);
  color: var(--header-foreground);
}

.sw-brand-row,
.sw-tab-strip,
.sw-shell-main,
.sw-footer-full,
.sw-footer-compact {
  width: 100%;
  max-width: 90rem;
  margin-inline: auto;
  padding-inline: var(--app-pad-inline);
}

.sw-brand-row {
  margin-top: 0;
  padding-top: 1rem;
  padding-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  backdrop-filter: none;
  box-shadow: none;
}

/* The maintenance dialog supplies its own visible surface and viewport scrolling. */
.sw-maintenance-dialog-host.mud-dialog {
  max-height: none;
  overflow: visible;
  background: transparent;
  box-shadow: none;
}

.sw-maintenance-dialog-host-content.mud-dialog-content {
  overflow: visible;
  padding: 0;
}

.sw-brand-left {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 0.625rem;
}

.sw-brand-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-shrink: 0;
}

.sw-auth-menu {
  position: relative;
  isolation: isolate;
}

.sw-auth-menu[open] {
  z-index: 35;
}

.sw-auth-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 2.6rem;
  padding: 0.35rem 0.5rem 0.35rem 0.35rem;
  border: 1px solid rgb(255 255 255 / 0.16);
  border-radius: 9999px;
  background: rgb(255 255 255 / 0.04);
  color: var(--header-foreground);
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    box-shadow 200ms ease,
    transform 200ms ease;
}

.sw-auth-trigger::-webkit-details-marker {
  display: none;
}

.sw-auth-trigger:hover,
.sw-auth-trigger:focus-visible,
.sw-auth-menu[open] > .sw-auth-trigger {
  background: rgb(255 255 255 / 0.1);
  border-color: rgb(255 255 255 / 0.28);
  box-shadow: 0 10px 24px rgb(0 0 54 / 0.18);
  transform: translateY(-1px);
}

.sw-auth-trigger-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}

.sw-auth-trigger-label {
  color: rgb(255 255 255 / 0.56);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sw-auth-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.95rem;
  height: 1.95rem;
  border-radius: 9999px;
  background: linear-gradient(
    135deg,
    rgb(20 181 154 / 0.95),
    rgb(22 142 211 / 0.92)
  );
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  box-shadow:
    inset 0 0 0 1px rgb(255 255 255 / 0.22),
    0 8px 18px rgb(0 0 54 / 0.16);
}

.sw-auth-chevron {
  color: rgb(255 255 255 / 0.62);
  font-size: 0.85rem;
  transition:
    color 160ms ease,
    transform 200ms ease;
}

.sw-auth-menu[open] .sw-auth-chevron {
  color: rgb(255 255 255 / 0.88);
  transform: rotate(180deg);
}

.sw-auth-panel {
  position: absolute;
  top: calc(100% + 0.55rem);
  right: 0;
  min-width: 14rem;
  padding: 0.85rem;
  border: 1px solid rgb(0 0 54 / 0.08);
  border-radius: 1rem;
  background: linear-gradient(
    180deg,
    rgb(255 255 255 / 0.99),
    rgb(244 251 250 / 0.98)
  );
  box-shadow:
    0 18px 40px rgb(0 0 54 / 0.18),
    0 2px 8px rgb(0 0 54 / 0.08);
  color: var(--text-primary);
  overflow: hidden;
  transform-origin: top right;
  animation: sw-auth-panel-enter 180ms cubic-bezier(0.25, 1, 0.5, 1);
}

.sw-auth-panel-copy {
  display: grid;
  gap: 0.15rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid rgb(0 0 54 / 0.08);
}

.sw-auth-panel-kicker {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sw-auth-panel-title {
  margin: 0;
  color: var(--text-primary);
  font-size: 0.98rem;
}

.sw-auth-menu-button {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: flex-start;
  min-height: 2.5rem;
  padding: 0.55rem 0.75rem;
  border: 0;
  border-radius: 0.8rem;
  background: transparent;
  color: var(--text-primary);
  text-decoration: none;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  transition:
    background-color 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.sw-auth-menu-button:hover,
.sw-auth-menu-button:focus-visible {
  background: rgb(20 181 154 / 0.08);
  color: var(--text-primary);
  transform: translateX(1px);
}

.sw-auth-form {
  margin: 0;
}

.sw-auth-user {
  color: rgb(255 255 255 / 0.84);
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 11rem;
}

.sw-auth-link,
.sw-auth-link:link,
.sw-auth-link:visited {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.25rem;
  padding: 0.45rem 0.9rem;
  border: 1px solid rgb(255 255 255 / 0.16);
  border-radius: 9999px;
  background: rgb(255 255 255 / 0.04);
  color: var(--header-foreground);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease;
}

.sw-auth-link:hover,
.sw-auth-link:focus-visible {
  background: rgb(255 255 255 / 0.1);
  border-color: rgb(255 255 255 / 0.28);
  color: var(--header-foreground);
}

@keyframes sw-auth-panel-enter {
  from {
    opacity: 0;
    transform: translateY(-0.25rem) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .sw-auth-trigger,
.sw-auth-chevron,
.sw-auth-menu-button,
.sw-auth-panel {
    transition: none;
    animation: none;
  }

  .sw-auth-trigger:hover,
.sw-auth-trigger:focus-visible,
.sw-auth-menu[open] > .sw-auth-trigger,
.sw-auth-menu-button:hover,
.sw-auth-menu-button:focus-visible,
.sw-auth-menu[open] .sw-auth-chevron {
    transform: none;
  }
}

.sw-auth-redirect {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgb(0 0 54 / 0.38);
  backdrop-filter: blur(8px);
}

.sw-auth-redirect > .sw-screen-state-shell {
  --sw-screen-state-min-height: 0;
  --sw-screen-state-padding-block: 0;
  --sw-screen-state-padding-inline: 0;
  --sw-screen-state-card-width: min(100%, 26rem);
  --sw-screen-state-copy-max-width: 22rem;
  flex: 0 1 auto;
  width: 100%;
}

.sw-auth-redirect .sw-screen-state-card {
  padding: 1.6rem 1.5rem;
  border-color: rgb(255 255 255 / 0.45);
  background: rgb(255 255 255 / 0.98);
  box-shadow: 0 24px 48px rgb(0 0 54 / 0.22);
}

.sw-auth-redirect .sw-screen-state-spinner {
  margin-bottom: 0.15rem;
}

.sw-brand-link,
.sw-brand-link.mud-typography,
.sw-brand-link:link,
.sw-brand-link:visited {
  color: var(--header-foreground);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.1rem;
}

.sw-brand-link {
  display: inline-flex;
  align-items: center;
}

.sw-brand-logo {
  display: block;
  height: 2rem;
  width: auto;
}

.sw-brand-survey,
.sw-brand-survey.mud-typography,
.sw-brand-survey:link,
.sw-brand-survey:visited {
  color: var(--header-muted);
  text-decoration: none;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sw-brand-survey:hover {
  color: var(--header-foreground);
}

.sw-brand-separator {
  color: rgb(255 255 255 / 0.4);
  font-size: 0.9rem;
}

.sw-tab-strip {
  margin-top: 0;
  border-top: 1px solid rgb(255 255 255 / 0.07);
}

.sw-tab-strip-row {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex-wrap: wrap;
  min-width: 0;
}

.sw-tab-scroll {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow-x: auto;
  overflow-y: hidden;
}

.sw-tab-nav {
  display: flex;
  min-width: max-content;
  align-items: center;
  gap: 0.25rem;
  padding-top: 0.375rem;
  padding-bottom: 0.375rem;
}

.sw-tab-link,
.sw-tab-link:link,
.sw-tab-link:visited {
  position: relative;
  white-space: nowrap;
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  color: var(--header-muted);
  text-decoration: none;
  font-size: 0.8125rem;
  line-height: 1;
  font-weight: 500;
  transition: all 150ms ease;
}

.sw-tab-link::after {
  content: "";
  position: absolute;
  left: 0.375rem;
  right: 0.375rem;
  bottom: 0;
  height: 2px;
  border-radius: 9999px;
  background: transparent;
  transition: background-color 150ms ease;
}

.sw-tab-link:hover {
  color: var(--header-foreground);
  background: rgb(255 255 255 / 0.08);
}

.sw-tab-link.is-active {
  color: var(--header-foreground);
  background: rgb(255 255 255 / 0.12);
}

.sw-tab-link.is-active::after {
  background: var(--brand-primary);
}

.sw-tab-refresh-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin-left: auto;
  min-height: 2rem;
  white-space: nowrap;
}

.sw-tab-refresh-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid rgb(255 255 255 / 0.12);
  border-radius: 999px;
  background: rgb(255 255 255 / 0.06);
  color: var(--header-foreground);
  cursor: pointer;
  transition:
    background-color 150ms ease,
    border-color 150ms ease,
    transform 150ms ease;
}

.sw-tab-refresh-button:hover:not(:disabled) {
  background: rgb(255 255 255 / 0.12);
  border-color: rgb(255 255 255 / 0.18);
}

.sw-tab-refresh-button:disabled {
  cursor: default;
  opacity: 0.72;
}

.sw-tab-refresh-icon {
  font-size: 1rem;
}

.sw-tab-refresh-icon.is-spinning {
  animation: sw-tab-refresh-spin 0.9s linear infinite;
}

.sw-tab-refresh-status {
  font-size: 0.76rem;
  color: var(--header-muted);
}

.sw-tab-refresh-status.is-error {
  color: rgb(255 216 216 / 0.92);
}

@keyframes sw-tab-refresh-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 720px) {
  .sw-tab-refresh-inline {
    margin-left: 0;
    width: 100%;
    justify-content: flex-end;
  }
}

.sw-shell-main {
  flex: 1;
  padding-top: 1rem;
  padding-bottom: 1.5rem;
}

.sw-shell-main-assessment {
  display: flex;
  min-height: 0;
  padding-top: 1rem;
  padding-bottom: 0.75rem;
}
.sw-main-content {
  min-width: 0;
}

.sw-shell-main-assessment .sw-main-content {
  display: flex;
  flex: 1;
  min-height: 0;
}

.sw-shell-main-assessment .sw-page {
  flex: 1;
  min-height: 0;
}

.sw-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.sw-footer-compact {
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-align: center;
}

.sw-footer-full {
  padding-top: var(--space-10);
  padding-bottom: var(--space-10);
}

.sw-footer-grid {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 2rem;
}

.sw-accent-bar {
  height: 0.25rem;
  width: 2.5rem;
  border-radius: 9999px;
  background: var(--brand-primary);
}

.sw-footer-title,
.sw-footer-title:link,
.sw-footer-title:visited {
  display: inline-flex;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary) !important;
  text-decoration: none;
}

.sw-footer-brand .sw-footer-title,
.sw-footer-brand .sw-footer-title:link,
.sw-footer-brand .sw-footer-title:visited {
  margin-top: 0.75rem;
}

.sw-footer-text {
  margin-top: 0.5rem;
  max-width: 28rem;
  font-size: 0.875rem;
  line-height: 1.5rem;
  color: rgb(0 0 54 / 0.7);
}

.sw-footer-caption {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 500;
  color: rgb(0 0 54 / 0.6);
}

.sw-footer-links,
.sw-footer-links-inline {
  margin-top: 0.75rem;
}

.sw-footer-links {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 0.5rem;
}

.sw-footer-links-inline {
  display: flex;
  gap: 0.5rem 1rem;
  flex-wrap: wrap;
}

.sw-footer-link,
.sw-footer-link:link,
.sw-footer-link:visited {
  font-size: 0.875rem;
  color: rgb(0 0 54 / 0.72) !important;
  text-decoration: none;
}

.sw-footer-link:hover {
  color: var(--text-primary);
  text-decoration: underline;
}

.sw-footer-link-secondary,
.sw-footer-link-secondary:link,
.sw-footer-link-secondary:visited {
  font-size: 0.875rem;
  color: var(--brand-secondary);
  text-decoration: none;
  font-weight: 500;
}

.sw-footer-link-secondary:hover {
  text-decoration: underline;
}

.sw-footer-copy {
  margin: 0;
  font-size: 0.75rem;
  color: rgb(0 0 54 / 0.6);
}

.sw-footer-dot {
  color: rgb(0 0 54 / 0.4);
}

@media (min-width: 640px) {
  .sw-footer-grid {
      grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767.98px) {
  .sw-brand-row {
      flex-wrap: wrap;
  }

  .sw-brand-actions {
      width: 100%;
      justify-content: flex-start;
  }

  .sw-auth-panel {
      left: 0;
      right: auto;
  }

  .sw-auth-user {
      max-width: calc(100vw - 10rem);
  }
}

@media (max-width: 960px) {
  .sw-shell-assessment::before {
    background:
      linear-gradient(135deg, rgb(255 255 255 / 0.74), rgb(255 255 255 / 0.18)),
      repeating-linear-gradient(
        118deg,
        transparent 0,
        transparent 18px,
        var(--survey-art-line) 18px,
        var(--survey-art-line) 19px,
        transparent 19px,
        transparent 58px
      ),
      repeating-linear-gradient(
        28deg,
        transparent 0,
        transparent 28px,
        var(--survey-art-line-soft) 28px,
        var(--survey-art-line-soft) 29px,
        transparent 29px,
        transparent 82px
      );
  }

  .sw-shell-assessment::after {
    inset: 18% auto auto 76%;
    width: 18rem;
    height: 18rem;
  }

  .sw-shell-main-assessment {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
  }
}

@media (min-width: 1024px) {
  .sw-footer-grid {
      grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
