/**
 * CDS Campaigns — Public styles (v1.2.0)
 *
 * Rewritten to consume the core Career DNA System design tokens
 * (CSS variables injected by CDS_Public::inject_brand_css_vars())
 * so the Campaign Manager dashboard and the introducer-dashboard
 * Campaigns section look like a native part of the core plugin.
 */

/* ============================================================
 * Shared — pills + alerts
 * ============================================================ */

.cds-camp-pill {
    display: inline-block;
    padding: 3px 10px;
    border-radius: var(--cds-radius-pill);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.6;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--cds-surface-3);
    color: var(--cds-text-secondary);
}
.cds-camp-pill-active   { background: var(--cds-success-soft); color: var(--cds-success); }
.cds-camp-pill-paused   { background: rgba(255, 159, 10, 0.12); color: var(--cds-warning); }
.cds-camp-pill-archived { background: var(--cds-error-soft); color: var(--cds-error); }
.cds-camp-pill-closed   { background: var(--cds-text); color: var(--cds-surface); }

.cds-camp-alert {
    padding: 12px 16px;
    border-radius: var(--cds-radius);
    margin: 0 0 18px;
    font-size: 14px;
    line-height: 1.5;
    border: 1px solid transparent;
}
.cds-camp-msg-success {
    background: var(--cds-success-soft);
    color: var(--cds-success);
    border-color: rgba(48, 209, 88, 0.3);
}
.cds-camp-msg-error {
    background: var(--cds-error-soft);
    color: var(--cds-error);
    border-color: rgba(255, 59, 48, 0.3);
}
.cds-camp-msg-info {
    background: var(--cds-primary-soft);
    color: var(--cds-primary);
    border-color: var(--cds-primary-ring);
}

/* ============================================================
 * Manager Dashboard layout
 * ============================================================ */

.cds-camp-manager-main { padding: 0; }

.cds-camp-manager-content {
    padding: 32px;
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.cds-camp-mgr-section {
    background: var(--cds-surface);
    border: 1px solid var(--cds-border);
    border-radius: var(--cds-radius-lg);
    padding: 28px;
    box-shadow: var(--cds-shadow-sm);
    transition: box-shadow var(--cds-dur) var(--cds-ease);
}
.cds-camp-mgr-section + .cds-camp-mgr-section { margin-top: 0; }
.cds-camp-mgr-section:hover { box-shadow: var(--cds-shadow); }

.cds-camp-mgr-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.cds-camp-mgr-title {
    margin: 0 0 6px;
    font-size: 22px;
    font-weight: 700;
    color: var(--cds-text);
    letter-spacing: -0.024em;
    line-height: 1.15;
}

.cds-camp-mgr-subtitle {
    margin: 0;
    color: var(--cds-text-secondary);
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.cds-camp-mgr-section-title {
    margin: 0 0 16px;
    font-size: 18px;
    font-weight: 600;
    color: var(--cds-text);
    letter-spacing: -0.02em;
}

.cds-camp-mgr-empty {
    color: var(--cds-text-secondary);
    font-size: 14px;
    margin: 0;
}

.cds-camp-mgr-privacy-note {
    font-size: 12px;
    color: var(--cds-text-tertiary);
    margin: 12px 0 0;
}

/* ============================================================
 * KPI grid
 * ============================================================ */

.cds-camp-mgr-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 14px;
    margin-top: 4px;
}

.cds-camp-mgr-kpi {
    background: var(--cds-surface-2);
    border: 1px solid var(--cds-border);
    border-radius: var(--cds-radius);
    padding: 16px 14px;
    transition: border-color var(--cds-dur-fast) var(--cds-ease),
                box-shadow var(--cds-dur-fast) var(--cds-ease);
}
.cds-camp-mgr-kpi:hover {
    border-color: var(--cds-border-strong);
}

.cds-camp-mgr-kpi-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--cds-text-secondary);
    font-weight: 600;
    margin-bottom: 4px;
}

.cds-camp-mgr-kpi-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--cds-text);
    line-height: 1.2;
    letter-spacing: -0.022em;
}

.cds-camp-kpi-cleared { color: var(--cds-success); }
.cds-camp-kpi-pending { color: var(--cds-warning); }

.cds-camp-mgr-kpi-meta {
    font-size: 11px;
    color: var(--cds-text-tertiary);
    margin-top: 4px;
}

/* ============================================================
 * Redemption CTA
 * ============================================================ */

.cds-camp-redemption-cta {
    margin-top: 20px;
    background: var(--cds-success-soft);
    border: 1px solid rgba(48, 209, 88, 0.35);
    border-radius: var(--cds-radius);
    padding: 18px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
}

