/*
 * Invite friends (_refer.php), in the style of the other account pages.
 * Scoped to .rzr*; the result dialog uses the shared popup theme.
 */
:root {
  --rzr-ink: #16212c;
  --rzr-muted: #5f6d7b;
  --rzr-line: #dfe6ee;
  --rzr-soft: #f6f9fc;
  --rzr-primary: #0091ff;
  --rzr-primary-dark: #0a7fe0;
  --rzr-navy: #03446a;
  --rzr-bad: #d92d20;
  --rzr-shadow: 0 1px 2px rgba(16, 33, 48, 0.04), 0 16px 36px -22px rgba(16, 33, 48, 0.28);
}

body.rzr-body { background: #f7f7f7; }
.rzr { color: var(--rzr-ink); }
.rzr h1, .rzr h2, .rzr p { margin: 0; text-align: left; }
.rzr-wrap { max-width: 1040px; margin: 0 auto; padding: 0 20px; }

/* ---------- Header ---------- */
.rzr-hero {
  padding: clamp(28px, 5vw, 44px) 0 24px;
  background:
    radial-gradient(ellipse 55% 110% at 10% 0%, rgba(0, 145, 255, 0.12), transparent 60%),
    linear-gradient(180deg, #eef6ff 0%, #f7f7f7 100%);
}

.rzr-eyebrow {
  margin-bottom: 6px !important;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--rzr-primary);
}

.rzr-hero h1 {
  font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.4rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--rzr-ink);
}

.rzr-lead { max-width: 640px; margin-top: 8px !important; line-height: 1.55; color: var(--rzr-muted); }

/* ---------- Layout ---------- */
.rzr-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(260px, 1fr);
  align-items: start;
  gap: 20px;
  padding-bottom: 64px;
}

.rzr-card {
  display: grid;
  gap: 18px;
  margin: 0;
  padding: clamp(20px, 3.5vw, 28px);
  border: 1px solid var(--rzr-line);
  border-radius: 20px;
  background: #fff;
  box-shadow: var(--rzr-shadow);
}

.rzr .rzr-card-title { font-size: 1.15rem; font-weight: 800; color: var(--rzr-ink); }

/* ---------- Fields ---------- */
.rzr-field { display: grid; gap: 6px; }

.rzr .rzr-label { display: block; margin: 0; font-size: 0.9rem; font-weight: 700; text-align: left; color: var(--rzr-ink); }
.rzr .rzr-field { text-align: left; }
.rzr-optional { font-weight: 500; color: var(--rzr-muted); }
.rzr .rzr-hint { font-size: 0.82rem; color: var(--rzr-muted); }
.rzr .rzr-error { font-size: 0.85rem; font-weight: 500; color: var(--rzr-bad); }
.rzr .rzr-count { text-align: right; }

.rzr-input { position: relative; }

.rzr-input > i {
  position: absolute;
  top: 50%;
  left: 16px;
  transform: translateY(-50%);
  font-size: 0.9rem;
  color: #8a97a5;
  pointer-events: none;
}

.rzr .rzr-input input,
.rzr textarea {
  width: 100%;
  margin: 0;
  border: 1px solid var(--rzr-line);
  border-radius: 14px;
  background: var(--rzr-soft);
  color: var(--rzr-ink);
  font: inherit;
  font-size: 1rem;
  box-shadow: none;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.rzr .rzr-input input { height: 50px; padding: 0 16px 0 44px; }
.rzr textarea { min-height: 72px; padding: 12px 16px; resize: vertical; line-height: 1.45; }

.rzr .rzr-input input:focus,
.rzr textarea:focus {
  border-color: var(--rzr-primary);
  background: #fff;
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 145, 255, 0.18);
}

.rzr-field.has-error .rzr-input input,
.rzr-field.has-error .rzr-tags { border-color: var(--rzr-bad); background: #fff8f7; }

.rzr-from {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  padding: 8px 14px;
  border: 1px solid var(--rzr-line);
  border-radius: 14px;
  background: var(--rzr-soft);
}

.rzr-from-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #e3f2ff;
  color: var(--rzr-primary);
  font-size: 0.85rem;
}

/* Recipient chips */
.rzr-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  padding: 8px 10px;
  border: 1px solid var(--rzr-line);
  border-radius: 14px;
  background: var(--rzr-soft);
  cursor: text;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.rzr-tags:focus-within { border-color: var(--rzr-primary); background: #fff; box-shadow: 0 0 0 3px rgba(0, 145, 255, 0.18); }

.rzr .rzr-chips { display: contents; margin: 0; padding: 0; list-style: none; }

.rzr-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  padding: 5px 6px 5px 11px;
  border: 1px solid #cfe6fb;
  border-radius: 999px;
  background: #fff;
  color: var(--rzr-navy);
  font-size: 0.88rem;
  font-weight: 600;
}

