/* ============================================================
   Auth UI — account pill, auth dialog, OTP, dropdown
   ============================================================ */

/* Account pill — top-right fixed button */
.auth-pill {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 1200;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 16px;
  border: 1px solid var(--acg-accent, #D4AF37);
  background: transparent;
  color: var(--acg-accent, #D4AF37);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}
.auth-pill:hover {
  background: rgba(212, 175, 55, 0.1);
}
.auth-pill--signed-in {
  gap: 8px;
  padding: 4px 10px 4px 4px;
  border-color: var(--acg-border, #D4C4B0);
  color: var(--acg-text, #2D2926);
}
.auth-pill--signed-in:hover {
  border-color: var(--acg-accent, #D4AF37);
  background: rgba(212, 175, 55, 0.06);
}
.dark .auth-pill--signed-in {
  border-color: var(--acg-border, #3D3530);
  color: var(--acg-text, #D4C4B0);
}
.dark .auth-pill--signed-in:hover {
  border-color: var(--acg-accent, #D4AF37);
}

/* Avatar circle */
.auth-pill-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--acg-accent, #D4AF37);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

/* Tier badge */
.auth-pill-tier {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(212, 175, 55, 0.15);
  color: var(--acg-accent, #D4AF37);
}

/* Email text */
.auth-pill-email {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

/* Dropdown */
.auth-dropdown {
  position: fixed;
  z-index: 1201;
  min-width: 200px;
  background: var(--acg-input, #FAF8F6);
  border: 1px solid var(--acg-border, #D4C4B0);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  padding: 4px 0;
  color: var(--acg-text, #2D2926);
}
.dark .auth-dropdown {
  background: var(--acg-input, #12100E);
  border-color: var(--acg-border, #3D3530);
  color: var(--acg-text, #D4C4B0);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.auth-dropdown-email {
  padding: 8px 12px;
  font-size: 12px;
  color: var(--acg-text-muted, #6B5E52);
  word-break: break-all;
}
.dark .auth-dropdown-email {
  color: var(--acg-text-muted, #9A8A76);
}

.auth-dropdown-divider {
  height: 1px;
  background: var(--acg-border, #D4C4B0);
  margin: 4px 0;
}
.dark .auth-dropdown-divider {
  background: var(--acg-border, #3D3530);
}

.auth-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  border: none;
  background: transparent;
  color: inherit;
  font-size: 13px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
}
.auth-dropdown-item:hover {
  background: var(--acg-surface, #EDE6DF);
}
.dark .auth-dropdown-item:hover {
  background: var(--acg-surface, #2A2520);
}
.auth-dropdown-item--danger {
  color: #ef4444;
}

/* Auth dialog overlay */
.auth-dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 100001;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

/* Auth dialog content */
.auth-dialog-content {
  background: var(--acg-input, #FAF8F6);
  border: 1px solid var(--acg-border, #D4C4B0);
  border-radius: 16px;
  padding: 32px;
  max-width: 380px;
  width: 90vw;
  color: var(--acg-text, #2D2926);
  position: relative;
  text-align: center;
}
.auth-dialog-content.dark {
  background: var(--acg-input, #12100E);
  border-color: var(--acg-border, #3D3530);
  color: var(--acg-text, #D4C4B0);
}

/* Decorative ornament */
.auth-dialog-ornament {
  color: var(--acg-accent, #D4AF37);
  font-size: 20px;
  margin-bottom: 8px;
  letter-spacing: 8px;
}

.auth-dialog-content h2 {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 8px 0;
}

.auth-dialog-subtitle {
  font-size: 14px;
  color: var(--acg-text-muted, #6B5E52);
  margin: 0 0 24px 0;
}
.dark .auth-dialog-subtitle {
  color: var(--acg-text-muted, #9A8A76);
}

.auth-dialog-subtitle--success {
  color: #22c55e;
}

/* Close button */
.auth-dialog-close {
  position: absolute;
  top: 12px;
  right: 12px;
  border: none;
  background: transparent;
  color: var(--acg-text-muted, #6B5E52);
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}
.auth-dialog-close:hover {
  opacity: 0.7;
}

/* Email input */
.auth-dialog-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--acg-border, #D4C4B0);
  border-radius: 8px;
  background: var(--acg-surface, #EDE6DF);
  color: var(--acg-text, #2D2926);
  font-size: 14px;
  outline: none;
  margin-bottom: 16px;
  box-sizing: border-box;
  font-family: inherit;
}
.auth-dialog-input:focus {
  border-color: var(--acg-accent, #D4AF37);
}
.dark .auth-dialog-input {
  background: var(--acg-surface, #2A2520);
  border-color: var(--acg-border, #3D3530);
  color: var(--acg-text, #D4C4B0);
}

/* Gold submit button */
.auth-dialog-btn {
  width: 100%;
  padding: 10px 0;
  border: none;
  border-radius: 8px;
  background: var(--acg-accent, #D4AF37);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s ease;
  font-family: inherit;
}
.auth-dialog-btn:hover {
  opacity: 0.9;
}
.auth-dialog-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* OTP digit group */
.auth-otp-group {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 16px;
}

.auth-otp-input {
  width: 40px;
  height: 48px;
  text-align: center;
  font-size: 24px;
  font-family: 'SF Mono', 'Menlo', 'Monaco', 'Consolas', monospace;
  font-weight: 600;
  border: 1px solid var(--acg-border, #D4C4B0);
  border-radius: 8px;
  background: var(--acg-surface, #EDE6DF);
  color: var(--acg-text, #2D2926);
  outline: none;
  transition: border-color 0.15s ease;
}
.auth-otp-input:focus {
  border-color: var(--acg-accent, #D4AF37);
  box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.2);
}
.dark .auth-otp-input {
  background: var(--acg-surface, #2A2520);
  border-color: var(--acg-border, #3D3530);
  color: var(--acg-text, #D4C4B0);
}

/* Resend link */
.auth-resend-link {
  display: inline-block;
  margin-top: 12px;
  font-size: 13px;
  color: var(--acg-accent, #D4AF37);
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
}
.auth-resend-link:hover:not(:disabled) {
  text-decoration: underline;
}
.auth-resend-link:disabled {
  color: var(--acg-text-muted, #6B5E52);
  cursor: not-allowed;
  opacity: 0.6;
}

/* Error message */
.auth-error {
  color: #ef4444;
  font-size: 13px;
  margin-bottom: 12px;
}

/* Success flash */
.auth-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.auth-success-check {
  color: #22c55e;
  font-size: 48px;
  line-height: 1;
}
.auth-success-email {
  color: var(--acg-accent, #D4AF37);
  font-size: 14px;
  font-weight: 500;
}

/* Inline auth guard banner (inside store dialog) */
.auth-guard-banner {
  border: 1px solid var(--acg-accent, #D4AF37);
  background: rgba(212, 175, 55, 0.06);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  text-align: center;
}
.dark .auth-guard-banner {
  background: rgba(212, 175, 55, 0.08);
}

.auth-guard-banner-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--acg-accent, #D4AF37);
  margin-bottom: 12px;
}

.auth-guard-banner .auth-inline-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.auth-guard-banner .auth-inline-input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--acg-border, #D4C4B0);
  border-radius: 8px;
  background: var(--acg-surface, #EDE6DF);
  color: var(--acg-text, #2D2926);
  font-size: 13px;
  outline: none;
  font-family: inherit;
}
.auth-guard-banner .auth-inline-input:focus {
  border-color: var(--acg-accent, #D4AF37);
}
.dark .auth-guard-banner .auth-inline-input {
  background: var(--acg-surface, #2A2520);
  border-color: var(--acg-border, #3D3530);
  color: var(--acg-text, #D4C4B0);
}
.auth-guard-banner .auth-inline-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  background: var(--acg-accent, #D4AF37);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
}
.auth-guard-banner .auth-inline-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.auth-guard-banner .auth-otp-group {
  margin-bottom: 12px;
}
.auth-guard-banner .auth-otp-input {
  width: 36px;
  height: 42px;
  font-size: 20px;
}

.auth-guard-confirmed {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #22c55e;
  font-size: 13px;
  font-weight: 500;
  padding: 8px 0;
}

/* Sync spinner */
.auth-sync-indicator {
  display: inline-flex;
  animation: auth-spin 1s linear infinite;
}
@keyframes auth-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Subtle gold glow for sign-in button on first visit */
@keyframes auth-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0); }
  50% { box-shadow: 0 0 8px 2px rgba(212, 175, 55, 0.3); }
}
.auth-pill--glow {
  animation: auth-glow 2s ease-in-out 3;
}