.cds-camp-redemption-cta strong {
    font-size: 15px;
    color: var(--cds-success);
    display: block;
    margin-bottom: 4px;
}

.cds-camp-redemption-cta p {
    margin: 0;
    font-size: 13px;
    color: var(--cds-success);
    opacity: 0.9;
}

/* ============================================================
 * Buttons — match core .cds-btn family
 * ============================================================ */

.cds-camp-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 22px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    border: none;
    border-radius: var(--cds-radius-pill);
    background: var(--cds-primary);
    color: #fff !important;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    letter-spacing: -0.005em;
    transition: transform var(--cds-dur-fast) var(--cds-ease),
                background-color var(--cds-dur-fast) var(--cds-ease),
                box-shadow var(--cds-dur) var(--cds-ease);
}
.cds-camp-btn-primary:hover {
    background: var(--cds-primary-hover);
    color: #fff !important;
}
.cds-camp-btn-primary:active {
    transform: scale(0.98);
    background: var(--cds-primary-pressed);
}
.cds-camp-btn-primary:focus-visible {
    outline: none;
    box-shadow: var(--cds-shadow-focus);
}
.cds-camp-btn-primary:disabled,
.cds-camp-btn-primary[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}

.cds-camp-btn-redeem { background: var(--cds-success); }
.cds-camp-btn-redeem:hover { background: #28b84e; }

.cds-camp-btn-danger { background: var(--cds-error); }
.cds-camp-btn-danger:hover { background: #d92e23; }

/* ============================================================
 * Threshold progress bar
 * ============================================================ */

.cds-camp-threshold-progress { margin-top: 20px; }

.cds-camp-threshold-progress p {
    margin: 0 0 8px;
    font-size: 13px;
    color: var(--cds-text-secondary);
}

.cds-camp-threshold-hint {
    margin: 6px 0 0 !important;
    font-size: 12px !important;
    color: var(--cds-text-tertiary) !important;
}

.cds-camp-progress-bar-outer {
    background: var(--cds-surface-3);
    border-radius: var(--cds-radius-pill);
    height: 8px;
    overflow: hidden;
}

.cds-camp-progress-bar-inner {
    background: linear-gradient(90deg, var(--cds-primary), var(--cds-success));
    height: 100%;
    border-radius: var(--cds-radius-pill);
    transition: width 0.4s ease;
    min-width: 4px;
}

/* ============================================================
 * Support note
 * ============================================================ */

.cds-camp-mgr-support-note {
    margin-top: 18px;
    font-size: 12px;
    color: var(--cds-text-tertiary);
    padding-top: 14px;
    border-top: 1px solid var(--cds-border);
}
.cds-camp-mgr-support-note a { color: var(--cds-primary); }
.cds-camp-mgr-support-note a:hover { color: var(--cds-primary-hover); }

/* ============================================================
 * Table
 * ============================================================ */

.cds-camp-mgr-table-wrap {
    overflow-x: auto;
    border-radius: var(--cds-radius);
    border: 1px solid var(--cds-border);
}

.cds-camp-mgr-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.cds-camp-mgr-table th {
    text-align: left;
    padding: 10px 14px;
    font-size: 11px;
    font-weight: 600;
    color: var(--cds-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--cds-border);
    background: var(--cds-surface-2);
}

.cds-camp-mgr-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--cds-border);
    color: var(--cds-text);
    vertical-align: middle;
}

.cds-camp-mgr-table tbody tr:last-child td { border-bottom: none; }

.cds-camp-mgr-table tbody tr:hover td { background: var(--cds-surface-2); }

.cds-camp-mgr-table .cds-camp-mgr-num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.cds-camp-mgr-intro-name { font-weight: 500; color: var(--cds-text); }

.cds-camp-mgr-reason {
    cursor: help;
    color: var(--cds-text-tertiary);
    margin-left: 4px;
}

.cds-camp-mgr-table code {
    background: var(--cds-surface-3);
    padding: 2px 8px;
    border-radius: var(--cds-radius-xs);
    font-size: 12px;
    font-family: ui-monospace, 'SF Mono', Menlo, monospace;
    color: var(--cds-text);
}

/* ============================================================
 * Bank details grid
 * ============================================================ */

.cds-camp-mgr-bank-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid var(--cds-border);
    border-radius: var(--cds-radius);
    overflow: hidden;
}

.cds-camp-mgr-bank-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--cds-border);
    gap: 16px;
    background: var(--cds-surface);
}

.cds-camp-mgr-bank-row:last-child { border-bottom: none; }

.cds-camp-mgr-bank-label {
    font-size: 13px;
    color: var(--cds-text-secondary);
    min-width: 130px;
    font-weight: 500;
}

