/* Shared styling for affiliate application, affiliate portal, and admin pages */

.portal-body {
  min-height: 100vh;
  background: #12141a;
  background-image: none;
  display: flex;
  flex-direction: column;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.portal-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: rgba(0,0,0,.9);
  border-bottom: 1px solid var(--gold);
}

.portal-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #fff;
  font-weight: 700;
  font-size: 1.25rem;
}

.portal-brand img {
  width: 40px;
  height: 40px;
  border-radius: 9999px;
  border: 2px solid var(--gold);
  object-fit: cover;
}

.portal-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  color: #fff;
  font-size: 0.95rem;
}

.portal-nav a, .portal-nav button {
  color: #fff;
  background: transparent;
}

.portal-nav a:hover {
  color: var(--gold);
}

.portal-main {
  flex: 1;
  max-width: 64rem;
  width: 100%;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

.portal-main.wide {
  max-width: 80rem;
}

.portal-footer {
  text-align: center;
  color: #9ca3af;
  font-size: 0.8rem;
  padding: 1.5rem;
}

.portal-card {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 1rem;
  padding: 2rem;
  color: #fff;
  margin-bottom: 2rem;
}

.portal-card h1 {
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--gold);
  margin: 0 0 0.5rem;
}

.portal-card h2 {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--gold);
  margin: 0 0 1rem;
}

.portal-card p.lead {
  color: #d1d5db;
  margin: 0 0 1.5rem;
}

/* Forms */
.portal-form {
  display: grid;
  gap: 1.25rem;
}

.form-row {
  display: grid;
  gap: 0.4rem;
}

.form-row.two-col {
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

@media (max-width: 640px) {
  .form-row.two-col { grid-template-columns: 1fr; }
}

.portal-form label {
  font-weight: 600;
  font-size: 0.9rem;
  color: #e5e7eb;
}

.portal-form input[type="text"],
.portal-form input[type="email"],
.portal-form input[type="tel"],
.portal-form input[type="password"],
.portal-form select,
.portal-form textarea {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 0.6rem;
  border: 1px solid #374151;
  background: #fff;
  color: #000;
  font-size: 1rem;
  font-family: inherit;
  outline: none;
}

.portal-form textarea {
  resize: vertical;
}

.portal-form .checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.9rem;
  color: #d1d5db;
}

.portal-form .checkbox-row input {
  margin-top: 0.25rem;
}

.portal-btn {
  display: inline-block;
  background: var(--red);
  color: #fff;
  border: none;
  padding: 0.9rem 1.75rem;
  border-radius: 0.6rem;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  text-align: center;
}

.portal-btn:hover {
  background: var(--red-dark);
}

.portal-btn.secondary {
  background: transparent;
  border: 2px solid var(--gold);
  color: var(--gold);
}

.portal-btn.secondary:hover {
  background: var(--gold);
  color: #000;
}

.portal-btn.small {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
}

.portal-btn.danger {
  background: #7f1d1d;
}

/* Alerts */
.alert {
  border-radius: 0.6rem;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  font-weight: 600;
}

.alert.success {
  background: rgba(37, 211, 102, .15);
  color: #25D366;
  border: 1px solid #25D366;
}

.alert.error {
  background: rgba(225, 6, 0, .15);
  color: #ff6b6b;
  border: 1px solid var(--red);
}

.alert.info {
  background: rgba(255, 215, 0, .1);
  color: var(--gold);
  border: 1px solid var(--gold);
}

/* Tables */
.portal-table-wrap {
  overflow-x: auto;
}

table.portal-table {
  width: 100%;
  border-collapse: collapse;
  color: #fff;
  font-size: 0.9rem;
}

table.portal-table th,
table.portal-table td {
  text-align: left;
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid rgba(255,255,255,.1);
  white-space: nowrap;
}