.rzr-chip > i { font-size: 0.78rem; color: var(--rzr-primary); }
.rzr-chip > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.rzr .rzr-chip button {
  display: grid;
  place-items: center;
  flex: none;
  width: 22px;
  height: 22px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #eef4fa;
  color: #6b7a89;
  font-size: 0.72rem;
  cursor: pointer;
}

.rzr .rzr-chip button:hover { background: #fde4e1; color: var(--rzr-bad); }
.rzr .rzr-chip button:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--rzr-primary); }

.rzr .rzr-tags input {
  flex: 1 1 180px;
  min-width: 140px;
  height: 34px;
  margin: 0;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: var(--rzr-ink);
  font-size: 0.98rem;
  box-shadow: none;
}

.rzr .rzr-tags input:focus { outline: none; box-shadow: none; }

.rzr-tags-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; }
.rzr-tags-tools { display: inline-flex; gap: 12px; }

.rzr .rzr-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: auto;
  height: auto;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--rzr-primary-dark);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.rzr .rzr-link:hover { text-decoration: underline; }
.rzr .rzr-link[hidden] { display: none; }

/* ---------- Actions ---------- */
.rzr-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }

.rzr .rzr-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: auto;
  height: auto;
  min-height: 48px;
  margin: 0;
  padding: 10px 22px;
  border: 1px solid var(--rzr-line);
  border-radius: 999px;
  background: #fff;
  color: var(--rzr-ink);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.rzr .rzr-btn:hover { border-color: #b8d9f5; color: var(--rzr-navy); transform: translateY(-1px); }
.rzr .rzr-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(0, 145, 255, 0.25); }

.rzr .rzr-btn-primary {
  border-color: var(--rzr-primary);
  background: var(--rzr-primary);
  color: #fff;
  box-shadow: 0 10px 22px rgba(0, 145, 255, 0.3);
}

.rzr .rzr-btn-primary:hover { border-color: var(--rzr-primary-dark); background: var(--rzr-primary-dark); color: #fff; }
.rzr .rzr-btn-primary:disabled { border-color: #b9c6d3; background: #b9c6d3; box-shadow: none; cursor: default; transform: none; }
.rzr .rzr-btn-primary.is-busy i { animation: rzr-fly 0.9s ease-in-out infinite; }
@keyframes rzr-fly { 50% { transform: translate(3px, -3px); opacity: 0.5; } }

.rzr .rzr-legal {
  padding-top: 14px;
  border-top: 1px solid var(--rzr-line);
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--rzr-muted);
}

.rzr-legal a { font-weight: 600; color: var(--rzr-primary-dark); }

/* ---------- How it works ---------- */
.rzr-how {
  position: relative;
  background:
    radial-gradient(ellipse 90% 60% at 100% 0%, rgba(0, 145, 255, 0.1), transparent 70%),
    #fff;
}

.rzr-how-art {
  display: block;
  width: calc(100% + 2 * clamp(20px, 3.5vw, 28px));
  max-width: none;
  height: auto;
  margin: calc(-1 * clamp(20px, 3.5vw, 28px)) calc(-1 * clamp(20px, 3.5vw, 28px)) 0;
  border-radius: 20px 20px 0 0;
  background: #fff;
}

.rzr-how-badge {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: linear-gradient(135deg, #36abff, #0077e6);
  color: #fff;
  font-size: 1.3rem;
  box-shadow: 0 12px 24px -10px rgba(0, 145, 255, 0.6);
}

.rzr .rzr-steps { display: grid; gap: 16px; margin: 0; padding: 0; list-style: none; counter-reset: rzr; }
.rzr-steps li { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 12px; align-items: start; }

.rzr-step-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #e3f2ff;
  color: var(--rzr-primary);
}

.rzr-steps strong { display: block; font-size: 0.97rem; color: var(--rzr-ink); }
.rzr-steps p { margin-top: 2px !important; font-size: 0.88rem; line-height: 1.45; color: var(--rzr-muted); }
.rzr .rzr-tags-line { font-size: 0.8rem; font-weight: 600; color: #8a97a5; }

/* ---------- Result dialog lists ---------- */
.rzr-result { margin-top: 12px; text-align: left; }
.rzr-result p { margin: 0 0 4px; text-align: left; }
.rzr-result ul { margin: 0; padding-left: 18px; color: var(--rzr-ink); }
.rzr-result.is-bad strong { color: var(--rzr-bad); }
.rzr-result.is-muted strong { color: var(--rzr-muted); }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .rzr-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 480px) {
  .rzr-wrap { padding: 0 14px; }
  .rzr-actions { flex-direction: column-reverse; }
  .rzr-actions .rzr-btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .rzr .rzr-btn { transition: none; }
  .rzr .rzr-btn-primary.is-busy i { animation: none; }
}