.cds-camp-mgr-bank-value {
    font-size: 14px;
    font-weight: 500;
    color: var(--cds-text);
    text-align: right;
}

.cds-camp-masked {
    font-family: ui-monospace, SFMono-Regular, monospace;
    letter-spacing: 2px;
}

/* ============================================================
 * Password change form — matches core auth pages
 * ============================================================ */

.cds-camp-pw-wrap {
    display: flex;
    justify-content: center;
    padding: 40px 16px;
    background: var(--cds-surface-3);
    min-height: 100vh;
}

.cds-camp-pw-card {
    background: var(--cds-surface);
    border: 1px solid var(--cds-border);
    border-radius: var(--cds-radius-lg);
    padding: 40px 32px;
    width: 100%;
    max-width: 440px;
    box-shadow: var(--cds-shadow);
}

.cds-camp-pw-card h2 {
    margin: 0 0 12px;
    font-size: 24px;
    font-weight: 700;
    color: var(--cds-text);
    letter-spacing: -0.024em;
}

.cds-camp-pw-desc {
    color: var(--cds-text-secondary);
    font-size: 14px;
    margin: 0 0 24px;
    line-height: 1.55;
}

.cds-camp-pw-form { display: flex; flex-direction: column; gap: 16px; }

.cds-camp-pw-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--cds-text);
    margin-bottom: 6px;
    letter-spacing: -0.005em;
}

.cds-camp-pw-field input[type="password"] {
    width: 100%;
    box-sizing: border-box;
    padding: 13px 16px;
    min-height: 46px;
    border: 1px solid var(--cds-border);
    border-radius: var(--cds-radius);
    font-size: 15px;
    font-family: inherit;
    color: var(--cds-text);
    background: var(--cds-surface);
    outline: none;
    transition: border-color var(--cds-dur-fast) var(--cds-ease),
                box-shadow var(--cds-dur-fast) var(--cds-ease);
}

.cds-camp-pw-field input[type="password"]:hover {
    border-color: var(--cds-border-strong);
}

.cds-camp-pw-field input[type="password"]:focus {
    border-color: var(--cds-primary);
    box-shadow: var(--cds-shadow-focus);
}

.cds-camp-pw-card .cds-camp-btn-primary {
    margin-top: 8px;
    width: 100%;
    text-align: center;
    padding: 14px;
    font-size: 15px;
}

.cds-camp-pw-support {
    margin: 18px 0 0;
    text-align: center;
    font-size: 13px;
    color: var(--cds-text-secondary);
}

/* ============================================================
 * Campaign switcher
 * ============================================================ */

.cds-camp-switcher {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    font-size: 14px;
    color: var(--cds-text);
    background: var(--cds-surface);
    border: 1px solid var(--cds-border);
    border-radius: var(--cds-radius);
    padding: 14px 18px;
    box-shadow: var(--cds-shadow-xs);
}

.cds-camp-switcher label {
    font-weight: 600;
    color: var(--cds-text-secondary);
    font-size: 13px;
}

.cds-camp-switcher select {
    border: 1px solid var(--cds-border);
    border-radius: var(--cds-radius-sm);
    padding: 8px 36px 8px 12px;
    font-size: 14px;
    background: var(--cds-surface);
    color: var(--cds-text);
    cursor: pointer;
    font-family: inherit;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236E6E73' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 14px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.cds-camp-switcher select:focus {
    outline: none;
    border-color: var(--cds-primary);
    box-shadow: var(--cds-shadow-focus);
}

/* ============================================================
 * Introducer-dashboard "Campaigns" section (injected card)
 * ============================================================ */

.cds-camp-intro-section {
    background: var(--cds-surface);
    border: 1px solid var(--cds-border);
    border-radius: var(--cds-radius-lg);
    padding: 28px;
    box-shadow: var(--cds-shadow-sm);
}

.cds-camp-intro-section h2 {
    margin: 0 0 8px;
    font-size: 22px;
    font-weight: 700;
    color: var(--cds-text);
    letter-spacing: -0.024em;
}

.cds-camp-intro-section h3 {
    margin: 24px 0 12px;
    font-size: 16px;
    font-weight: 600;
    color: var(--cds-text);
    letter-spacing: -0.02em;
}

.cds-camp-intro-section .description {
    color: var(--cds-text-secondary);
    font-size: 14px;
    line-height: 1.55;
    margin: 0 0 16px;
}

/* ============================================================
 * Membership / open-campaign cards (injected section)
 * ============================================================ */

.cds-camp-membership-grid,
.cds-camp-open-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 12px;
}

