:root {
  --background: #f1f4f2;
  --surface: #ffffff;
  --green: #009944;
  --green-dark: #087637;
  --ink: #17231c;
  --muted: #68766e;
  --line: #dce5df;
  --danger: #bd2d2d;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  overflow-x: hidden;
  background: var(--background);
  color: var(--ink);
  font-family: Arial, "Noto Sans KR", sans-serif;
}

button,
input {
  font: inherit;
}

.manager-shell {
  width: min(100% - 40px, 1380px);
  margin: 0 auto;
  padding: 64px 0 96px;
}

.manager-hero {
  position: relative;
  margin-bottom: 34px;
  padding-right: 110px;
}

.manager-hero h1,
.manager-hero p {
  margin: 0;
}

.manager-hero h1 {
  margin: 8px 0 14px;
  font-size: clamp(34px, 5vw, 62px);
  line-height: 1.04;
  letter-spacing: -0.045em;
}

.manager-hero p:last-child {
  color: var(--muted);
}

.eyebrow {
  color: var(--green-dark);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.logout-form {
  position: absolute;
  top: 0;
  right: 0;
}

.logout-form button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid #c9d5ce;
  border-radius: 7px;
  background: #ffffff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.login-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.login-shell {
  width: min(100%, 440px);
}

.login-card {
  padding: clamp(28px, 7vw, 46px);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 18px 55px rgb(19 52 34 / 10%);
}

.login-card h1 {
  margin: 9px 0 10px;
  font-size: clamp(30px, 8vw, 43px);
  letter-spacing: -0.04em;
}

.login-description {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.login-form .primary-button {
  width: 100%;
}

.notice {
  margin-bottom: 16px;
  padding: 14px 17px;
  border: 1px solid;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 700;
}

.notice--success {
  border-color: #a8d9bb;
  background: #ecf9f1;
  color: #176c36;
}

.notice--error {
  border-color: #ecc0c0;
  background: #fff0f0;
  color: #9e2525;
}

.creator-panel,
.content-panel {
  margin-top: 22px;
  padding: clamp(22px, 4vw, 42px);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 16px 46px rgb(19 52 34 / 7%);
}

.section-heading {
  display: flex;
  align-items: flex-start;
  gap: 15px;
  margin-bottom: 28px;
}

.section-heading > span {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: #e9f7ef;
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 800;
}

.section-heading h2,
.section-heading p {
  margin: 0;
}

.section-heading h2 {
  font-size: clamp(22px, 3vw, 31px);
  letter-spacing: -0.025em;
}

.section-heading p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.field,
.upload-field {
  display: grid;
  gap: 8px;
}

.field--wide {
  grid-column: 1 / -1;
  max-width: 680px;
}

.field > span,
.upload-field__title,
.background-picker legend {
  color: #35433b;
  font-size: 13px;
  font-weight: 800;
}

.field small {
  color: var(--muted);
  font-weight: 500;
}

.field input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid #cfdad3;
  border-radius: 8px;
  background: #fbfcfb;
  color: var(--ink);
}

.field input:focus,
.upload-field input:focus,
.background-option input:focus-visible + .background-option__card {
  border-color: var(--green);
  outline: 3px solid rgb(0 153 68 / 14%);
}

.upload-field {
  position: relative;
  margin-top: 18px;
  padding: 22px;
  border: 2px dashed #aebfb4;
  border-radius: 11px;
  background: #f7faf8;
  cursor: pointer;
  transition: 150ms ease;
}

.upload-field input {
  width: 100%;
  margin-top: 5px;
  padding: 12px;
  border: 1px solid #d5dfd9;
  border-radius: 8px;
  background: #ffffff;
  cursor: pointer;
}

.upload-field__help {
  color: var(--muted);
  font-size: 12px;
}

.upload-field:hover,
.upload-field.is-dragging {
  border-color: var(--green);
  background: #eef9f2;
}

.upload-selection {
  margin-top: 12px;
  padding: 14px 16px;
  border: 1px solid #cfe1d5;
  border-radius: 9px;
  background: #f5faf7;
  font-size: 12px;
}

.upload-selection strong {
  color: var(--green-dark);
}

