﻿/* ============================================================
   REFERRAL WIZARD — COMPACT + FULLY RESPONSIVE
   ============================================================ */

/* ===== Overlay ===== */
.ref-overlay {
  position: fixed;
  inset: 0;
  background: rgba(13,17,23,.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 99997;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .3s ease, visibility .3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
}
.ref-overlay.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.ref-overlay:not(.open) {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}
.ref-overlay:not(.open) .ref-modal {
  opacity: 0 !important;
  transform: translateY(20px) scale(.96) !important;
}

/* ===== Modal ===== */
.ref-modal {
  width: 100%;
  max-width: 440px;
  max-height: 92vh;
  overflow-y: auto;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,.55);
  border: 1px solid rgba(201,169,97,.22);
  position: relative;
  margin: auto;
  transform: translateY(0) scale(1);
  transition: transform .35s cubic-bezier(0.34, 1.56, 0.64, 1);
  scrollbar-width: thin;
  scrollbar-color: #c9a961 transparent;
}
.ref-modal::-webkit-scrollbar { width: 4px; }
.ref-modal::-webkit-scrollbar-thumb { background: rgba(201,169,97,.4); border-radius: 4px; }
.ref-modal::-webkit-scrollbar-track { background: transparent; }
.ref-overlay.open .ref-modal {
  transform: translateY(0) scale(1);
}
.ref-modal::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, #c9a961, transparent);
  z-index: 3;
}

/* ===== Close ===== */
.ref-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.25);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: all .22s ease;
  z-index: 5;
}
.ref-close:hover { background: rgba(255,255,255,.3); transform: rotate(90deg); }

/* ===== Head (compact dark hero) ===== */
.ref-head {
  position: relative;
  padding: 22px 22px 18px;
  background: linear-gradient(135deg, #0d1117 0%, #1a2230 100%);
  color: #fff;
  text-align: center;
  overflow: hidden;
}
.ref-head::before {
  content: "";
  position: absolute;
  top: -60px; right: -60px;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(201,169,97,.2), transparent 65%);
  pointer-events: none;
}
.ref-head > * { position: relative; z-index: 2; }