table.portal-table th {
  color: var(--gold);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

table.portal-table tbody tr:hover {
  background: rgba(255,255,255,.04);
}

/* Status badges */
.badge {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.badge.pending { background: rgba(255,215,0,.15); color: var(--gold); }
.badge.approved, .badge.converted { background: rgba(37,211,102,.15); color: #25D366; }
.badge.declined, .badge.lost { background: rgba(225,6,0,.15); color: #ff6b6b; }
.badge.new { background: rgba(255,255,255,.15); color: #fff; }
.badge.contacted { background: rgba(59,130,246,.15); color: #60a5fa; }

/* Stat tiles */
.stat-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-bottom: 2rem;
}

.stat-tile {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 0.75rem;
  padding: 1.25rem;
  color: #fff;
}

.stat-tile .stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--gold);
}

.stat-tile .stat-label {
  font-size: 0.85rem;
  color: #9ca3af;
  margin-top: 0.25rem;
}

/* Referral link box */
.referral-box {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(255,255,255,.08);
  border: 1px dashed var(--gold);
  border-radius: 0.6rem;
  padding: 1rem 1.25rem;
  font-family: ui-monospace, monospace;
  color: #fff;
  flex-wrap: wrap;
}

.referral-box input {
  flex: 1;
  min-width: 200px;
  background: transparent;
  border: none;
  color: var(--gold);
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
}

.login-wrap {
  max-width: 26rem;
  margin: 3rem auto;
}

.terms-box {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 0.75rem;
  padding: 1.5rem;
  color: #d1d5db;
  font-size: 0.9rem;
  line-height: 1.7;
  max-height: 260px;
  overflow-y: auto;
  margin-bottom: 1.5rem;
}

.terms-box h3 {
  color: var(--gold);
  margin-top: 0;
}

.terms-box ul {
  padding-left: 1.25rem;
}

.muted {
  color: #9ca3af;
  font-size: 0.85rem;
}

.actions-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.filter-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.filter-tabs a {
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  background: rgba(255,255,255,.08);
  color: #d1d5db;
  font-size: 0.85rem;
  font-weight: 600;
}

.filter-tabs a.active {
  background: var(--gold);
  color: #000;
}

/* Multi-step wizard (affiliate application) */
.wizard-progress {
  margin: 1.5rem 0 2rem;
}

.wizard-progress-bar {
  height: 6px;
  border-radius: 9999px;
  background: rgba(255,255,255,.12);
  overflow: hidden;
}

.wizard-progress-fill {
  height: 100%;
  background: var(--gold);
  transition: width .3s ease;
  width: 20%;
}

.wizard-progress-label {
  margin: 0.6rem 0 0;
  color: var(--gold);
  font-weight: 600;
  font-size: 0.9rem;
}

.wizard-step {
  display: none;
  flex-direction: column;
  gap: 1.25rem;
}

.wizard-step.active {
  display: flex;
}

.wizard-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2rem;
}

.wizard-nav .portal-btn {
  flex: 0 0 auto;
}

.wizard-nav #wizardNext,
.wizard-nav #wizardSubmit {
  margin-left: auto;
}

.payment-options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.payment-option {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 0.6rem;
  padding: 0.85rem 1rem;
  cursor: pointer;
  font-size: 0.95rem;
  color: #fff;
}

.payment-option:has(input:checked),
.payment-option.is-checked {
  border-color: var(--gold);
  background: rgba(255,215,0,.08);
}

.eft-details {
  background: rgba(255,255,255,.04);
  border: 1px dashed var(--gold);
  border-radius: 0.75rem;
  padding: 1.25rem 1.5rem;
  margin-top: 1rem;
}

.eft-details h3 {
  margin-top: 0;
  color: var(--gold);
  font-size: 1.05rem;
}

.bank-detail-list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.4rem 1rem;
  margin: 0.75rem 0;
}

.bank-detail-list dt {
  color: #9ca3af;
  font-size: 0.85rem;
}

.bank-detail-list dd {
  margin: 0;
  color: #fff;
  font-weight: 600;
}

.review-summary {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.6rem 1.5rem;
  background: rgba(255,255,255,.04);
  border-radius: 0.75rem;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
}

.review-summary dt {
  color: #9ca3af;
  font-size: 0.85rem;
}

.review-summary dd {
  margin: 0;
  color: #fff;
  white-space: pre-wrap;
}

@media (max-width: 640px) {
  .bank-detail-list,
  .review-summary {
    grid-template-columns: 1fr;
  }
  .bank-detail-list dd,
  .review-summary dd {
    margin-bottom: 0.5rem;
  }
}
