/* Zealous Growth — Referral Partner Portal */

:root {
  --rp-bg: #faf9f6;
  --rp-white: #ffffff;
  --rp-text: #1a1a2e;
  --rp-text-dim: #71717a;
  --rp-text-muted: #a1a1aa;
  --rp-border: #e4e4e7;
  --rp-primary: #F15822;
  --rp-primary-hover: #d94d1a;
  --rp-success: #22c55e;
  --rp-danger: #ef4444;
  --rp-warning: #f59e0b;
  --rp-info: #3b82f6;
  --rp-radius: 10px;
  --rp-font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--rp-font);
  background: var(--rp-bg);
  color: var(--rp-text);
  line-height: 1.6;
  min-height: 100vh;
}

/* Login */
.rp-login {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.rp-login__card {
  background: var(--rp-white);
  border-radius: 16px;
  padding: 48px 40px;
  max-width: 440px;
  width: 100%;
  box-shadow: 0 4px 24px rgba(0,0,0,0.06);
  text-align: center;
}

/* Zealous Growth text wordmark */
.zg-logo {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1;
}
.zg-logo-word {
  font-family: 'Satoshi', system-ui, sans-serif;
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.1;
  display: block;
  color: var(--rp-text);
}
.zg-logo-dot { color: var(--rp-primary); }

.rp-login__logo {
  margin-bottom: 24px;
}
.rp-login__logo .zg-logo-word {
  font-size: 1.5rem;
}

.rp-login__card h1 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 8px;
}

.rp-login__card > p {
  color: var(--rp-text-dim);
  font-size: 14px;
  margin-bottom: 28px;
}

.rp-login__success {
  padding: 24px 0;
}

.rp-login__success h2 {
  font-size: 20px;
  margin: 16px 0 8px;
}

.rp-login__success p {
  color: var(--rp-text-dim);
  font-size: 14px;
}

.rp-login__footer {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--rp-border);
}

.rp-login__footer p {
  color: var(--rp-text-dim);
  font-size: 13px;
  margin-bottom: 8px;
}

.rp-login__footer a {
  color: var(--rp-primary);
  font-size: 13px;
  text-decoration: none;
}

.rp-login__footer a:hover { text-decoration: underline; }

/* Header */
.rp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: var(--rp-white);
  border-bottom: 1px solid var(--rp-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.zg-logo--inline {
  flex-direction: row;
  align-items: baseline;
  gap: 0.2em;
}
.rp-header__logo .zg-logo-word {
  font-size: 1rem;
}

.rp-header__right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.rp-header__greeting {
  font-size: 14px;
  color: var(--rp-text-dim);
}

/* Tabs */
.rp-tabs {
  display: flex;
  gap: 0;
  background: var(--rp-white);
  border-bottom: 1px solid var(--rp-border);
  padding: 0 24px;
  overflow-x: auto;
}

.rp-tab {
  background: none;
  border: none;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--rp-text-dim);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  font-family: var(--rp-font);
}

.rp-tab:hover { color: var(--rp-text); }
.rp-tab--active {
  color: var(--rp-primary);
  border-bottom-color: var(--rp-primary);
}

/* Main */
.rp-main {
  max-width: 800px;
  margin: 0 auto;
  padding: 24px;
}

.rp-section { animation: fadeIn 0.2s ease; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Stats */
.rp-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.rp-stat-card {
  background: var(--rp-white);
  border-radius: var(--rp-radius);
  padding: 20px;
  text-align: center;
  border: 1px solid var(--rp-border);
}

.rp-stat-card__label {
  display: block;
  font-size: 12px;
  color: var(--rp-text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.rp-stat-card__value {
  display: block;
  font-size: 28px;
  font-weight: 700;
  color: var(--rp-text);
}

.rp-stat-card__value--pending { color: var(--rp-warning); }
.rp-stat-card__value--paid { color: var(--rp-success); }

/* Cards */
.rp-card {
  background: var(--rp-white);
  border-radius: var(--rp-radius);
  border: 1px solid var(--rp-border);
  padding: 24px;
  margin-bottom: 16px;
}

.rp-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.rp-card__header h2 {
  font-size: 16px;
  font-weight: 600;
}

/* Referral link box */
.rp-link-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--rp-bg);
  border: 1px solid var(--rp-border);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 12px;
}

.rp-link-box code {
  flex: 1;
  font-size: 14px;
  color: var(--rp-primary);
  word-break: break-all;
}

/* Buttons */
.rp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--rp-font);
  cursor: pointer;
  border: none;
  transition: background 0.15s, opacity 0.15s;
}

