/* Dedicated JWT authorization controls. This intentionally does not use Swagger UI's modal. */
.ahiia-docs-header__inner {
  justify-content: space-between;
  gap: 20px;
}

.ahiia-docs-header__actions {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.ahiia-auth-state {
  color: #d5d8e6;
  font-size: 13px;
  font-weight: 650;
}

.ahiia-auth-state::before {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 50%;
  background: #9ca3b6;
  content: "";
}

.ahiia-auth-state--authorized {
  color: #ffffff;
}

.ahiia-auth-state--authorized::before {
  background: #55d49b;
  box-shadow: 0 0 0 3px rgba(85, 212, 155, 0.14);
}

.ahiia-authorize-launch {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  color: #ffffff;
  border: 1px solid #8898dd;
  border-radius: 5px;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 750;
  line-height: 1;
  transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.ahiia-authorize-launch svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

.ahiia-authorize-launch:hover,
.ahiia-authorize-launch:focus-visible {
  border-color: #b8c3ff;
  background: rgba(136, 152, 221, 0.18);
  outline: none;
  transform: translateY(-1px);
}

.ahiia-authorize-launch--authorized {
  border-color: #55d49b;
  background: rgba(85, 212, 155, 0.12);
}

/* Hides only Swagger UI's native authorization control. The endpoint list remains native. */
.swagger-ui .scheme-container {
  display: none;
}

.ahiia-auth-dialog {
  width: min(520px, calc(100vw - 32px));
  margin: auto;
  padding: 0;
  color: #2f3341;
  border: 0;
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(13, 16, 29, 0.32);
}

.ahiia-auth-dialog::backdrop {
  background: rgba(17, 18, 23, 0.58);
}

.ahiia-auth-dialog__panel {
  padding: 26px;
  background: #ffffff;
}

.ahiia-auth-dialog__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 23px;
}

.ahiia-auth-dialog__header h2 {
  margin: 0;
  color: #303545;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 20px;
  font-weight: 750;
  line-height: 1.2;
}

.ahiia-auth-dialog__header p {
  margin: 5px 0 0;
  color: #727887;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13px;
  font-weight: 600;
}

.ahiia-auth-dialog__dismiss {
  width: 32px;
  height: 32px;
  padding: 0;
  color: #5d6473;
  border: 0;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  font-size: 27px;
  line-height: 1;
}

.ahiia-auth-dialog__dismiss:hover,
.ahiia-auth-dialog__dismiss:focus-visible {
  color: #252a38;
  background: #eef0f6;
  outline: none;
}

.ahiia-auth-dialog__label {
  display: block;
  margin-bottom: 8px;
  color: #3f4555;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13px;
  font-weight: 750;
}

.ahiia-auth-dialog__input {
  box-sizing: border-box;
  width: 100%;
  padding: 11px 12px;
  color: #242938;
  border: 1px solid #b9bfce;
  border-radius: 5px;
  background: #ffffff;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.4;
}

.ahiia-auth-dialog__input:focus {
  border-color: #7183d3;
  outline: 3px solid rgba(136, 152, 221, 0.2);
}

.ahiia-auth-dialog__help,
.ahiia-auth-dialog__message {
  min-height: 20px;
  margin: 8px 0 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13px;
  line-height: 1.45;
}

.ahiia-auth-dialog__help {
  color: #6f7584;
}

.ahiia-auth-dialog__help code {
  color: #454c61;
  font-size: 12px;
}

.ahiia-auth-dialog__message {
  margin-top: 14px;
  color: #555d71;
  font-weight: 650;
}

.ahiia-auth-dialog__message--pending { color: #5264b0; }
.ahiia-auth-dialog__message--success { color: #087745; }
.ahiia-auth-dialog__message--error { color: #b3261e; }

.ahiia-auth-dialog__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

.ahiia-auth-dialog__authorize,
.ahiia-auth-dialog__close {
  min-width: 92px;
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 5px;
  cursor: pointer;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13px;
  font-weight: 750;
}

.ahiia-auth-dialog__authorize {
  color: #ffffff;
  border: 1px solid #7183d3;
  background: #7183d3;
}

.ahiia-auth-dialog__authorize:hover,
.ahiia-auth-dialog__authorize:focus-visible {
  border-color: #5f73ca;
  background: #5f73ca;
  outline: none;
}

.ahiia-auth-dialog__authorize:disabled {
  cursor: wait;
  opacity: 0.7;
}

.ahiia-auth-dialog__close {
  color: #404758;
  border: 1px solid #aeb5c4;
  background: #ffffff;
}

.ahiia-auth-dialog__close:hover,
.ahiia-auth-dialog__close:focus-visible {
  border-color: #747d90;
  background: #f4f5f8;
  outline: none;
}

/* A verified token is reflected on the native lock beside protected operations. */
.ahiia-is-authorized .swagger-ui .authorization__btn svg {
  fill: #087745;
}

@media (max-width: 720px) {
  .ahiia-docs-header__inner {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
    padding-top: 14px;
    padding-bottom: 14px;
  }

  .ahiia-docs-header__actions {
    width: 100%;
    justify-content: space-between;
  }

  .ahiia-auth-dialog__panel {
    padding: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ahiia-authorize-launch {
    transition: none;
  }
}
