.referral-box {
  display: flex;
  flex-direction: column;
  gap: 16px;
  color: #1f2937;
}

/* HEADER */
.ref-header {
  display: flex;
  gap: 12px;
}

.ref-header > div {
  flex: 1;
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 14px;
  padding: 14px;
}

.label {
  font-size: 12px;
  opacity: 0.7;
}

.value {
  font-size: 18px;
  font-weight: bold;
}

/* REGRAS */
.ref-rules {
  background: linear-gradient(135deg, #6366f1, #7c3aed);
  color: white;
  padding: 14px;
  border-radius: 14px;
  font-size: 13px;
}

/* LINK */
.ref-link-box {
  display: flex;
  gap: 8px;
}

.ref-link input {
  flex: 1;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
}

.ref-link button {
  background: #22c55e;
  color: white;
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: bold;
}

/* LISTA */
.ref-item {
  display: flex;
  justify-content: space-between;
  background: rgba(99, 102, 241, 0.06);
  border: 1px solid rgba(99, 102, 241, 0.15);
  padding: 12px;
  border-radius: 12px;
}

.name {
  font-weight: 600;
}

.status {
  font-size: 12px;
  opacity: 0.7;
}

.gain {
  color: #16a34a;
  font-weight: bold;
}

.pending {
  font-size: 12px;
  opacity: 0.6;
}

/* SHOP */
.ref-shop {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.reward-btn {
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 14px;
  cursor: pointer;
  font-weight: bold;
  transition: 0.2s;
}

.reward-btn:hover {
  transform: scale(1.02);
  opacity: 0.95;
}

.reward-btn span {
  display: block;
  font-size: 12px;
  opacity: 0.85;
}

.gift-btn {
  background: linear-gradient(135deg, #a855f7, #7c3aed);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 14px;
  cursor: pointer;
  font-weight: bold;
}

/* FOOTER */
.ref-footer {
  font-size: 12px;
  text-align: center;
  opacity: 0.6;
}

/* ===== Referral modal v2 (mobile-first) ===== */
.referral-box.ref-v2 {
  gap: 14px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.ref-progress {
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid rgba(99, 102, 241, 0.18);
  border-radius: 14px;
  padding: 12px;
}

.ref-progress-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 8px;
}

.ref-progress-num {
  font-variant-numeric: tabular-nums;
  opacity: 0.85;
}

.ref-bar-wrap {
  height: 10px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.ref-bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #6366f1, #a855f7);
  transition: width 0.35s ease;
}

.ref-progress-hint {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.45;
  color: #475569;
}

.ref-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.ref-step {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 10px 8px;
  text-align: center;
}

.ref-step span {
  display: inline-flex;
  width: 26px;
  height: 26px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: linear-gradient(135deg, #6366f1, #7c3aed);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 6px;
}

.ref-step p {
  margin: 0;
  font-size: 11px;
  line-height: 1.35;
  color: #475569;
  font-weight: 600;
}

.ref-link-actions {
  margin-top: 8px;
}

.ref-share-btn {
  width: 100%;
  min-height: 44px;
  border: none;
  border-radius: 12px;
  font-weight: 800;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(135deg, #0ea5e9, #6366f1);
}

.ref-copy-btn {
  min-width: 96px;
  min-height: 44px;
}

.ref-divider {
  border: none;
  border-top: 1px solid rgba(148, 163, 184, 0.35);
  margin: 4px 0;
}

.ref-rules .title {
  font-weight: 800;
  margin-bottom: 6px;
}

/* ===== Referral modal refinement ===== */
.ref-quick-rules{
  background: rgba(99,102,241, 0.08);
  border: 1px solid rgba(99,102,241, 0.18);
  border-radius: 14px;
  padding: 12px;
  font-size: 12px;
  line-height: 1.4;
  color: #475569;
}

.ref-card{
  background: rgba(255,255,255, 0.75);
  border: 1px solid rgba(99,102,241, 0.18);
  border-radius: 14px;
  padding: 12px;
}

.ref-card-title{
  font-size: 12px;
  font-weight: 800;
  color: #334155;
  margin-bottom: 10px;
}

.ref-hint{
  margin-top: 8px;
  font-size: 12px;
  opacity: 0.7;
}

.ref-link-box{
  align-items: center;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.ref-link-box input{
  flex: 1;
  min-width: 0;
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
}

.ref-copy-btn{
  background: #22c55e;
  color: white;
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: bold;
}

/* Ajuste para layout "Copiar + Compartilhar" lado a lado */
.ref-link-actions{
  margin-top: 0;
  display: flex;
  gap: 8px;
  width: 100%;
}

.ref-link-actions .ref-copy-btn,
.ref-link-actions .ref-share-btn{
  width: auto !important;
  flex: 1;
}

.ref-more-btn{
  margin-top: 10px;
  width: 100%;
  border: 1px solid rgba(99,102,241, 0.22);
  background: rgba(99,102,241, 0.08);
  color: #4f46e5;
  font-weight: 800;
  padding: 12px;
  border-radius: 12px;
  cursor: pointer;
}

.ref-more{
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ref-item .left{
  min-width: 0;
}

.ref-item .name{
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ref-item .status{
  word-break: break-word;
}

.ref-details{
  background: rgba(255,255,255, 0.6);
  border: 1px solid rgba(99,102,241, 0.18);
  border-radius: 14px;
  padding: 12px;
}

.ref-details summary{
  cursor: pointer;
  font-weight: 900;
  color: #334155;
}

@media (max-width: 420px) {
  .ref-steps {
    grid-template-columns: 1fr;
  }

  .ref-header{
    flex-direction: column;
  }

  .ref-item{
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
  }

  .ref-link-actions{
    flex-direction: column;
  }
}