#auth-dialog {
  width: min(400px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 0;
  overflow: auto;
  color: var(--ink, #1e2528);
  background: var(--panel, #ffffff);
  border: 1px solid var(--line, #d8ded8);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(15, 28, 30, 0.22);
}

#auth-dialog::backdrop {
  background: rgba(20, 28, 30, 0.34);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
}

.auth-dialog-shell {
  position: relative;
  padding: 30px 32px 28px;
}

.auth-dialog-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  padding: 0;
  display: grid;
  place-items: center;
  color: #667174;
  background: transparent;
  border: 0;
  border-radius: 6px;
  font-size: 25px;
  line-height: 1;
  cursor: pointer;
}

.auth-dialog-close:hover,
.auth-dialog-close:focus-visible {
  color: #1e2528;
  background: #eef1ed;
  outline: none;
}

#auth-dialog h2 {
  margin: 0 42px 5px 0;
  font-size: 24px;
  line-height: 1.25;
  letter-spacing: 0;
}

.auth-dialog-sub {
  margin: 0 0 24px;
  color: #667174;
  font-size: 14px;
}

#auth-dialog label {
  display: block;
  margin: 14px 0 6px;
  color: #394548;
  font-size: 13px;
  font-weight: 650;
}

#auth-dialog input {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  color: #1e2528;
  background: #f6f7f3;
  border: 1px solid #cbd3cc;
  border-radius: 6px;
  font: inherit;
}

#auth-dialog input:focus {
  border-color: #116a62;
  outline: 3px solid rgba(17, 106, 98, 0.14);
}

#auth-dialog .password-field { position: relative; }
#auth-dialog .password-field input { padding-right: 44px; }

#auth-dialog .password-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: none;
  color: #5e6b6e;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: color 120ms ease, background 120ms ease;
}

#auth-dialog .password-toggle:hover {
  color: #116a62;
  background: rgba(17, 106, 98, 0.08);
}

#auth-dialog .password-toggle:focus-visible {
  outline: 2px solid #116a62;
  outline-offset: 1px;
}

#auth-dialog .password-toggle svg {
  width: 20px;
  height: 20px;
  pointer-events: none;
}

#auth-dialog .auth-primary {
  width: 100%;
  min-height: 43px;
  margin-top: 20px;
  color: #ffffff;
  background: #116a62;
  border: 1px solid #116a62;
  border-radius: 6px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

#auth-dialog .auth-primary:hover { background: #0b5650; }
#auth-dialog button:disabled { cursor: wait; opacity: 0.62; }

#auth-dialog .toggle {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px 16px;
  margin-top: 16px;
  text-align: center;
  font-size: 14px;
}

#auth-dialog .toggle a,
#auth-dialog .text-button {
  color: #116a62;
}

#auth-dialog .text-button {
  padding: 4px;
  background: transparent;
  border: 0;
  font: inherit;
  cursor: pointer;
  min-height: 44px;
}

#auth-dialog .otp-description,
#auth-dialog .notice,
#auth-dialog .msg {
  color: #667174;
  font-size: 13px;
  line-height: 1.6;
}

#auth-dialog .notice {
  margin-bottom: 16px;
  padding: 9px 11px;
  color: #80551f;
  background: #fff7e8;
  border: 1px solid #ead3a5;
  border-radius: 6px;
}

#auth-dialog .otp-inputs {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 7px;
}

#auth-dialog .otp-inputs input {
  min-width: 0;
  padding: 8px 0;
  text-align: center;
  font-size: 20px;
  font-weight: 700;
}

#auth-dialog .otp-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
}

#auth-dialog .msg {
  min-height: 22px;
  margin-top: 15px;
}

#auth-dialog .msg.error { color: #aa443d; }
#auth-dialog .msg.ok { color: #1f7a4f; }
#auth-dialog [hidden] { display: none !important; }

@media (max-width: 480px) {
  .auth-dialog-shell { padding: 28px 20px 24px; }
}
