.referna-auth-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
}
.referna-auth-overlay.open { display: flex; }
.referna-auth-overlay.standalone {
  position: static;
  display: flex;
  min-height: auto;
  padding: 0;
  overflow: visible;
  background: none;
  backdrop-filter: none;
}
.referna-auth-overlay.standalone .referna-auth-modal { max-width: 460px; }
.referna-auth-overlay [hidden] { display: none !important; }
.referna-auth-modal {
  width: 100%;
  max-width: 420px;
  margin: auto;
  padding: 30px 26px 26px;
  position: relative;
  background: var(--black-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-dropdown);
  color: var(--white);
  text-align: left;
}
.referna-auth-modal:focus { outline: none; }
.referna-auth-close {
  position: absolute;
  top: 14px;
  right: 16px;
  padding: 4px 6px;
  border: 0;
  background: none;
  color: var(--gray-mid);
  cursor: pointer;
  font: 24px/1 var(--font-display);
}
.referna-auth-close:hover { color: var(--white); }
.referna-auth-eyebrow {
  margin-bottom: 6px;
  color: var(--gold);
  font: 700 0.75rem var(--font-display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.referna-auth-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 18px;
  padding: 3px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.04);
}
.referna-auth-tab {
  flex: 1;
  padding: 8px 0;
  border: 0;
  border-radius: var(--radius-pill);
  background: none;
  color: var(--gray-mid);
  cursor: pointer;
  font: 600 0.8rem var(--font-display);
}
.referna-auth-tab.active { background: var(--gold); color: var(--black); }
.referna-auth-title {
  margin: 0 0 4px;
  padding-right: 24px;
  color: var(--white);
  font: 700 1.35rem var(--font-display);
}
.referna-auth-title:focus { outline: none; }
.referna-auth-sub {
  margin: 0 0 22px;
  color: var(--gray-dark);
  font: 0.85rem/1.5 var(--font-body);
}
.referna-auth-context {
  margin: -8px 0 18px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--gray-100);
  background: rgba(212, 165, 116, 0.08);
  font: 500 0.78rem/1.45 var(--font-display);
}
.referna-auth-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.referna-auth-provider {
  display: inline-flex;
  min-width: 230px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 16px;
  border: 1px solid var(--gray-dark);
  border-radius: var(--radius-lg);
  background: var(--black-mid);
  color: var(--gray-100);
  cursor: pointer;
  text-decoration: none;
  font: 500 14px var(--font-display);
}
.referna-auth-provider:hover { background: var(--black-soft); }
.referna-auth-provider[aria-disabled="true"] { cursor: default; opacity: 0.55; }
.referna-auth-provider svg { width: 20px; height: 20px; flex: 0 0 auto; }
.referna-auth-label { color: var(--gray-dark); font: 0.72rem var(--font-display); text-align: right; }
.referna-auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0;
  color: var(--gray-dark);
  font: 0.7rem var(--font-display);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.referna-auth-divider::before,
.referna-auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.referna-auth-email-toggle,
.referna-auth-primary,
.referna-auth-link {
  width: 100%;
  cursor: pointer;
  font-family: var(--font-display);
}
.referna-auth-email-toggle {
  padding: 11px 14px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  color: var(--white);
  font-size: 14px;
  text-align: left;
}
.referna-auth-email-toggle:hover { border-color: var(--gold); }
.referna-auth-form { margin-top: 14px; }
.referna-auth-input {
  width: 100%;
  margin-bottom: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-md);
  outline: 0;
  background: rgba(255, 255, 255, 0.04);
  color: var(--white);
  font: 14px var(--font-display);
}
.referna-auth-input:focus { border-color: var(--gold); }
.referna-auth-primary {
  padding: 11px 14px;
  border: 0;
  border-radius: var(--radius-md);
  background: var(--gold);
  color: var(--black);
  font-size: 14px;
  font-weight: 700;
}
.referna-auth-primary:disabled { cursor: default; opacity: 0.5; }
.referna-auth-link {
  padding: 10px 0 0;
  border: 0;
  background: none;
  color: var(--gray-dark);
  font-size: 0.78rem;
  text-decoration: underline;
}
.referna-auth-error { min-height: 1px; margin: 8px 0 0; color: var(--error); font: 0.75rem var(--font-display); }
.referna-auth-note { margin: 8px 0 0; color: var(--gray-dark); font: 0.75rem/1.45 var(--font-display); }
@media (max-width: 480px) {
  .referna-auth-modal { padding: 24px 18px 20px; }
  .referna-auth-option { align-items: stretch; flex-direction: column; gap: 4px; }
  .referna-auth-provider { width: 100%; }
  .referna-auth-label { text-align: left; }
}
