:root {
  color-scheme: light;
  font-family:
    "Noto Sans TC", "Microsoft JhengHei", system-ui, -apple-system, sans-serif;
}

html,
body {
  min-height: 100%;
  margin: 0;
  background: #fff;
}

.x720-survey-gate {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  padding: 20px;
  background: #fff;
  color: #244339;
}

.x720-survey-gate__status {
  display: grid;
  justify-items: center;
  gap: 14px;
  text-align: center;
}

.x720-survey-gate__status p {
  margin: 0;
  font-size: 16px;
  line-height: 1.6;
}

.x720-survey-gate__spinner {
  width: 34px;
  height: 34px;
  box-sizing: border-box;
  border: 4px solid #dce9e3;
  border-top-color: #2f7b5b;
  border-radius: 50%;
  animation: x720-gate-spin 0.75s linear infinite;
}

.x720-survey-gate__retry,
.x720-survey-gate__close {
  min-height: 42px;
  border: 0;
  border-radius: 999px;
  padding: 9px 20px;
  background: #276c51;
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.x720-survey-gate__retry:focus-visible,
.x720-survey-gate__close:focus-visible {
  outline: 3px solid #f1bd42;
  outline-offset: 3px;
}

.x720-survey-gate--survey {
  place-items: stretch;
  padding: 10px;
  background: rgba(10, 24, 18, 0.78);
}

.x720-survey-gate__dialog {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(1180px, 100%);
  height: min(920px, calc(100dvh - 20px));
  margin: auto;
  overflow: hidden;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
}

.x720-survey-gate__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 48px;
  box-sizing: border-box;
  padding: 6px 8px 6px 18px;
  border-bottom: 1px solid #e7ece9;
}

.x720-survey-gate__title {
  overflow: hidden;
  margin: 0;
  color: #244339;
  font-size: 16px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.x720-survey-gate__close {
  min-width: 82px;
  min-height: 38px;
  padding: 7px 16px;
}

.x720-survey-gate__frame {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

/* Gate 放行後、Bootstrap 尚未完成時仍能顯示最小載入畫面。 */
#app-loading {
  color: #276c51;
}

#app-loading .spinner-border {
  width: 36px;
  height: 36px;
  box-sizing: border-box;
  border: 4px solid #dce9e3;
  border-top-color: #2f7b5b;
  border-radius: 50%;
  animation: x720-gate-spin 0.75s linear infinite;
}

#app-loading .visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

@keyframes x720-gate-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 640px) {
  .x720-survey-gate--survey {
    padding: 0;
  }

  .x720-survey-gate__dialog {
    width: 100%;
    height: 100dvh;
    border-radius: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .x720-survey-gate__spinner,
  #app-loading .spinner-border {
    animation-duration: 1.5s;
  }
}
