.auth-dialog {
  width: min(92vw, 520px);
  max-height: min(90vh, 760px);
  padding: 0;
  color: var(--ink, #17231e);
  background: transparent;
  border: 0;
  border-radius: 26px;
  overflow: visible;
}

.auth-dialog::backdrop {
  background: rgba(8, 29, 23, .66);
  backdrop-filter: blur(8px);
}

.auth-panel {
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
  padding: clamp(24px, 5vw, 40px);
  background: #fffdf8;
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 26px;
  box-shadow: 0 34px 90px rgba(4, 26, 20, .32);
}

.auth-panel::before {
  content: "논리ON";
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin-bottom: 16px;
  padding: 4px 10px;
  color: #0d5b45;
  background: #dff2e9;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 950;
  letter-spacing: .05em;
}

.auth-close,
#auth-close-button {
  position: absolute;
  top: 16px;
  right: 16px;
  display: grid;
  place-items: center;
  width: 42px;
  min-height: 42px;
  padding: 0;
  color: #53625c;
  background: #f1eee6;
  border: 0;
  border-radius: 50%;
  font-size: 1.2rem;
  font-weight: 900;
  transition: transform .2s ease, background .2s ease;
}

.auth-close:hover,
#auth-close-button:hover {
  transform: rotate(6deg);
  background: #e8e3d8;
}

.auth-panel h2 {
  margin: 0 48px 8px 0;
  font-size: clamp(1.55rem, 5vw, 2.15rem);
  line-height: 1.2;
  letter-spacing: -.05em;
}

.auth-panel > p {
  margin: 0 0 24px;
  color: #728079;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 0 0 22px;
  padding: 5px;
  background: #eeeae1;
  border-radius: 14px;
}

.auth-tab {
  min-height: 44px;
  color: #67746e;
  background: transparent;
  border: 0;
  border-radius: 10px;
  font-weight: 900;
  transition: color .2s ease, background .2s ease, box-shadow .2s ease;
}

.auth-tab.active,
.auth-tab[aria-selected="true"] {
  color: #0d5b45;
  background: #fff;
  box-shadow: 0 3px 12px rgba(30,51,43,.09);
}

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

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

.auth-field {
  display: grid;
  gap: 7px;
}

.auth-field label {
  color: #384b43;
  font-size: .88rem;
  font-weight: 850;
}

.auth-field input,
.auth-field select {
  width: 100%;
  min-height: 50px;
  padding: 11px 13px;
  color: #17231e;
  background: #fff;
  border: 1px solid #d9d2c4;
  border-radius: 12px;
  transition: border-color .2s ease, box-shadow .2s ease;
}

.auth-field input:focus,
.auth-field select:focus {
  outline: none;
  border-color: #15765a;
  box-shadow: 0 0 0 4px rgba(21,118,90,.12);
}

.auth-submit,
.auth-form button[type="submit"] {
  min-height: 54px;
  margin-top: 4px;
  color: #fff;
  background: #0d5b45;
  border: 0;
  border-radius: 13px;
  font-weight: 950;
  box-shadow: 0 10px 24px rgba(13,91,69,.19);
  transition: transform .2s ease, background .2s ease;
}

.auth-submit:hover,
.auth-form button[type="submit"]:hover {
  transform: translateY(-2px);
  background: #084a37;
}

.auth-message,
#auth-message {
  min-height: 24px;
  margin: 14px 0 0;
  color: #6b7872;
  font-size: .9rem;
  font-weight: 700;
}

.auth-message.error,
#auth-message.error { color: #b83232; }

.auth-message.success,
#auth-message.success { color: #0d7652; }

.user-menu {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-badge {
  max-width: 180px;
  overflow: hidden;
  color: rgba(255,255,255,.82);
  font-size: .86rem;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 540px) {
  .auth-dialog { width: calc(100vw - 20px); max-height: calc(100dvh - 20px); }
  .auth-panel { max-height: calc(100dvh - 20px); padding: 24px 18px; border-radius: 20px; }
  .auth-close, #auth-close-button { top: 12px; right: 12px; }
  .auth-panel h2 { margin-right: 42px; }
  .user-badge { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-panel, .auth-dialog { animation: none !important; }
}

.auth-eyebrow { display: inline-flex; margin-bottom: 14px; padding: 4px 10px; color: #0d5b45; background: #dff2e9; border-radius: 999px; font-size: .72rem; font-weight: 950; letter-spacing: .08em; }
.auth-panel::before { display: none; }
.auth-tabs button { min-height: 44px; color: #67746e; background: transparent; border: 0; border-radius: 10px; font-weight: 900; }
.auth-tabs button.active { color: #0d5b45; background: #fff; box-shadow: 0 3px 12px rgba(30,51,43,.09); }
.auth-view { display: grid; gap: 8px; }
.auth-view.hidden { display: none; }
.auth-view > p { margin: 0 0 8px; color: #728079; font-size: .88rem; }
.auth-view label { margin-top: 6px; color: #384b43; font-size: .86rem; font-weight: 850; }
.auth-view input { width: 100%; min-height: 50px; padding: 11px 13px; color: #17231e; background: #fff; border: 1px solid #d9d2c4; border-radius: 12px; }
.auth-view input:focus { outline: none; border-color: #15765a; box-shadow: 0 0 0 4px rgba(21,118,90,.12); }
.auth-status { min-height: 24px; margin: 14px 0 0; color: #6b7872; font-size: .86rem; font-weight: 750; }
.auth-signout { width: 100%; min-height: 46px; margin-top: 8px; color: #9e3838; background: #fff2f0; border: 1px solid #efc7c2; border-radius: 12px; font-weight: 900; }
.auth-signout.hidden { display: none; }