.rp-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.rp-btn--primary {
  background: var(--rp-primary);
  color: white;
}

.rp-btn--primary:hover:not(:disabled) { background: var(--rp-primary-hover); }

.rp-btn--secondary {
  background: var(--rp-bg);
  color: var(--rp-text);
  border: 1px solid var(--rp-border);
}

.rp-btn--secondary:hover:not(:disabled) { background: #f0efeb; }

.rp-btn--sm { padding: 6px 14px; font-size: 13px; }

/* Forms */
.rp-form { text-align: left; }

.rp-field {
  margin-bottom: 16px;
}

.rp-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--rp-text);
}

.rp-optional {
  font-weight: 400;
  color: var(--rp-text-muted);
}

.rp-field input,
.rp-field select,
.rp-field textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--rp-border);
  border-radius: 8px;
  font-size: 14px;
  font-family: var(--rp-font);
  color: var(--rp-text);
  background: var(--rp-white);
  transition: border-color 0.15s;
}

.rp-field input:focus,
.rp-field select:focus,
.rp-field textarea:focus {
  outline: none;
  border-color: var(--rp-primary);
  box-shadow: 0 0 0 3px rgba(241, 88, 34, 0.1);
}

.rp-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.rp-input-prefix {
  display: flex;
  align-items: center;
  border: 1px solid var(--rp-border);
  border-radius: 8px;
  overflow: hidden;
}

.rp-input-prefix span {
  padding: 10px 12px;
  background: var(--rp-bg);
  color: var(--rp-text-dim);
  font-size: 13px;
  white-space: nowrap;
  border-right: 1px solid var(--rp-border);
}

.rp-input-prefix input {
  border: none;
  border-radius: 0;
}

.rp-input-prefix input:focus {
  box-shadow: none;
}

.rp-divider {
  border: none;
  border-top: 1px solid var(--rp-border);
  margin: 24px 0;
}

.rp-form h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 16px;
}

/* Referral list */
.rp-referral-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--rp-border);
}

.rp-referral-item:last-child { border-bottom: none; }

.rp-referral-item__info h3 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
}

.rp-referral-item__info p {
  font-size: 12px;
  color: var(--rp-text-dim);
}

/* Status badges */
.rp-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: capitalize;
}

.rp-badge--submitted { background: #f4f4f5; color: #71717a; }
.rp-badge--contacted { background: #dbeafe; color: #1d4ed8; }
.rp-badge--signed_up { background: #fef3c7; color: #92400e; }
.rp-badge--payout_owed { background: #ffedd5; color: #c2410c; }
.rp-badge--paid { background: #dcfce7; color: #166534; }

/* Payout list */
.rp-payout-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--rp-border);
}

.rp-payout-item:last-child { border-bottom: none; }

.rp-payout-item__amount {
  font-size: 18px;
  font-weight: 700;
  color: var(--rp-success);
}

.rp-payout-item__info {
  font-size: 13px;
  color: var(--rp-text-dim);
}

/* Text helpers */
.rp-text-dim { color: var(--rp-text-dim); font-size: 13px; }

.rp-empty {
  text-align: center;
  padding: 32px 16px;
  color: var(--rp-text-muted);
  font-size: 14px;
}

/* Footer */
.rp-footer {
  text-align: center;
  padding: 24px;
  color: var(--rp-text-muted);
  font-size: 12px;
}

.rp-footer a {
  color: var(--rp-text-muted);
  text-decoration: underline;
}

/* Toast */
.rp-toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rp-toast {
  background: var(--rp-text);
  color: white;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-family: var(--rp-font);
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  animation: slideIn 0.2s ease;
  max-width: 360px;
}

.rp-toast--success { background: #166534; }
.rp-toast--error { background: #991b1b; }

@keyframes slideIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Responsive */
@media (max-width: 640px) {
  .rp-stats {
    grid-template-columns: 1fr 1fr;
  }

  .rp-field-row {
    grid-template-columns: 1fr;
  }

  .rp-header {
    padding: 12px 16px;
  }

  .rp-header__greeting { display: none; }

  .rp-main { padding: 16px; }

  .rp-login__card { padding: 32px 24px; }

  .rp-stat-card__value { font-size: 22px; }
}
