/* ============ Buttons ============ */
/* primary — Soft Blue, pill, 44px+ touch target */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--s-xs);
  min-height: 44px;
  width: 100%;
  padding: 11px 22px;
  background: var(--color-primary);
  color: var(--color-primary-on);
  font-family: var(--ff-text);
  font-size: 15px; font-weight: 600;
  border-radius: var(--r-sm);
  transition: transform 100ms ease, background 100ms ease;
  -webkit-tap-highlight-color: transparent;
}
.btn-primary:active { transform: scale(0.98); background: var(--color-primary-active); }
.btn-primary:focus-visible { outline: 2px solid var(--color-primary-active); outline-offset: 2px; }
.btn-primary[disabled],
.btn-primary.is-loading {
  background: var(--color-divider-soft);
  color: var(--color-text-muted);
  cursor: progress;
  transform: none;
}

/* text link button — "비밀번호를 잊으셨나요?" */
.btn-text-link {
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent;
  color: var(--color-text-muted);
  font-family: var(--ff-text);
  font-size: 12px; font-weight: 500;
  padding: 8px 4px;
  min-height: 32px;
  border-radius: var(--r-xs);
  -webkit-tap-highlight-color: transparent;
}
.btn-text-link:active { color: var(--color-primary-active); }
.btn-text-link[disabled],
.btn-text-link.is-loading { color: var(--color-text-muted); cursor: progress; }

/* dark utility — header/nav */
.btn-dark-utility {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 32px;
  padding: 6px 12px;
  background: var(--color-ink);
  color: var(--on-dark);
  font-family: var(--ff-text);
  font-size: 12px; font-weight: 500;
  border-radius: var(--r-sm);
  transition: transform 100ms ease;
  -webkit-tap-highlight-color: transparent;
}
.btn-dark-utility:active { transform: scale(0.95); }
.btn-dark-utility:focus-visible { outline: 2px solid var(--color-primary-active); outline-offset: 2px; }

/* circular icon — over photography */
.btn-icon-circular {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px;
  background: var(--color-chip-translucent);
  color: var(--color-ink);
  border-radius: var(--r-pill);
  font-size: 24px; line-height: 1;
  transition: transform 100ms ease;
  -webkit-tap-highlight-color: transparent;
}
.btn-icon-circular:active { transform: scale(0.95); }

/* full-width helper */
.btn-fullwidth { width: 100%; }

/* ============ Inputs (Instagram-style rectangle) ============ */
.input-field {
  width: 100%;
  min-height: 40px;
  padding: 10px 12px;
  background: var(--color-input-bg);
  color: var(--color-ink);
  font-family: var(--ff-text);
  font-size: 14px; font-weight: 400; line-height: 1.4;
  border: 1px solid var(--color-input-border);
  border-radius: var(--r-sm);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.input-field::placeholder { color: var(--color-text-muted); }
.input-field:focus-visible {
  border-color: var(--color-primary-active);
  outline: 2px solid var(--color-primary);
  outline-offset: -1px;
}

/* legacy input-pill (admin select 등 한정) */
.input-pill {
  width: 100%;
  min-height: 40px;
  padding: 10px 16px;
  background: var(--color-input-bg);
  color: var(--color-ink);
  font-family: var(--ff-text);
  font-size: 14px;
  border: 1px solid var(--color-input-border);
  border-radius: var(--r-sm);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

/* select pill */
.select-pill {
  position: relative;
  width: 100%;
}
.select-pill::after {
  content: "▾";
  position: absolute; right: 14px; top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted);
  pointer-events: none;
  font-size: 12px;
}
.select-pill select {
  width: 100%;
  min-height: 40px;
  padding: 10px 36px 10px 12px;
  background: var(--color-input-bg);
  color: var(--color-ink);
  font-family: var(--ff-text);
  font-size: 14px;
  border: 1px solid var(--color-input-border);
  border-radius: var(--r-sm);
  -webkit-appearance: none;
  appearance: none;
}

/* ============ Card ============ */
.card {
  background: var(--color-canvas);
  border: 1px solid var(--color-hairline);
  border-radius: var(--r-lg);
  padding: var(--s-lg);
}

/* ============ Global Bar ============ */
.global-bar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s-sm);
  height: var(--global-bar-h);
  padding: 0 var(--s-md);
  background: var(--color-surface-black);
  color: var(--on-dark);
}
.global-bar .brand {
  color: var(--on-dark);
  font-family: var(--ff-display);
  font-size: 18px; font-weight: 700;
  line-height: 1;
  display: inline-flex; align-items: center; gap: 8px;
}
.global-bar .brand-logo {
  width: 18px; height: 18px;
  display: block;
  object-fit: contain;
  transform: translateY(1px);
}
.global-bar__right {
  display: inline-flex; align-items: center; gap: var(--s-xs);
}