.upload-selection ul {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.upload-selection li {
  max-width: 240px;
  overflow: hidden;
  padding: 5px 8px;
  border-radius: 6px;
  background: #ffffff;
  color: #526159;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-selection.has-error {
  border-color: #e1b0b0;
  background: #fff1f1;
}

.upload-selection.has-error strong {
  color: var(--danger);
}

.background-picker {
  min-width: 0;
  margin: 26px 0 0;
  padding: 0;
  border: 0;
}

.background-picker legend {
  margin-bottom: 10px;
}

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

.background-option {
  position: relative;
  cursor: pointer;
}

.background-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.background-option__card {
  display: block;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 10px;
  background: #f5f7f6;
  transition: 150ms ease;
}

.background-option__card img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-bottom: 1px solid var(--line);
  object-fit: cover;
  object-position: top center;
}

.background-option__card strong {
  display: block;
  padding: 12px;
  font-size: 13px;
  text-align: center;
}

.background-option:hover .background-option__card,
.background-option input:checked + .background-option__card {
  border-color: var(--green);
  background: #edf8f1;
  color: var(--green-dark);
}

.primary-button {
  display: inline-flex;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  margin-top: 25px;
  padding: 0 24px;
  border: 0;
  border-radius: 8px;
  background: var(--green);
  color: #ffffff;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.primary-button:hover,
.primary-button:focus-visible {
  background: var(--green-dark);
  outline: none;
}

.page-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
}

.page-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #ffffff;
}

.page-card__preview {
  display: block;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: #e8eeea;
}

.page-card__preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 180ms ease;
}

.page-card__preview:hover img {
  transform: scale(1.025);
}

.page-card__body {
  padding: 15px;
}

.background-badge {
  display: inline-flex;
  padding: 5px 8px;
  border-radius: 999px;
  background: #edf7f1;
  color: var(--green-dark);
  font-size: 10px;
  font-weight: 800;
}

.page-card h3 {
  min-height: 42px;
  margin: 10px 0 14px;
  font-size: 15px;
  line-height: 1.4;
}

.page-card__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.open-button,
.delete-button {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 800;
}

.open-button {
  display: inline-flex;
  align-items: center;
  background: #263a2e;
  color: #ffffff;
  text-decoration: none;
}

.delete-button {
  border: 1px solid #e2bcbc;
  background: #fff7f7;
  color: var(--danger);
  cursor: pointer;
}

.empty-state {
  margin: 0;
  padding: 38px 20px;
  border: 1px dashed #bbc9c0;
  border-radius: 10px;
  color: var(--muted);
  text-align: center;
}

.viewer-toolbar {
  position: sticky;
  z-index: 10;
  top: 0;
  border-top: 6px solid var(--green);
  border-bottom: 1px solid var(--line);
  background: rgb(255 255 255 / 95%);
  backdrop-filter: blur(10px);
}

.viewer-toolbar__inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  width: min(100% - 30px, 1400px);
  min-height: 66px;
  align-items: center;
  gap: 18px;
  margin: 0 auto;
}

.viewer-toolbar__inner > span {
  justify-self: end;
  color: var(--muted);
  font-size: 12px;
}

.back-button {
  justify-self: start;
  padding: 10px 14px;
  border-radius: 7px;
  background: var(--green);
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.reference-page {
  width: 100%;
  min-height: 100vh;
}

.reference-canvas {
  position: relative;
  width: min(100%, var(--canvas-width));
  margin: 0 auto;
  line-height: 0;
  background: #ffffff;
  box-shadow: 0 18px 50px rgb(0 0 0 / 8%);
}

.reference-image {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
}

.product-art-slot {
  position: absolute;
  z-index: 2;
  top: var(--slot-top);
  left: var(--slot-left);
  display: flex;
  width: var(--slot-width);
  height: var(--slot-height);
  align-items: center;
  justify-content: center;
  padding: 1.8%;
}

.selected-art-frame {
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.selected-art {
  display: block;
  max-width: 100%;
  max-height: 100%;
  border-radius: 7px;
  object-fit: contain;
  filter: drop-shadow(0 10px 22px rgb(0 0 0 / 15%));
  transition: transform 180ms ease;
}

.not-found {
  max-width: 680px;
  margin: 80px auto;
  padding: 45px;
  text-align: center;
}

@media (max-width: 820px) {
  .manager-shell {
    width: min(100% - 24px, 1380px);
    padding: 42px 0 60px;
  }

  .manager-hero {
    padding-right: 0;
  }

  .logout-form {
    position: static;
    margin-top: 18px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .background-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .viewer-toolbar__inner {
    grid-template-columns: auto 1fr;
    min-height: 60px;
  }

  .viewer-toolbar__inner strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .viewer-toolbar__inner > span {
    display: none;
  }

  .product-art-slot {
    padding: 1.2%;
  }
}

@media (max-width: 480px) {
  .background-grid,
  .page-list {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