/* Countdown badge */
.ref-auto-timer {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(201,169,97,.15);
  border: 1px solid rgba(201,169,97,.45);
  color: #e8d5a0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .4px;
  margin-bottom: 10px;
}
.ref-auto-timer i { font-size: 9px; color: #c9a961; }
.ref-auto-timer strong { color: #fff; font-weight: 800; min-width: 12px; text-align: center; }

.ref-head-icon {
  width: 42px;
  height: 42px;
  margin: 0 auto 10px;
  border-radius: 13px;
  background: linear-gradient(135deg, #c9a961, #b08f42);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 19px;
  box-shadow: 0 6px 16px rgba(201,169,97,.5);
}
.ref-head h3 {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 6px;
  line-height: 1.25;
  letter-spacing: -.01em;
}
.ref-head h3 em {
  font-style: italic;
  font-weight: 500;
  color: #e8d5a0;
}
.ref-head p {
  font-size: 12px;
  color: rgba(255,255,255,.72);
  margin: 0;
  line-height: 1.5;
  max-width: 300px;
  margin: 0 auto;
}

/* ===== Body ===== */
.ref-body {
  padding: 16px 20px 18px;
}

/* Section title */
.ref-section-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: #6b7280;
  margin-bottom: 8px;
}
.ref-section-title i { color: #c9a961; font-size: 10px; }

/* Code box */
.ref-code-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, #fdfbf6, #fff);
  border: 1.5px dashed rgba(201,169,97,.55);
  margin-bottom: 14px;
  position: relative;
  overflow: hidden;
}
.ref-code-box::before {
  content: "";
  position: absolute;
  top: -50%; left: -10%;
  width: 150px; height: 150px;
  background: radial-gradient(circle, rgba(201,169,97,.1), transparent 70%);
  pointer-events: none;
}
.ref-code-left {
  position: relative;
  z-index: 1;
  flex: 1;
  min-width: 0;
}
.ref-code-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: #6b7280;
  font-weight: 700;
  margin-bottom: 3px;
}
.ref-code-value {
  font-family: 'Courier New', monospace;
  font-size: 17px;
  font-weight: 900;
  color: #b08f42;
  letter-spacing: 2px;
  word-break: break-all;
  line-height: 1.1;
}
.ref-copy-btn {
  flex-shrink: 0;
  padding: 8px 14px;
  border-radius: 8px;
  background: linear-gradient(135deg, #c9a961, #b08f42);
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all .22s ease;
  box-shadow: 0 4px 12px rgba(201,169,97,.35);
}
.ref-copy-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(201,169,97,.5);
}
.ref-copy-btn.copied {
  background: linear-gradient(135deg, #10b981, #059669);
  box-shadow: 0 4px 12px rgba(16,185,129,.4);
}

/* Share buttons — icon row */
.ref-share-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.ref-share-btn {
  padding: 10px 6px;
  border-radius: 10px;
  border: 1.5px solid #e5e7eb;
  background: #fff;
  color: #1f2937;
  font-size: 11.5px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  text-decoration: none;
  transition: all .22s ease;
}
.ref-share-btn i { font-size: 13px; }
.ref-share-btn:hover {
  border-color: #c9a961;
  background: #fdfbf6;
  color: #b08f42;
  transform: translateY(-1px);
}
.ref-share-btn.wa { color: #25d366; }
.ref-share-btn.wa:hover { border-color: #25d366; background: rgba(37,211,102,.06); }
.ref-share-btn.fb { color: #1877f2; }
.ref-share-btn.fb:hover { border-color: #1877f2; background: rgba(24,119,242,.06); }
.ref-share-btn.tw { color: #000; }
.ref-share-btn.tw:hover { border-color: #000; background: rgba(0,0,0,.04); }

/* Compact stats */
.ref-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 12px 0;
  margin-bottom: 12px;
  border-top: 1px solid #f0f1f3;
  border-bottom: 1px solid #f0f1f3;
}
.ref-stat { text-align: center; }
.ref-stat strong {
  display: block;
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  font-weight: 700;
  color: #0d1117;
  line-height: 1;
  margin-bottom: 3px;
  letter-spacing: -.02em;
}
.ref-stat span {
  font-size: 9px;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: .8px;
  font-weight: 600;
}
.ref-stat.earnings strong { color: #b08f42; }

/* How it works — compact */
.ref-how {
  list-style: none;
  padding: 0;
  margin: 0;
}
.ref-how li {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  padding: 7px 0;
  font-size: 12px;
  line-height: 1.45;
  color: #374151;
  border-bottom: 1px solid #f6f7f9;
}
.ref-how li:last-child { border-bottom: none; }
.ref-how-num {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, #c9a961, #b08f42);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 8px rgba(201,169,97,.3);
}
.ref-how strong { color: #0d1117; font-weight: 700; }

/* Note */
.ref-note {
  margin-top: 12px;
  padding: 9px 12px;
  border-radius: 8px;
  background: #f6f7f9;
  font-size: 10.5px;
  color: #6b7280;
  line-height: 1.5;
  text-align: center;
}
.ref-note i { color: #c9a961; margin-right: 3px; }

/* ============================================================
   RESPONSIVE — All devices
   ============================================================ */

/* Small tablet / large phone */
@media (max-width: 640px) {
  .ref-modal { max-width: 100%; border-radius: 18px; }
  .ref-head { padding: 20px 18px 16px; }
  .ref-head h3 { font-size: 17px; }
  .ref-head p { font-size: 11.5px; }
  .ref-body { padding: 14px 16px 16px; }
  .ref-head-icon { width: 38px; height: 38px; font-size: 17px; }
  .ref-code-value { font-size: 16px; letter-spacing: 1.5px; }
}

/* Mobile (phones) */
@media (max-width: 480px) {
  .ref-overlay { padding: 10px; }
  .ref-modal { border-radius: 16px; max-height: 94vh; }
  .ref-head { padding: 18px 16px 14px; }
  .ref-head h3 { font-size: 16px; }
  .ref-head p { font-size: 11px; max-width: 260px; }
  .ref-head-icon { width: 36px; height: 36px; font-size: 16px; border-radius: 11px; }
  .ref-auto-timer { font-size: 9.5px; padding: 3px 9px; }
  .ref-body { padding: 12px 14px 14px; }
  .ref-code-box { padding: 10px 12px; gap: 8px; }
  .ref-code-value { font-size: 15px; letter-spacing: 1.2px; }
  .ref-copy-btn { padding: 7px 12px; font-size: 11px; }
  .ref-share-row { gap: 6px; }
  .ref-share-btn { padding: 9px 4px; font-size: 10.5px; gap: 4px; }
  .ref-share-btn i { font-size: 12px; }
  .ref-stat strong { font-size: 16px; }
  .ref-stat span { font-size: 8.5px; letter-spacing: .6px; }
  .ref-how li { font-size: 11.5px; padding: 6px 0; }
  .ref-how-num { width: 18px; height: 18px; font-size: 9px; }
  .ref-note { font-size: 10px; padding: 8px 10px; }
}

/* Very small phones */
@media (max-width: 360px) {
  .ref-head h3 { font-size: 15px; }
  .ref-head p { font-size: 10.5px; }
  .ref-code-value { font-size: 14px; letter-spacing: 1px; }
  .ref-share-btn span { display: none; }
  .ref-share-btn { padding: 10px 4px; }
  .ref-share-btn i { font-size: 14px; }
  .ref-stat strong { font-size: 15px; }
}

/* Short screens (landscape phone) */
@media (max-height: 640px) {
  .ref-overlay { padding: 8px; align-items: flex-start; }
  .ref-modal { max-height: 96vh; margin-top: 8px; }
  .ref-head { padding: 16px 18px 12px; }
  .ref-head-icon { width: 34px; height: 34px; font-size: 15px; margin-bottom: 8px; }
  .ref-head h3 { font-size: 16px; }
  .ref-body { padding: 12px 16px 14px; }
}

/* Large desktop */
@media (min-width: 1200px) {
  .ref-modal { max-width: 440px; }
}

/* Big screens */
@media (min-width: 1600px) {
  .ref-modal { max-width: 460px; }
}