/* ============ Modal (photo viewer) ============ */
.modal {
  position: fixed; inset: 0; z-index: 100;
  background: var(--color-surface-black);
  display: flex; align-items: center; justify-content: center;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}
.modal[hidden] { display: none; }
.modal__img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.modal__close {
  position: absolute;
  top: calc(env(safe-area-inset-top) + var(--s-sm));
  right: var(--s-sm);
}

/* ============ Form error ============ */
.form-error {
  color: #b00020;
}
.form-error[hidden] { display: none; }

/* ============ Thumb strip (horizontal slide) ============ */
.thumb-strip {
  display: flex;
  gap: var(--s-xs);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  padding: var(--s-xs) 0;
}
.thumb-strip__item {
  flex: 0 0 auto;
  scroll-snap-align: start;
  width: 96px; height: 96px;
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--color-canvas);
  border: 2px solid transparent;
  position: relative;
  transition: transform 100ms ease, border-color 100ms ease, opacity 100ms ease;
  -webkit-tap-highlight-color: transparent;
}
.thumb-strip__item:active { transform: scale(0.95); }
.thumb-strip__item img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.thumb-strip__item.is-selected {
  border-color: var(--color-primary-active);
  border-width: 2px;
}
.thumb-strip__item .thumb-check {
  position: absolute;
  top: 8px; right: 8px;
  width: 16px; height: 16px;
  display: none;
}
.thumb-strip__item.is-selected .thumb-check { display: block; }
.thumb-strip__item.is-loading { opacity: 0.6; cursor: progress; }

/* ============ Loader spinner ============ */
.loader {
  width: 20px; aspect-ratio: 1; border-radius: 50%;
  background:
    radial-gradient(farthest-side, #ffa516 94%, #0000) top/4px 4px no-repeat,
    conic-gradient(#0000 30%, #ffa516);
  -webkit-mask: radial-gradient(farthest-side, #0000 calc(100% - 4px), #000 0);
          mask: radial-gradient(farthest-side, #0000 calc(100% - 4px), #000 0);
  animation: bingo-loader-rot 1s infinite linear;
  display: inline-block;
  vertical-align: middle;
  margin-right: 6px;
}
.loader--lg {
  width: 36px;
  background:
    radial-gradient(farthest-side, #ffa516 94%, #0000) top/6px 6px no-repeat,
    conic-gradient(#0000 30%, #ffa516);
  -webkit-mask: radial-gradient(farthest-side, #0000 calc(100% - 6px), #000 0);
          mask: radial-gradient(farthest-side, #0000 calc(100% - 6px), #000 0);
}
@keyframes bingo-loader-rot {
  100% { transform: rotate(1turn); }
}

/* ============ Icon check ============ */
.icon-check {
  width: 16px; height: 16px;
  vertical-align: middle;
  display: inline-block;
}
.icon-check--sm { width: 14px; height: 14px; margin-right: 4px; }

/* ============ Empty state (button-sized pill) ============ */
.empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 1 1 100%;
  width: 100%;
  min-height: 44px;
  padding: 11px 22px;
  background: #F2F2F2;
  color: #939393;
  font-family: var(--ff-text);
  font-size: 12px;
  font-weight: 500;
  border-radius: var(--r-sm);
  text-align: center;
}
.empty-state__icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.7;
}
