.ref-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 40px 16px 60px;
  max-width: 620px;
  margin: 0 auto;
}

.ref-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 20px;
  padding: 36px 40px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.ref-card__header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.ref-card__icon {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  background: rgba(49,107,226,0.12);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ref-card__title {
  font-size: 1.35rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
  margin-bottom: 5px;
}

.ref-card__sub {
  font-size: 0.875rem;
  color: rgba(255,255,255,0.55);
  line-height: 1.4;
}

/* How it works steps */
.ref-how {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: rgba(49,107,226,0.07);
  border-radius: 12px;
  padding: 18px 20px;
}

.ref-how__step {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.ref-how__num {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #316BE2;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}

.ref-how__text {
  font-size: 0.875rem;
  color: rgba(255,255,255,0.7);
  line-height: 1.45;
}

/* Form */
.ref-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ref-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.ref-label {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.6);
  font-weight: 500;
  letter-spacing: 0.01em;
}

.ref-optional {
  color: rgba(255,255,255,0.35);
  font-weight: 400;
}

.ref-input {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  padding: 11px 14px;
  color: #fff;
  font-size: 0.9rem;
  font-family: 'DM Mono', monospace, sans-serif;
  outline: none;
  transition: border-color 0.18s;
  width: 100%;
  box-sizing: border-box;
}

.ref-input:focus {
  border-color: rgba(49,107,226,0.6);
}

.ref-input--readonly {
  background: rgba(49,107,226,0.08);
  border-color: rgba(49,107,226,0.25);
  cursor: text;
  color: #a8c5ff;
}

.ref-error {
  min-height: 18px;
  font-size: 0.83rem;
  color: #ff6b6b;
}

.ref-btn {
  background: #316BE2;
  border: none;
  border-radius: 10px;
  padding: 13px 20px;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s, opacity 0.18s;
}

.ref-btn:hover:not(:disabled) {
  background: #2558c5;
}

.ref-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Result block */
.ref-result {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: rgba(49,107,226,0.07);
  border: 1px solid rgba(49,107,226,0.2);
  border-radius: 12px;
  padding: 18px;
}

.ref-result__label {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.55);
  font-weight: 500;
}

.ref-result__row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.ref-result__row .ref-input {
  flex: 1;
  min-width: 0;
}

.ref-copy-btn {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.ref-copy-btn:hover {
  background: rgba(255,255,255,0.15);
}

.ref-result__note {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.4);
  line-height: 1.4;
}

.ref-result--stats {
  margin-bottom: 0;
  border-color: rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.03);
}

/* ── Partner portal card ── */
.ref-card--login {
  margin-top: 0;
}

.ref-card__icon--alt {
  background: rgba(255,255,255,0.06);
}

.ref-btn--outline {
  background: transparent;
  border: 1px solid rgba(49,107,226,0.5);
  color: #7aabff;
}

.ref-btn--outline:hover:not(:disabled) {
  background: rgba(49,107,226,0.12);
  border-color: rgba(49,107,226,0.8);
  color: #fff;
}

/* ── Stats output ── */
.ref-stats {
  display: flex;
  flex-direction: column;
  gap: 14px;
  border-top: 1px solid rgba(255,255,255,0.07);
  padding-top: 20px;
}

.ref-stats__title {
  font-size: 0.9rem;
  font-weight: 600;
  color: rgba(255,255,255,0.7);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ref-stats__grid {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.ref-stats__tile {
  background: rgba(49,107,226,0.09);
  border: 1px solid rgba(49,107,226,0.18);
  border-radius: 10px;
  padding: 14px 18px;
  min-width: 130px;
  flex: 1;
}

.ref-stats__tile-val {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  font-family: 'DM Mono', monospace;
  margin-bottom: 4px;
}

.ref-stats__tile-lbl {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.45);
}

/* Sessions list */
.ref-stats__sessions-head,
.ref-stats__row {
  display: grid;
  grid-template-columns: 2fr 1fr 1.2fr 2fr;
  gap: 8px;
  font-size: 0.8rem;
  padding: 7px 4px;
}

.ref-stats__sessions-head {
  color: rgba(255,255,255,0.4);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  padding-bottom: 8px;
}

.ref-stats__row {
  color: rgba(255,255,255,0.8);
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.ref-stats__row-id {
  font-family: 'DM Mono', monospace;
  font-size: 0.78rem;
  color: rgba(255,255,255,0.6);
}

.ref-stats__row-earned {
  font-family: 'DM Mono', monospace;
  color: #7aabff;
}

.ref-status--pending  { color: #f0c040; }
.ref-status--mixing   { color: #5bc0eb; }
.ref-status--completed { color: #4caf50; }

.ref-stats__empty {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.35);
  text-align: center;
  padding: 16px 0;
}