.cds-camp-membership-card,
.cds-camp-open-card {
    background: var(--cds-surface);
    border: 1px solid var(--cds-border);
    border-radius: var(--cds-radius);
    padding: 18px;
    transition: border-color var(--cds-dur-fast) var(--cds-ease),
                box-shadow var(--cds-dur-fast) var(--cds-ease),
                transform var(--cds-dur-fast) var(--cds-ease);
}
.cds-camp-membership-card:hover,
.cds-camp-open-card:hover {
    border-color: var(--cds-border-strong);
    box-shadow: var(--cds-shadow-sm);
    transform: translateY(-1px);
}

.cds-camp-membership-card.cds-camp-suspended {
    opacity: 0.7;
    background: var(--cds-surface-2);
}

.cds-camp-membership-header,
.cds-camp-open-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 10px;
}

.cds-camp-membership-header h4,
.cds-camp-open-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--cds-text);
    line-height: 1.3;
}

.cds-camp-membership-meta,
.cds-camp-open-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    font-size: 12px;
    color: var(--cds-text-secondary);
    margin: 8px 0 12px;
}

.cds-camp-membership-meta strong,
.cds-camp-open-meta strong {
    color: var(--cds-text);
    font-weight: 600;
}

.cds-camp-coupon-row {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--cds-surface-3);
    border-radius: var(--cds-radius-sm);
    padding: 8px 10px;
    margin-top: 10px;
}

.cds-camp-coupon-row code {
    flex: 1;
    background: transparent;
    padding: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--cds-text);
    font-family: ui-monospace, 'SF Mono', Menlo, monospace;
    letter-spacing: 0.5px;
}

.cds-camp-copy-btn {
    background: var(--cds-primary-soft);
    color: var(--cds-primary);
    border: none;
    border-radius: var(--cds-radius-sm);
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--cds-dur-fast) var(--cds-ease);
    font-family: inherit;
}
.cds-camp-copy-btn:hover {
    background: var(--cds-primary-ring);
}

/* Inline status pills (introducer side uses different prefix) */
.cds-intro-pill {
    display: inline-block;
    padding: 2px 10px;
    border-radius: var(--cds-radius-pill);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--cds-surface-3);
    color: var(--cds-text-secondary);
}
.cds-intro-pill-active    { background: var(--cds-success-soft); color: var(--cds-success); }
.cds-intro-pill-suspended { background: var(--cds-error-soft);   color: var(--cds-error); }
.cds-intro-pill-pending   { background: rgba(255, 159, 10, 0.12); color: var(--cds-warning); }

/* Apply form */
.cds-camp-apply-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
}
.cds-camp-apply-form textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 11px 14px;
    border: 1px solid var(--cds-border);
    border-radius: var(--cds-radius);
    font-family: inherit;
    font-size: 14px;
    color: var(--cds-text);
    background: var(--cds-surface);
    resize: vertical;
    min-height: 84px;
    transition: border-color var(--cds-dur-fast) var(--cds-ease),
                box-shadow var(--cds-dur-fast) var(--cds-ease);
}
.cds-camp-apply-form textarea:hover {
    border-color: var(--cds-border-strong);
}
.cds-camp-apply-form textarea:focus {
    outline: none;
    border-color: var(--cds-primary);
    box-shadow: var(--cds-shadow-focus);
}

/* Pending applications list */
.cds-camp-pending-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.cds-camp-pending-item {
    background: var(--cds-surface-2);
    border: 1px solid var(--cds-border);
    border-radius: var(--cds-radius);
    padding: 12px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}
.cds-camp-pending-item-name {
    font-weight: 600;
    color: var(--cds-text);
}
.cds-camp-pending-item-date {
    color: var(--cds-text-tertiary);
    font-size: 12px;
}

/* ============================================================
 * Screen-reader-only helper
 * ============================================================ */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

/* ============================================================
 * Responsive
 * ============================================================ */

@media (max-width: 768px) {
    .cds-camp-manager-content { padding: 20px 16px; gap: 18px; }
    .cds-camp-mgr-section     { padding: 20px; }
    .cds-camp-mgr-kpi-grid    { grid-template-columns: 1fr 1fr; }
    .cds-camp-redemption-cta  { flex-direction: column; align-items: stretch; }
    .cds-camp-redemption-cta .cds-camp-btn-primary { width: 100%; }
    .cds-camp-mgr-bank-row    { flex-direction: column; align-items: flex-start; gap: 4px; }
    .cds-camp-mgr-bank-value  { text-align: left; }
}

@media (max-width: 480px) {
    .cds-camp-mgr-kpi-grid    { grid-template-columns: 1fr; }
    .cds-camp-membership-grid,
    .cds-camp-open-grid       { grid-template-columns: 1fr; }
}
