/* Partner portal pages (login, dashboard, status, forms). Loaded after the theme. */
:root {
  --pp-brand: #003157;
  --pp-accent: #4169e1;
  --pp-ink: #1f2937;
  --pp-muted: #6b7280;
  --pp-line: #e5e7eb;
  --pp-bg: #f5f7fb;
  --pp-ok: #15803d;
  --pp-warn: #b45309;
  --pp-bad: #b91c1c;
}

.portal-page { background: var(--pp-bg); }

/* Title band: clears the transparent theme header */
.page-band { background: linear-gradient(120deg, var(--pp-brand), var(--pp-accent)); padding: 150px 0 40px; color: #fff; }
.page-band__title { color: #fff; font-size: 32px; margin: 0; }
.page-band__sub { color: #dbe4f5; margin: 8px 0 0; font-size: 16px; }
@media (max-width: 991px) { .page-band { padding: 40px 0 28px; } .page-band__title { font-size: 26px; } }

.portal-main { padding: 36px 0 64px; min-height: 50vh; }

/* Cards */
.pp-card { background: #fff; border: 1px solid var(--pp-line); border-radius: 12px; padding: 24px; margin-bottom: 24px; box-shadow: 0 1px 3px rgba(0,49,87,.05); }
.pp-card h2 { font-size: 20px; color: var(--pp-brand); margin: 0 0 12px; }
.pp-card--narrow { max-width: 460px; margin-left: auto; margin-right: auto; }
.pp-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-bottom: 24px; }
.pp-stat { background: #fff; border: 1px solid var(--pp-line); border-radius: 12px; padding: 20px; }
.pp-stat__label { color: var(--pp-muted); font-size: 13px; text-transform: uppercase; letter-spacing: .5px; }
.pp-stat__value { color: var(--pp-brand); font-size: 28px; font-weight: 700; margin-top: 6px; }
.pp-stat__hint { color: var(--pp-muted); font-size: 13px; margin-top: 4px; }

/* Forms */
.pp-field { margin-bottom: 18px; }
.pp-field label { display: block; font-weight: 600; color: var(--pp-ink); margin-bottom: 6px; font-size: 14px; }
.pp-field input, .pp-field select, .pp-field textarea { width: 100%; border: 1px solid #cbd5e1; border-radius: 8px; padding: 11px 14px; font-size: 15px; color: var(--pp-ink); background: #fff; }
.pp-field input:focus, .pp-field select:focus, .pp-field textarea:focus { outline: none; border-color: var(--pp-accent); box-shadow: 0 0 0 3px rgba(65,105,225,.18); }
.pp-hint { color: var(--pp-muted); font-size: 13px; margin-top: 4px; }
.pp-btn { display: inline-block; background: var(--pp-brand); color: #fff; border: 0; border-radius: 8px; padding: 12px 22px; font-weight: 600; font-size: 15px; cursor: pointer; text-decoration: none; }
.pp-btn:hover, .pp-btn:focus { background: var(--pp-accent); color: #fff; text-decoration: none; }
.pp-btn--block { display: block; width: 100%; text-align: center; }
.pp-btn--ghost { background: transparent; color: var(--pp-brand); border: 1px solid var(--pp-brand); }
.pp-btn--ghost:hover { background: var(--pp-brand); color: #fff; }
.pp-link { color: var(--pp-accent); }
.pp-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }

/* Alerts */
.pp-alert { border-radius: 8px; padding: 12px 16px; margin-bottom: 18px; font-size: 14px; border: 1px solid; }
.pp-alert--error { background: #fef2f2; border-color: #fecaca; color: var(--pp-bad); }
.pp-alert--ok { background: #f0fdf4; border-color: #bbf7d0; color: var(--pp-ok); }
.pp-alert--info { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }
.pp-alert--warn { background: #fffbeb; border-color: #fde68a; color: var(--pp-warn); }

/* Status tracker */
.pp-steps { display: flex; list-style: none; padding: 0; margin: 8px 0 24px; counter-reset: step; }
.pp-steps li { flex: 1; position: relative; text-align: center; color: var(--pp-muted); font-size: 14px; padding-top: 40px; }
.pp-steps li::before { counter-increment: step; content: counter(step); position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 30px; height: 30px; line-height: 30px; border-radius: 50%; background: #e5e7eb; color: var(--pp-muted); font-weight: 700; z-index: 1; }
.pp-steps li::after { content: ""; position: absolute; top: 14px; left: -50%; width: 100%; height: 3px; background: #e5e7eb; }
.pp-steps li:first-child::after { display: none; }
.pp-steps li.is-done { color: var(--pp-ink); }
.pp-steps li.is-done::before { background: var(--pp-ok); color: #fff; content: "\2713"; }
.pp-steps li.is-done::after, .pp-steps li.is-current::after { background: var(--pp-ok); }
.pp-steps li.is-current { color: var(--pp-brand); font-weight: 700; }
.pp-steps li.is-current::before { background: var(--pp-accent); color: #fff; }
.pp-steps li.is-stopped::before { background: var(--pp-bad); color: #fff; content: "!"; }

.pp-badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.pp-badge--ok { background: #dcfce7; color: var(--pp-ok); }
.pp-badge--warn { background: #fef3c7; color: var(--pp-warn); }
.pp-badge--bad { background: #fee2e2; color: var(--pp-bad); }
.pp-badge--info { background: #dbeafe; color: #1e40af; }

/* History / notification lists */
.pp-list { list-style: none; padding: 0; margin: 0; }
.pp-list li { padding: 14px 0; border-top: 1px solid var(--pp-line); }
.pp-list li:first-child { border-top: 0; }
.pp-list__title { font-weight: 600; color: var(--pp-ink); }
.pp-list__meta { color: var(--pp-muted); font-size: 13px; }
.pp-list li.is-unread .pp-list__title::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--pp-accent); margin-right: 8px; vertical-align: middle; }

/* Nav additions */
.nav-badge { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: #ef4444; color: #fff; font-size: 11px; line-height: 18px; text-align: center; margin-left: 4px; }

/* Long forms */
fieldset.pp-card { min-width: 0; }
fieldset.pp-card legend { font-size: 18px; font-weight: 700; color: var(--pp-brand); width: auto; padding: 0 6px; margin-bottom: 8px; }
.pp-field-error { color: var(--pp-bad); font-size: 13px; margin-top: 4px; }
.pp-field input[aria-invalid="true"], .pp-field select[aria-invalid="true"] { border-color: var(--pp-bad); }
.pp-field input[type="file"] { padding: 8px; }
.pp-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

/* Tables */
.pp-table-wrap { overflow-x: auto; }
.pp-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.pp-table th { text-align: left; color: var(--pp-muted); font-weight: 600; text-transform: uppercase; font-size: 12px; letter-spacing: .4px; padding: 10px 12px; border-bottom: 2px solid var(--pp-line); white-space: nowrap; }
.pp-table td { padding: 12px; border-bottom: 1px solid var(--pp-line); vertical-align: top; }
.pp-table tr:hover td { background: #f8fafc; }
.pp-filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 16px; }
.pp-filters .pp-field { margin-bottom: 0; min-width: 160px; }

/* Tree */
.pp-tree, .pp-tree ul { list-style: none; margin: 0; padding-left: 22px; }
.pp-tree { padding-left: 0; }
.pp-tree li { position: relative; padding: 6px 0 6px 18px; }
.pp-tree li::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; border-left: 2px solid var(--pp-line); }
.pp-tree li::after { content: ""; position: absolute; left: 0; top: 19px; width: 12px; border-top: 2px solid var(--pp-line); }
.pp-tree li:last-child::before { bottom: auto; height: 19px; }
.pp-tree__node { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pp-tree__type { color: var(--pp-muted); font-size: 13px; }
.pp-copy { width: 100%; margin-top: 8px; border: 1px dashed #cbd5e1; border-radius: 6px; padding: 8px 10px; font-size: 13px; color: var(--pp-ink); background: #f8fafc; }

/* Merchant onboarding: step indicator */
.pp-wizard { display: flex; list-style: none; padding: 0; margin: 0 0 24px; }
.pp-wizard__step { flex: 1; position: relative; font-size: 14px; color: var(--pp-muted); }
.pp-wizard__step, .pp-wizard__step a { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.pp-wizard__step a { color: inherit; text-decoration: none; }
.pp-wizard__step a:hover .pp-wizard__label { text-decoration: underline; }
/* Line from this step's circle to the next one: green once this step is done. */
.pp-wizard__step::after { content: ""; position: absolute; top: 15px; left: calc(50% + 22px); width: calc(100% - 44px); height: 3px; background: #e5e7eb; }
.pp-wizard__step:last-child::after { display: none; }
.pp-wizard__step--done::after { background: var(--pp-ok); }
.pp-wizard__num { width: 32px; height: 32px; line-height: 32px; border-radius: 50%; background: #e5e7eb; font-weight: 700; color: var(--pp-muted); position: relative; z-index: 1; }
.pp-wizard__step--done { color: var(--pp-ink); }
.pp-wizard__step--done .pp-wizard__num { background: var(--pp-ok); color: #fff; }
.pp-wizard__step--current { color: var(--pp-brand); font-weight: 700; }
.pp-wizard__step--current .pp-wizard__num { background: var(--pp-accent); color: #fff; }
@media (max-width: 640px) {
  .pp-wizard { margin-bottom: 40px; }
  .pp-wizard__label { display: none; }
  .pp-wizard__step--current .pp-wizard__label { display: block; position: absolute; top: 40px; white-space: nowrap; font-size: 13px; }
  .pp-wizard__step:first-child.pp-wizard__step--current .pp-wizard__label { left: 0; }
  .pp-wizard__step:last-child.pp-wizard__step--current .pp-wizard__label { right: 0; }
}
.pp-field__label { display: block; font-weight: 600; margin-bottom: 6px; }
.pp-check { display: inline-flex; align-items: center; gap: 8px; margin: 0 24px 0 0; font-weight: 400; cursor: pointer; }
.pp-check input[type="radio"], .pp-check input[type="checkbox"] { width: 18px; height: 18px; margin: 0; padding: 0; display: inline-block; flex: none; box-shadow: none; }
.pp-pay { max-width: 520px; margin: 0 auto; }
.pp-pay__total { font-size: 28px; font-weight: 800; color: var(--pp-brand); }

/* Terms and Privacy pages */
.pp-legal { max-width: 860px; margin: 0 auto; line-height: 1.7; }
.pp-legal h2 { font-size: 19px; margin: 24px 0 8px; color: var(--pp-brand); }
.pp-legal ul { padding-left: 20px; }
.pp-legal li { margin-bottom: 6px; }

