/* "Create with AI" dialog (www/editor/ai-designer.js); its buttons are styled in editor.css */

.popup_wnd.ai-designer-popup {
  height: auto;
  max-width: calc(100vw - 32px);
}

.popup_wnd.ai-designer-popup .popup_content {
  width: auto !important;
}

.ai-designer {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 18px 20px 20px;
  font-family: 'Open Sans', sans-serif;
  font-size: 13px;
  line-height: 1.5;
  color: #344054;
}

.ai-designer p {
  margin: 0;
}

.ai-designer__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ai-designer__label {
  font-size: 13px;
  font-weight: 600;
  color: #101828;
}

.ai-designer__optional {
  font-weight: 400;
  color: #667085;
}

.ai-designer__prompt {
  box-sizing: border-box;
  width: 100%;
  min-height: 96px;
  padding: 10px 12px;
  border: solid 1px #d0d5dd;
  border-radius: 8px;
  font: inherit;
  line-height: 1.5;
  color: #101828;
  resize: vertical;
  transition:
    border-color 0.12s ease,
    box-shadow 0.12s ease;
}

.ai-designer__prompt::placeholder {
  color: #98a2b3;
}

.ai-designer__prompt:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.ai-designer__prompt:disabled {
  background: #f9fafb;
  color: #667085;
}

/* --- example chips --- */

.ai-designer__examples {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #667085;
}

.ai-designer__example {
  padding: 2px 10px;
  border: dashed 1px #d0d5dd;
  border-radius: 999px;
  background: #fff;
  font: inherit;
  font-size: 12px;
  color: #344054;
  cursor: pointer;
  transition:
    border-color 0.12s ease,
    color 0.12s ease;
}

.ai-designer__example:hover:not(:disabled) {
  border-color: #2563eb;
  color: #1d4ed8;
}

.ai-designer__example:disabled {
  opacity: 0.5;
  cursor: default;
}

/* --- style chips --- */

.ai-designer__styles {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.ai-designer__style {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  padding: 8px 10px;
  border: solid 1px #d0d5dd;
  border-radius: 8px;
  background: #fff;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition:
    border-color 0.12s ease,
    background-color 0.12s ease;
}

.ai-designer__style:hover:not(:disabled) {
  border-color: #2563eb;
}

.ai-designer__style[aria-pressed='true'] {
  border-color: #2563eb;
  background: #eff4ff;
  box-shadow: 0 0 0 1px #2563eb inset;
}

.ai-designer__style:disabled {
  opacity: 0.6;
  cursor: default;
}

.ai-designer__style-name {
  font-size: 13px;
  font-weight: 600;
  color: #101828;
}

.ai-designer__style-hint {
  font-size: 11px;
  line-height: 1.3;
  color: #667085;
}

/* --- logo --- */

.ai-designer__logo-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
}

.ai-designer__file {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  border: solid 1px #d0d5dd;
  border-radius: 8px;
  background: #fff;
  font-weight: 600;
  color: #2563eb;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.12s ease;
}

.ai-designer__file:hover {
  border-color: #2563eb;
}

.ai-designer__file:focus-within {
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.ai-designer__file input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.ai-designer__file.is-disabled {
  opacity: 0.5;
  pointer-events: none;
}

.ai-designer__logo-thumb {
  box-sizing: border-box;
  width: 40px;
  height: 40px;
  padding: 3px;
  border: solid 1px #e4e7ec;
  border-radius: 6px;
  background: #fff;
  object-fit: contain;
}

.ai-designer__logo-state {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  color: #667085;
}

.ai-designer__link {
  padding: 0;
  border: none;
  background: none;
  color: #2563eb;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.ai-designer__link:hover {
  text-decoration: underline;
}

/* --- notes, progress and errors --- */

.ai-designer__note {
  padding: 10px 12px;
  border-radius: 8px;
  background: #f9fafb;
  border: solid 1px #eaecf0;
  font-size: 12px;
  color: #475467;
}

.ai-designer__progress {
  padding: 12px 14px;
  border-radius: 8px;
  border: solid 1px #e4e7ec;
  background: #fff;
}

.ai-designer__progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ai-designer__status {
  font-weight: 600;
  color: #101828;
}

.ai-designer__elapsed {
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  color: #667085;
}

.ai-designer__steps {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  font-size: 12px;
}

.ai-designer__steps li {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #98a2b3;
}

.ai-designer__steps li.is-done {
  color: #667085;
}

.ai-designer__steps li.is-active {
  font-weight: 600;
  color: #101828;
}

.ai-designer__step-dot {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: solid 2px #d0d5dd;
  border-radius: 50%;
  background: #fff;
  color: #fff;
}

.is-done .ai-designer__step-dot {
  border-color: #16a34a;
  background: #16a34a;
}

.is-active .ai-designer__step-dot {
  border-color: #2563eb;
}

.is-active .ai-designer__step-dot::after {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #2563eb;
  animation: ai-designer-pulse 1.2s ease-in-out infinite;
}

@keyframes ai-designer-pulse {
  50% {
    opacity: 0.25;
  }
}

@media (prefers-reduced-motion: reduce) {
  .is-active .ai-designer__step-dot::after {
    animation: none;
  }
}

.ai-designer__progress-note {
  margin-top: 10px !important;
  font-size: 12px;
  color: #667085;
}

.ai-designer__error:not(:empty) {
  padding: 10px 12px;
  border-radius: 8px;
  background: #fef3f2;
  border: solid 1px #fecdca;
  color: #b42318;
}

/* --- footer --- */

.ai-designer__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 4px;
}

.ai-designer__quota {
  margin-right: auto;
  font-size: 12px;
  color: #667085;
}

.ai-designer__quota.is-exhausted {
  color: #b42318;
}

.ai-designer__button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border: solid 1px transparent;
  border-radius: 8px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition:
    background-color 0.12s ease,
    border-color 0.12s ease;
}

.ai-designer__button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.3);
}

.ai-designer__button--secondary {
  border-color: #d0d5dd;
  background: #fff;
  color: #344054;
}

.ai-designer__button--secondary:hover:not(:disabled) {
  border-color: #98a2b3;
  background: #f8fafc;
}

.ai-designer__button--primary {
  background: #2563eb;
  color: #fff;
}

.ai-designer__button--primary:hover:not(:disabled) {
  background: #1d4ed8;
}

.ai-designer__button:disabled {
  border-color: #eef1f5;
  background: #eef1f5;
  color: #98a2b3;
  cursor: default;
}

@media (max-width: 640px) {
  .ai-designer__styles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
