.auth-modal[hidden] {
  display: none;
}

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

.auth-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(31, 45, 43, 0.56);
  backdrop-filter: blur(3px);
}

.auth-dialog {
  position: relative;
  width: min(440px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 28px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 22px 70px rgba(31, 45, 43, 0.24);
}

.auth-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.auth-dialog-head h2 {
  margin: 4px 0 0;
  font-size: 25px;
}

.auth-close {
  display: grid;
  place-items: center;
  width: 38px;
  min-height: 38px;
  padding: 0;
  color: var(--muted);
  background: var(--warm);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 20px;
  padding: 5px;
  background: var(--warm);
  border-radius: 999px;
}

.auth-tabs[hidden] {
  display: none;
}

.auth-tab {
  min-height: 40px;
  color: var(--muted);
  background: transparent;
  border-color: transparent;
  border-radius: 999px;
}

.auth-tab.active {
  color: #fff;
  background: var(--teal);
  border-color: var(--teal);
}

.auth-form {
  display: grid;
  gap: 13px;
}

.auth-form[hidden] {
  display: none;
}

.auth-form label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
}

.auth-form .auth-agreement {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.45;
}

.auth-agreement input {
  width: 18px;
  min-height: 18px;
  margin-top: 1px;
}

.auth-submit {
  width: 100%;
  margin-top: 4px;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.auth-kakao-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  min-height: 46px;
  color: #191919;
  background: #fee500;
  border: 1px solid #fee500;
  border-radius: 8px;
  font-weight: 700;
}

.auth-kakao-btn:hover {
  background: #f6dc00;
  border-color: #f6dc00;
}

.auth-kakao-symbol {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  color: #fee500;
  background: #191919;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.auth-link {
  min-height: auto;
  padding: 2px;
  color: var(--teal-dark);
  background: transparent;
  border: 0;
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.auth-message {
  min-height: 20px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.auth-message.error {
  color: #b74332;
}

.auth-message.success {
  color: var(--teal-dark);
}

.auth-session-note {
  margin: 0 0 14px;
  padding: 12px;
  color: var(--teal-dark);
  background: var(--warm);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.5;
}

.auth-logout-btn {
  margin-bottom: 8px;
}

body.auth-modal-open {
  overflow: hidden;
}

/* 마이페이지 계정·이용안내 내부 간격만 보정 */
#myAccount form.tool-panel,
#myAccount .danger-panel,
#myGuide .guide-grid > .tool-panel {
  display: grid;
  gap: 14px;
}

#myAccount form.tool-panel > .primary-btn,
#myGuide .guide-grid > .tool-panel > .primary-btn {
  margin-top: 4px;
}

#myGuide .guide-grid > .tool-panel > label + label {
  margin-top: 4px;
}

@media (max-width: 520px) {
  .auth-dialog {
    padding: 22px 18px;
  }
}
