/* Affiliate Portal — shared CSS (login + app shell)
   Visual language matches the rest of Relialimo (dark slate, gold/amber accent). */

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  color: #1f2937;
}

/* ─── Login ──────────────────────────────────────── */
.aff-login-body {
  min-height: 100vh;
  background: radial-gradient(circle at 20% 0%, #1e3a8a 0%, #0f172a 60%, #020617 100%);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.aff-login-wrap { width: 100%; max-width: 440px; }
.aff-login-card {
  background: #ffffff; border-radius: 18px;
  padding: 32px 28px;
  box-shadow: 0 30px 60px -20px rgba(0,0,0,.5), 0 4px 8px rgba(0,0,0,.1);
}
.aff-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.aff-brand-bull { font-size: 36px; line-height: 1; }
.aff-brand-title { font-weight: 800; font-size: 20px; color: #0f172a; }
.aff-brand-sub { font-size: 12px; color: #64748b; text-transform: uppercase; letter-spacing: .12em; }
.aff-h1 { margin: 4px 0 4px; font-size: 24px; color: #0f172a; }
.aff-sub { margin: 0 0 18px; color: #64748b; font-size: 14px; }

.aff-form { display: flex; flex-direction: column; gap: 14px; }
.aff-label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: #334155; font-weight: 600; }
.aff-label input {
  border: 1px solid #cbd5e1; border-radius: 10px;
  padding: 11px 13px; font-size: 15px;
  transition: border .15s, box-shadow .15s;
}
.aff-label input:focus {
  outline: none; border-color: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245,158,11,.18);
}

.aff-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 10px;
  font-weight: 700; font-size: 15px;
  padding: 12px 16px; cursor: pointer;
  transition: filter .12s, transform .05s;
}
.aff-btn:hover { filter: brightness(1.05); }
.aff-btn:active { transform: translateY(1px); }
.aff-btn-primary {
  background: linear-gradient(180deg, #f59e0b 0%, #d97706 100%);
  color: #fff;
  box-shadow: 0 6px 14px -4px rgba(217,119,6,.45);
}
.aff-btn-ghost {
  background: transparent; color: #f8fafc; border: 1px solid rgba(255,255,255,.25);
}
.aff-btn[disabled] { opacity: .65; cursor: not-allowed; }
.aff-btn-sm {
  padding: 4px 10px; font-size: 12px; line-height: 1.2; border-radius: 6px;
}
.aff-spinner {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.4); border-top-color: #fff;
  animation: affspin 0.7s linear infinite;
}
@keyframes affspin { to { transform: rotate(360deg); } }

.aff-msg {
  border-radius: 8px; padding: 10px 12px; font-size: 13px;
  background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca;
}
.aff-msg.ok { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }

.aff-footer {
  margin-top: 18px; display: flex; gap: 8px; align-items: center;
  font-size: 13px; color: #64748b;
}
.aff-footer a { color: #2563eb; text-decoration: none; }
.aff-footer a:hover { text-decoration: underline; }
.aff-dot { color: #cbd5e1; }
.aff-legal { margin-top: 16px; text-align: center; color: #94a3b8; font-size: 12px; }

/* ─── App shell ──────────────────────────────────── */
.aff-app-body { background: #f1f5f9; min-height: 100vh; }
.aff-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 22px;
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
  color: #f8fafc;
  position: sticky; top: 0; z-index: 10;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.aff-header-brand { display: flex; align-items: center; gap: 10px; }
.aff-brand-title-sm { font-weight: 800; font-size: 15px; }
.aff-brand-sub-sm { font-size: 10px; color: #cbd5e1; text-transform: uppercase; letter-spacing: .1em; }
.aff-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.aff-nav a {
  padding: 7px 12px; border-radius: 8px;
  color: #cbd5e1; text-decoration: none; font-size: 14px; font-weight: 600;
}
.aff-nav a.active { background: rgba(245,158,11,.18); color: #fbbf24; }
.aff-nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.aff-header-right { display: flex; align-items: center; gap: 12px; }
.aff-whoami { font-size: 13px; color: #cbd5e1; }

.aff-main { padding: 22px; max-width: 1100px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
.aff-card {
  background: #fff; border-radius: 14px; padding: 22px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06), 0 8px 24px -16px rgba(0,0,0,.18);
}
.aff-card h2 { margin: 0 0 6px; font-size: 22px; color: #0f172a; }
.aff-card h3 { margin: 0 0 14px; font-size: 16px; color: #0f172a; }
.aff-muted { color: #64748b; font-size: 14px; margin: 0 0 16px; }

.aff-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.aff-stat {
  background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px;
  padding: 14px 16px;
}
.aff-stat-label { font-size: 12px; color: #64748b; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.aff-stat-value { margin-top: 4px; font-size: 22px; font-weight: 800; color: #0f172a; }

.aff-dl { display: grid; grid-template-columns: 130px 1fr; gap: 6px 16px; margin: 0; font-size: 14px; }
.aff-dl dt { color: #64748b; font-weight: 600; }
.aff-dl dd { margin: 0; color: #0f172a; }

@media (max-width: 720px) {
  .aff-header { flex-direction: column; gap: 8px; align-items: stretch; }
  .aff-header-right { justify-content: space-between; }
  .aff-nav { justify-content: center; }
}

/* ─── Phase 2: branding + trips ─────────────────── */
:root { --aff-primary: #f59e0b; }
.aff-brand-mark-img { width: 56px; height: 56px; display:flex; align-items:center; justify-content:center; overflow:hidden; border-radius:10px; background:#fff; }
.aff-brand-logo { max-width: 56px; max-height: 56px; object-fit: contain; }
.aff-powered {
  margin-top: 18px; padding-top: 14px;
  border-top: 1px solid #e5e7eb;
  text-align: center; font-size: 11px; letter-spacing: .12em;
  text-transform: uppercase; color: #64748b;
}
.aff-powered-bull { margin-right: 4px; }
.aff-powered strong { color: #0f172a; letter-spacing: .14em; }

.aff-scope-tabs { display: inline-flex; background: #f1f5f9; border-radius: 8px; padding: 3px; gap: 2px; }
.aff-scope-tab {
  background: transparent; border: none; padding: 6px 14px;
  font-size: 13px; font-weight: 600; color: #475569;
  border-radius: 6px; cursor: pointer;
}
.aff-scope-tab.active { background: #fff; color: #0f172a; box-shadow: 0 1px 2px rgba(0,0,0,.08); }

.aff-table-wrap { overflow-x: auto; margin-top: 12px; border: 1px solid #e5e7eb; border-radius: 10px; }
.aff-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.aff-table th, .aff-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #f1f5f9; vertical-align: top; }
.aff-table thead th { background: #f8fafc; color: #475569; font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.aff-table tbody tr:last-child td { border-bottom: none; }
.aff-table tbody tr:hover { background: #fafbfc; }
.aff-pill {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  background: #eef2ff; color: #3730a3; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em;
}

/* ─── Phase 3: settings ──────────────────────────── */
.aff-logo-row { display:flex; align-items:center; gap:18px; flex-wrap:wrap; }
.aff-logo-preview {
  width:120px; height:120px; border:1px dashed #cbd5e1; border-radius:14px;
  display:flex; align-items:center; justify-content:center; background:#fff; overflow:hidden;
}
.aff-logo-img { max-width:100%; max-height:100%; object-fit:contain; }
.aff-logo-placeholder { color:#94a3b8; font-size:12px; }
.aff-logo-actions { display:flex; flex-direction:column; gap:8px; }
.aff-logo-actions .aff-btn { cursor: pointer; }

.aff-files-list { display:flex; flex-direction:column; gap:8px; margin-top:8px; }
.aff-file-row {
  display:flex; align-items:center; gap:12px; padding:8px 10px;
  border:1px solid #e5e7eb; border-radius:10px; background:#fff;
}
.aff-file-thumb {
  width:44px; height:44px; border-radius:8px; background:#f1f5f9; flex-shrink:0;
  display:flex; align-items:center; justify-content:center; overflow:hidden; font-size:20px;
}
.aff-file-thumb img { max-width:100%; max-height:100%; object-fit:cover; }
.aff-file-meta { flex:1; min-width:0; }
.aff-file-name { font-size:13px; color:#0f172a; font-weight:600; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.aff-file-name .aff-pill { background:#16a34a; color:#fff; }
.aff-file-actions { display:flex; align-items:center; gap:8px; margin-top:4px; flex-wrap:wrap; }
.aff-file-link { font-size:12px; color:#2563eb; text-decoration:none; }
.aff-file-link:hover { text-decoration:underline; }
.aff-file-setlogo { padding:3px 10px; font-size:11px; }
.aff-file-del { padding:3px 10px; font-size:11px; }
