.auth-open-button,
.auth-logout-button,
.auth-primary,
.auth-mode-button,
.auth-link,
.auth-close {
  font: inherit;
}

.auth-open-button {
  min-height: 38px;
  padding: 0 18px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 999px;
  color: #1e3a8a;
  background: #fff;
  font-weight: 700;
  cursor: pointer;
}

.auth-open-button:hover { background: #edf6f1; }
.auth-open-button:focus-visible,
.auth-logout-button:focus-visible,
.auth-primary:focus-visible,
.auth-mode-button:focus-visible,
.auth-link:focus-visible,
.auth-close:focus-visible,
.auth-input:focus-visible { outline: 3px solid rgba(7, 94, 69, 0.22); outline-offset: 2px; }

.auth-user { align-items: center; gap: 10px; font-size: 13px; }
.auth-user:not([hidden]) { display: flex; }
.auth-logout-button { border: 0; background: transparent; color: #bfdbfe; cursor: pointer; text-decoration: underline; }

.auth-dialog {
  width: min(440px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  margin: auto;
  border: 0;
  border-radius: 22px;
  background: transparent;
  color: #172033;
  overflow: visible;
}

.auth-dialog::backdrop { background: rgba(12, 31, 23, 0.55); backdrop-filter: blur(4px); }

.auth-dialog-card {
  position: relative;
  padding: 34px;
  border-radius: 22px;
  background: #fffdf8;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.28);
}

.auth-close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: #f1f5f9;
  color: #475569;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.auth-brand { display: flex; align-items: center; gap: 8px; margin: -8px 40px 17px 0; color: #075e45; }
.auth-brand img { width: 42px; height: 52px; object-fit: contain; }
.auth-brand span { display: flex; font-size: 20px; letter-spacing: -.6px; }
.auth-brand b:last-child { color: #d5a62e; }
.auth-eyebrow { margin-bottom: 8px; color: #075e45; font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.auth-dialog h2 { margin: 0; color: #172033; font-size: 27px; line-height: 1.2; }
.auth-description { margin: 12px 0 22px; color: #64748b; font-size: 14px; line-height: 1.55; }

.auth-mode { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-bottom: 20px; padding: 4px; border-radius: 12px; background: #f1f5f9; }
.auth-mode-button { min-height: 38px; border: 0; border-radius: 9px; background: transparent; color: #64748b; font-weight: 700; cursor: pointer; }
.auth-mode-button.active { background: #fff; color: #075e45; box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08); }

.auth-label { display: block; margin-bottom: 7px; color: #334155; font-size: 13px; font-weight: 700; }
.auth-input { width: 100%; height: 50px; padding: 0 14px; border: 1px solid #cbd5e1; border-radius: 12px; background: #fff; color: #172033; font-size: 17px; }
.auth-input + .auth-label { margin-top: 13px; }
.auth-input:focus { border-color: #075e45; }
.auth-code-input { text-align: center; font-size: 24px; font-weight: 800; letter-spacing: .34em; }

.auth-primary { width: 100%; min-height: 50px; margin-top: 14px; border: 0; border-radius: 12px; background: #075e45; color: #fff; font-weight: 800; cursor: pointer; }
.auth-primary:hover { background: #0b7456; }
.auth-primary:disabled { background: #94a3b8; cursor: wait; }

.auth-code-actions { display: flex; justify-content: space-between; gap: 16px; margin-top: 16px; }
.auth-link { padding: 0; border: 0; background: transparent; color: #2563eb; font-size: 13px; cursor: pointer; }
.auth-link:disabled { color: #94a3b8; cursor: default; }
.auth-forgot { display: block; margin: 14px auto 0; color: #075e45; }
.auth-channels { display: grid; gap: 7px; margin: 17px 0 12px; padding: 0; border: 0; }
.auth-channels legend { margin-bottom: 7px; color: #334155; font-size: 13px; font-weight: 700; }
.auth-channels label { display: flex; align-items: center; gap: 9px; padding: 10px 12px; border: 1px solid #d9dfda; border-radius: 12px; background: #fff; cursor: pointer; }
.auth-channels label:has(input:checked) { border-color: #d5a62e; box-shadow: 0 0 0 2px rgba(213,166,46,.12); }
.auth-channels .channel-disabled { border-color: #e5e7eb; background: #f5f6f5; color: #929995; cursor: not-allowed; opacity: .72; }
.auth-channels .channel-disabled input { cursor: not-allowed; }
.auth-channels span { display: flex; align-items: baseline; justify-content: space-between; width: 100%; }
.auth-channels small { color: #728079; }
.auth-consent { display: flex; align-items: flex-start; gap: 9px; color: #64748b; font-size: 11px; line-height: 1.4; }
.auth-consent input { margin-top: 2px; accent-color: #075e45; }

.auth-message { min-height: 21px; margin-top: 16px; color: #b91c1c; font-size: 13px; line-height: 1.45; }
.auth-message.success { color: #15803d; }
.seller-dialog-card { max-width: 560px; }
.seller-location-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.seller-location-grid label { min-width: 0; }
.auth-legal { margin-top: 12px; color: #94a3b8; font-size: 11px; line-height: 1.45; }

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

@media (max-width: 640px) {
  .portal-header { padding: 0 12px !important; }
  .portal-status { display: none; }
  .portal-logo { font-size: 16px !important; }
  .auth-dialog-card { padding: 30px 20px 24px; }
  .auth-dialog h2 { font-size: 23px; }
  .auth-user-phone { max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
  .seller-location-grid { grid-template-columns: 1fr; gap: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-dialog::backdrop { backdrop-filter: none; }
}
