.auth-body {
  --auth-ink: #1a2433;
  --auth-muted: #5d6b7c;
  --auth-navy: #1e3a5f;
  --auth-navy-deep: #152a45;
  --auth-line: rgba(30, 58, 95, 0.14);
  position: relative;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 32px 18px;
  overflow: hidden;
  font-family: "Noto Sans KR", sans-serif;
  color: var(--auth-ink);
  background: #e8eef4;
}

.auth-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.auth-bg__wash {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 90% 70% at 50% -15%, #ffffff 0%, transparent 58%),
    radial-gradient(ellipse 55% 45% at 100% 100%, rgba(30, 58, 95, 0.1) 0%, transparent 55%),
    radial-gradient(ellipse 45% 40% at 0% 85%, rgba(70, 110, 150, 0.12) 0%, transparent 50%),
    linear-gradient(180deg, #f3f6f9 0%, #e4ebf2 100%);
}

.auth-bg__grain {
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.45'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

.auth-shell {
  position: relative;
  z-index: 1;
  width: min(440px, 100%);
}

.auth-stage {
  padding: 36px 28px 30px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 20px 50px rgba(21, 42, 69, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: auth-rise 0.65s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes auth-rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-hero {
  text-align: center;
  margin-bottom: 28px;
}

.auth-hero__logo {
  display: block;
  width: min(300px, 82vw);
  height: auto;
  margin: 0 auto;
  object-fit: contain;
  animation: auth-logo-in 0.75s cubic-bezier(0.22, 1, 0.36, 1) 0.05s both;
}

@keyframes auth-logo-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-panel {
  animation: auth-rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.18s both;
}

.auth-panel .field {
  margin-bottom: 14px;
}

.auth-panel .field span {
  color: var(--auth-muted);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.auth-panel .field input {
  border: 1px solid var(--auth-line);
  border-radius: 12px;
  background: #fff;
  padding: 13px 14px;
}

.auth-panel .field input:focus {
  border-color: var(--auth-navy);
  box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.12);
  background: #fff;
}

.auth-submit {
  width: 100%;
  margin-top: 8px;
  padding: 14px 16px;
  border: 0;
  border-radius: 12px;
  background: var(--auth-navy);
  color: #fff;
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.auth-submit:hover {
  background: var(--auth-navy-deep);
  transform: translateY(-1px);
}

.auth-submit:active {
  transform: translateY(0);
}

.auth-hint {
  margin: 14px 0 0;
  text-align: center;
  font-size: 0.82rem;
  color: #64748b;
  line-height: 1.45;
}

.auth-hint code {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 0.9em;
  color: var(--auth-navy);
}

@media (max-width: 420px) {
  .auth-stage {
    padding: 28px 18px 22px;
    border-radius: 22px;
  }

  .auth-hero {
    margin-bottom: 22px;
  }
}

.auth-card,
.admin-toolbar,
.admin-table-wrap,
.admin-panel,
.modal__card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.admin-panel {
  margin-bottom: 16px;
  padding: 20px 18px;
}

.admin-panel h2 {
  margin: 0 0 8px;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.admin-panel__lead {
  margin: 0 0 14px;
  color: var(--text-muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

.admin-panel__row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.admin-panel__import {
  width: auto;
  margin-top: 4px;
}

.admin-panel__msg {
  margin-top: 10px;
}

.admin-toolbar__add {
  width: auto;
}

.auth-card {
  padding: 28px 24px;
}

.auth-card h1 {
  margin: 0 0 8px;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
}

.auth-lead {
  margin: 0 0 22px;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.field span {
  font-size: 0.82rem;
  font-weight: 600;
  color: #526074;
}

.field input,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fafbfd;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  font: inherit;
  resize: vertical;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(42, 95, 158, 0.12);
  background: #fff;
}

.primary-btn,
.ghost-btn {
  border: 0;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s var(--ease), opacity 0.2s ease, background 0.2s ease;
}

.primary-btn {
  width: 100%;
  padding: 13px 16px;
  background: var(--accent);
  color: #fff;
}

.primary-btn:hover {
  opacity: 0.93;
}

.primary-btn:active,
.ghost-btn:active {
  transform: scale(0.98);
}

.ghost-btn {
  padding: 10px 14px;
  background: #eef2f7;
  color: #334155;
}

.ghost-btn:hover {
  background: #e5ebf3;
}

.text-link {
  display: block;
  margin-top: 16px;
  text-align: center;
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 500;
}

.form-error {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 0.86rem;
}

.admin-app {
  max-width: 920px;
}

.admin-header-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 18px;
  margin-bottom: 14px;
}

.admin-toolbar h1 {
  margin: 0;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.admin-toolbar p {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.admin-toolbar .primary-btn {
  width: auto;
  white-space: nowrap;
}

.admin-table-wrap {
  overflow: auto;
  padding: 4px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

.admin-table th,
.admin-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.admin-table th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.78rem;
}

.admin-table tr:last-child td {
  border-bottom: 0;
}

.row-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.row-actions button {
  padding: 8px 10px;
  border: 0;
  border-radius: 9px;
  background: #eef2f7;
  color: #334155;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.row-actions .danger {
  background: #fee2e2;
  color: #b91c1c;
}

.modal[hidden] {
  display: none !important;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 16px;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(2px);
}

.modal__card {
  position: relative;
  z-index: 1;
  width: min(560px, 100%);
  padding: 22px 20px;
  max-height: min(90dvh, 720px);
  overflow: auto;
  animation: riseIn 0.28s var(--ease) both;
}

.modal__card h2 {
  margin: 0 0 16px;
  font-size: 1.15rem;
}

.modal__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 12px;
}

.field--full {
  grid-column: 1 / -1;
}

.modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}

.modal__actions .primary-btn {
  width: auto;
}

@media (max-width: 640px) {
  .admin-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

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

  .admin-header-actions {
    width: 100%;
    justify-content: flex-end;
  }
}
