/* ============================================================
   SaveOnPet — account UI: header control, sign-in modal,
   account menu. Relies on the per-page design tokens (:root).
   ============================================================ */

/* header account button */
.acct-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: none;
  border-radius: 99px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: background .18s, transform .18s;
}
.acct-btn:hover { background: var(--peach); }
.acct-btn svg { width: 21px; height: 21px; }
.acct-btn.is-signed-in { width: auto; height: auto; }

.acct-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 99px;
  background: var(--coral);
  color: #fff;
  font-family: 'Karla', sans-serif;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .02em;
  overflow: hidden;
  box-shadow: 0 0 0 2px var(--shell);
}
.acct-avatar.lg { width: 46px; height: 46px; font-size: 16px; }
.acct-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* overlay shared by modal */
.auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(40, 28, 22, .46);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
  z-index: 1400;
}
.auth-overlay.open { opacity: 1; pointer-events: auto; }

/* sign-in modal */
.auth-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  width: min(94vw, 410px);
  transform: translate(-50%, -46%) scale(.97);
  background: #fff;
  border-radius: 26px;
  padding: 38px 34px 30px;
  text-align: center;
  box-shadow: 0 30px 80px rgba(40, 28, 22, .3);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
  z-index: 1401;
}
.auth-modal.open {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}
.auth-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 99px;
  background: var(--shell);
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.auth-close:hover { background: var(--peach); }
.auth-close svg { width: 18px; height: 18px; }
.auth-paw { font-size: 40px; line-height: 1; margin-bottom: 6px; }
.auth-modal h3 {
  font-family: 'Fraunces', serif;
  font-size: 26px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 8px;
}
.auth-modal > p {
  color: var(--ink-soft);
  font-size: 14.5px;
  line-height: 1.5;
  max-width: 32ch;
  margin: 0 auto 22px;
}
.auth-gbtn {
  display: flex;
  justify-content: center;
  min-height: 44px;
}
.auth-state {
  margin-top: 14px;
  min-height: 20px;
  font-size: 13.5px;
  color: var(--ink-soft);
}
.auth-fine {
  font-size: 11.5px;
  color: var(--ink-soft);
  opacity: .8;
}
.auth-modal .auth-fine { margin-top: 18px; display: block; }

/* account menu (signed in) */
.acct-menu {
  position: absolute;
  width: 248px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 22px 54px rgba(40, 28, 22, .22);
  padding: 8px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity .16s, transform .16s;
  z-index: 1402;
}
.acct-menu.open { opacity: 1; pointer-events: auto; transform: translateY(0); }
.acct-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 12px 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 6px;
}
.acct-id { display: flex; flex-direction: column; min-width: 0; }
.acct-id b {
  font-family: 'Karla', sans-serif;
  font-size: 14.5px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.acct-id span {
  font-size: 12px;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.acct-link {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: none;
  background: transparent;
  border-radius: 12px;
  font-family: 'Karla', sans-serif;
  font-size: 14px;
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
}
.acct-link:hover { background: var(--shell); }
.acct-signout { color: var(--coral-deep); font-weight: 700; }

/* ---- email/password forms inside the modal ---- */
.auth-modal .auth-title {
  font-family: 'Fraunces', serif;
  font-size: 26px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 8px;
}
.auth-modal .auth-sub {
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.5;
  max-width: 34ch;
  margin: 0 auto 20px;
}
.auth-tabs {
  display: flex;
  gap: 4px;
  background: var(--shell);
  border-radius: 99px;
  padding: 4px;
  margin-bottom: 20px;
}
.auth-tab {
  flex: 1;
  border: none;
  background: transparent;
  cursor: pointer;
  font-family: 'Karla', sans-serif;
  font-weight: 700;
  font-size: 14px;
  color: var(--ink-soft);
  padding: 9px 12px;
  border-radius: 99px;
  transition: background .18s, color .18s;
}
.auth-tab.is-active { background: #fff; color: var(--ink); box-shadow: 0 2px 8px rgba(58,46,40,.10); }

.auth-form { text-align: left; display: flex; flex-direction: column; gap: 13px; }
.auth-field { display: flex; flex-direction: column; gap: 6px; }
.auth-field > span {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: .01em;
}
.auth-field input {
  width: 100%;
  border: 2px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 15px;
  font-family: 'Karla', sans-serif;
  color: var(--ink);
  transition: border-color .18s;
}
.auth-field input::placeholder { color: #C3B2A4; }
.auth-field input:focus { outline: none; border-color: var(--coral); }
.auth-submit {
  margin-top: 4px;
  border: none;
  cursor: pointer;
  background: var(--coral);
  color: #fff;
  font-family: 'Karla', sans-serif;
  font-weight: 700;
  font-size: 15px;
  border-radius: 99px;
  padding: 14px 18px;
  box-shadow: 0 8px 22px rgba(232,98,60,.30);
  transition: background .2s, transform .15s;
}
.auth-submit:hover { background: var(--coral-deep); }
.auth-submit:active { transform: scale(.98); }
.auth-submit:disabled { opacity: .7; cursor: default; box-shadow: none; }

.auth-modal .auth-state {
  margin: 4px 0 0;
  min-height: 0;
  font-size: 13px;
  text-align: center;
  color: var(--ink-soft);
}
.auth-modal .auth-state.is-error { color: var(--coral-deep); font-weight: 600; }

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 16px;
  color: var(--ink-soft);
  font-size: 12px;
  letter-spacing: .04em;
}
.auth-divider::before,
.auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.auth-gstate {
  margin-top: 12px;
  min-height: 0;
  font-size: 13px;
  color: var(--ink-soft);
}
