/* EasyFile referral access scheme */
.easyfile-referral-bar {
  position: relative;
  z-index: 900;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  width: min(100%, 80rem);
  margin: .75rem auto 0;
  border: 1px solid var(--easyfile-border, #e2e8f0);
  border-radius: 1rem;
  padding: .85rem 1rem;
  background: var(--easyfile-surface, #fff);
  color: var(--easyfile-text, #0f172a);
  box-shadow: 0 10px 28px rgba(15, 23, 42, .08);
}
.easyfile-referral-bar strong { font-weight: 900; }
.easyfile-referral-bar p { margin: 0; color: var(--easyfile-muted, #64748b); font-size: .875rem; }
.easyfile-referral-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.easyfile-referral-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  min-height: 2.5rem;
  border: 1px solid transparent;
  border-radius: .625rem;
  padding: .55rem .9rem;
  font: inherit;
  font-size: .875rem;
  font-weight: 800;
  cursor: pointer;
}
.easyfile-referral-button--primary { background: var(--easyfile-blue, #2563eb); color: #fff; }
.easyfile-referral-button--secondary { border-color: var(--easyfile-border, #e2e8f0); background: var(--easyfile-surface, #fff); color: var(--easyfile-text, #0f172a); }
.easyfile-referral-button:focus-visible { outline: none; box-shadow: var(--easyfile-focus, 0 0 0 4px rgba(37, 99, 235, .2)); }
.easyfile-referral-progress {
  width: min(20rem, 100%);
  height: .65rem;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
}
.easyfile-referral-progress > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2563eb, #38bdf8);
  transition: width .25s ease;
}
.easyfile-referral-overlay,
.easyfile-referral-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  overflow: auto;
  padding: 1rem;
  background: rgba(2, 6, 23, .78);
  backdrop-filter: blur(8px);
}
.easyfile-referral-panel {
  width: min(100%, 40rem);
  border: 1px solid rgba(148, 163, 184, .28);
  border-radius: 1.5rem;
  padding: clamp(1.25rem, 4vw, 2rem);
  background: #fff;
  color: #0f172a;
  box-shadow: 0 32px 90px rgba(2, 6, 23, .38);
}
.easyfile-referral-panel h2 { margin: 0; font-size: clamp(1.5rem, 4vw, 2rem); font-weight: 900; }
.easyfile-referral-panel p { color: #475569; line-height: 1.6; }
.easyfile-referral-field { margin-top: 1rem; }
.easyfile-referral-field label { display: block; margin-bottom: .4rem; font-size: .875rem; font-weight: 800; }
.easyfile-referral-field input {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: .75rem;
  padding: .8rem .9rem;
  font: inherit;
}
.easyfile-referral-share {
  display: flex;
  gap: .5rem;
  margin-top: 1rem;
}
.easyfile-referral-share input { flex: 1; min-width: 0; }
.easyfile-referral-message { min-height: 1.25rem; margin-top: .75rem; font-size: .875rem; font-weight: 700; color: #475569; }
.easyfile-referral-error { color: #b91c1c; }
.easyfile-referral-success { color: #166534; }
.easyfile-referral-hidden { display: none !important; }
.easyfile-referral-page-card {
  border: 1px solid var(--easyfile-border, #e2e8f0);
  border-radius: 1.25rem;
  padding: 1.25rem;
  background: var(--easyfile-surface, #fff);
  box-shadow: var(--easyfile-shadow, 0 12px 32px rgba(15, 23, 42, .08));
}
.easyfile-referral-share-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr));
  gap: .65rem;
}
.easyfile-referral-share-option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 3rem;
  border: 1px solid var(--easyfile-border, #e2e8f0);
  border-radius: .8rem;
  padding: .7rem .75rem;
  background: var(--easyfile-surface, #fff);
  color: var(--easyfile-text, #0f172a);
  font: inherit;
  font-size: .825rem;
  font-weight: 800;
  cursor: pointer;
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.easyfile-referral-share-option:hover {
  border-color: var(--easyfile-blue, #2563eb);
  box-shadow: 0 8px 22px rgba(37, 99, 235, .12);
  transform: translateY(-1px);
}
.easyfile-referral-share-option:focus-visible {
  outline: none;
  box-shadow: var(--easyfile-focus, 0 0 0 4px rgba(37, 99, 235, .2));
}
.easyfile-referral-share-option[hidden] { display: none; }
.easyfile-referral-invite {
  border-top: 1px solid var(--easyfile-border, #e2e8f0);
  padding-top: 1.25rem;
}
.easyfile-referral-invite-form {
  display: flex;
  gap: .65rem;
}
.easyfile-referral-invite-form input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--easyfile-border, #cbd5e1);
  border-radius: .75rem;
  padding: .78rem .9rem;
  background: var(--easyfile-surface, #fff);
  color: var(--easyfile-text, #0f172a);
  font: inherit;
}
.easyfile-referral-qr {
  display: grid;
  place-items: center;
  width: min(100%, 19rem);
  min-height: 19rem;
  margin: 1.25rem auto;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  padding: 1rem;
  background: #fff;
}
.easyfile-referral-qr canvas,
.easyfile-referral-qr img {
  width: 100% !important;
  height: auto !important;
  max-width: 16rem;
}
.easyfile-referral-code-input {
  text-align: center;
  letter-spacing: .35em;
  font-size: 1.25rem !important;
  font-weight: 900;
}
@media (max-width: 640px) {
  .easyfile-referral-bar { margin-inline: .75rem; width: auto; }
  .easyfile-referral-actions,
  .easyfile-referral-share { width: 100%; }
  .easyfile-referral-button { flex: 1 1 100%; }
  .easyfile-referral-share { flex-direction: column; }
  .easyfile-referral-share-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .easyfile-referral-invite-form { flex-direction: column; }
}
@media print {
  .easyfile-referral-bar,
  .easyfile-referral-overlay,
  .easyfile-referral-modal { display: none !important; }
}
@media (prefers-reduced-motion: reduce) {
  .easyfile-referral-progress > span { transition: none; }
}
