/**
 * [등록 폼 공통 UI]
 * - 역할: 전시·아티스트·갤러리 등록 헤더와 하단 액션의 시각 규격 통일
 * - 작성/수정일: 2026-09-24
 */

:root {
  /* [등록 폼 공통 폭] 역할: 등록 유형 선택과 실제 작성 화면의 기준선을 하나로 관리 · 작성/수정일: 2026-09-24 */
  --an-register-shell-width: 920px;
}

.an-form-heading {
  width: 100%;
  max-width: var(--an-register-shell-width);
  margin: 0 auto 28px;
  padding: 0 0 24px;
  border-bottom: 1px solid var(--line-color, #ececec);
}

/* [전시 등록 폼 폭] 역할: 긴 입력 필드를 읽기 좋은 폭으로 제한하고 유형 선택 화면과 정렬 · 작성/수정일: 2026-09-24 */
.an-ex-write > .an-container {
  width: 100%;
  max-width: var(--an-register-shell-width);
  margin-inline: auto;
}

.an-form-heading__eyebrow {
  margin: 0 0 9px;
  color: var(--muted-color, #777);
  font-size: var(--fs-xs, 11px);
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1.4;
}

.an-form-heading__title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.an-form-heading__title {
  margin: 0;
  color: var(--title-color, #171717);
  font-size: clamp(30px, 2.6vw, 34px);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.2;
}

.an-form-heading__badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border: 1px solid var(--border-color, #dedede);
  border-radius: 999px;
  background: var(--section-bg-color, #f7f7f7);
  color: var(--title-color, #171717);
  font-size: var(--fs-caption, 12px);
  font-weight: 700;
  line-height: 1;
}

.an-form-heading__desc {
  max-width: 680px;
  margin: 10px 0 0;
  color: var(--muted-color, #777);
  font-size: var(--fs-body, 15px);
  letter-spacing: -0.01em;
  line-height: 1.6;
}

.an-form-heading__guide {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 17px 0 0;
  padding: 0;
  color: var(--text-color, #555);
  font-size: var(--fs-caption, 12px);
  line-height: 1.45;
  list-style: none;
}

.an-form-heading__guide li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.an-form-heading__guide i {
  color: var(--muted-color, #777);
  font-size: 14px;
}

/* [등록 폼 공통 액션] 역할: 저장·이전·다음·제출 버튼의 높이와 위계 통일 · 작성/수정일: 2026-09-24 */
.an-form-actions {
  --an-form-action-button-width: 120px;
  --an-form-action-button-gap: 8px;
  gap: 10px 16px;
  margin-top: 40px;
  padding: 16px 0 calc(10px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--border-color, #e5e5e5);
  box-shadow: none;
}

.an-form-actions .primary-btn1,
.an-form-actions .primary-btn2,
.an-form-actions .secondary-btn {
  min-width: var(--an-form-action-button-width);
  min-height: 48px;
  padding: 11px 20px;
  border-radius: 8px;
  box-shadow: none;
  font-size: var(--fs-sm, 13px);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.an-form-actions .primary-btn1,
.an-form-actions .primary-btn2 {
  border-color: var(--title-color, #171717);
  background: var(--title-color, #171717);
  color: var(--white-color, #fff);
}

.an-form-actions .secondary-btn {
  border-color: var(--border-color, #dedede);
  background: var(--white-color, #fff);
  color: var(--title-color, #171717);
}

.an-form-actions .primary-btn1:hover,
.an-form-actions .primary-btn2:hover {
  border-color: #333;
  background: #333;
}

.an-form-actions .secondary-btn:hover {
  border-color: var(--divider-color, #c9c9c9);
  background: var(--section-bg-color, #f7f7f7);
}

.an-form-actions .an-ar-write__actions-start > .secondary-btn {
  flex: 0 0 auto;
  width: auto;
}

/* [전시 등록 액션 안내] 역할: 안내문구 폭을 좌측 취소·임시 저장 버튼 묶음과 정확히 맞춤 · 작성/수정일: 2026-09-24 */
.an-form-actions .an-ex-write__actions-hint {
  width: var(--an-form-action-button-width);
}

.an-form-actions:has([data-an-ex-draft-save]:not([hidden])) .an-ex-write__actions-hint {
  width: calc(
    var(--an-form-action-button-width) + var(--an-form-action-button-width) +
      var(--an-form-action-button-gap)
  );
}

.an-form-actions [data-an-ex-prev] span::before,
.an-form-actions [data-an-ar-prev] span::before {
  content: "← ";
}

.an-form-actions [data-an-ex-next] span::after,
.an-form-actions [data-an-ar-next] span::after {
  content: " →";
}

.an-form-actions :is(a, button):focus-visible {
  outline: 2px solid var(--title-color, #171717);
  outline-offset: 2px;
}

html.dark .an-form-heading__badge,
body.dark .an-form-heading__badge,
html.dark .an-form-actions .secondary-btn,
body.dark .an-form-actions .secondary-btn {
  background: var(--section-bg-color);
  border-color: var(--border-color);
  color: var(--title-color);
}

@media (max-width: 767.98px) {
  .an-form-heading {
    margin-bottom: 22px;
    padding-bottom: 20px;
  }

  .an-form-heading__title {
    font-size: 24px;
  }

  .an-form-heading__desc {
    margin-top: 8px;
    font-size: 14px;
    line-height: 1.55;
  }

  .an-form-heading__guide {
    display: grid;
    grid-template-columns: 1fr;
    gap: 7px;
    margin-top: 15px;
  }

  .an-form-actions {
    margin-top: 28px;
    padding-top: 12px;
  }

  .an-form-actions .primary-btn1,
  .an-form-actions .primary-btn2,
  .an-form-actions .secondary-btn,
  .an-form-actions .an-ar-write__actions-start > .secondary-btn {
    width: 100%;
    min-width: 0;
  }

  .an-form-actions .an-ex-write__actions-hint,
  .an-form-actions:has([data-an-ex-draft-save]:not([hidden])) .an-ex-write__actions-hint {
    width: 100%;
  }
}
