/* Ultimate Newswire Pro Max — customer portal */
:root {
	--unpm-navy: #1d2433;
	--unpm-line: #e6e8ec;
	--unpm-muted: #646970;
	--unpm-accent: #2563eb;
	/* Brandable colours — overridden per-site from Newswire Max → Settings → Branding. */
	--unpm-text: var(--unpm-navy);   /* portal body + sidebar nav text */
	--unpm-btn-bg: var(--unpm-accent); /* primary button background */
	--unpm-btn-text: #fff;            /* primary button label */
}

/* ---- Theme-proofing -------------------------------------------------------
   Keep the plugin's own colours regardless of the active theme. Block themes
   set link colour via `:root :where(a){color:…}` at specificity (0,1,0), which
   ties the plugin's single-class component rules and wins on source order —
   recolouring our links to the theme's palette (e.g. the sidebar going orange).
   Scoping under .unpm-layout lifts the plugin to (0,2,0) so it always wins, and
   every colour resolves from a variable the Branding settings can override. */
.unpm-layout a { color: var(--unpm-accent); }
.unpm-layout .unpm-side-item { color: var(--unpm-text); }
.unpm-layout .unpm-side-item:hover,
.unpm-layout .unpm-side-item.is-active { color: var(--unpm-accent); }
.unpm-layout .unpm-stat-card,
.unpm-layout .unpm-sort { color: inherit; }
.unpm-layout .unpm-tab { color: var(--unpm-muted); }
.unpm-layout .unpm-tab.is-active { color: var(--unpm-text); }
.unpm-layout .unpm-filter-tab { color: var(--unpm-text); }
.unpm-layout .unpm-filter-tab.is-active { color: var(--unpm-btn-text); }
.unpm-layout .unpm-btn { color: var(--unpm-text); }
.unpm-layout .unpm-btn-primary { background: var(--unpm-btn-bg); color: var(--unpm-btn-text); }
.unpm-layout .unpm-btn-danger { color: #b32d2e; }

.unpm-portal { max-width: 1240px; margin: 0 auto; font-size: 15px; color: var(--unpm-text); }
.unpm-muted { color: var(--unpm-muted); }

.unpm-top { display: flex; justify-content: flex-end; align-items: center; padding: 8px 0 12px; border-bottom: 1px solid var(--unpm-line); margin-bottom: 16px; }
.unpm-brand { font-weight: 700; font-size: 18px; }
.unpm-top-right { display: flex; align-items: center; gap: 14px; }
.unpm-credits-chip { background: #eef2ff; color: #3730a3; padding: 4px 12px; border-radius: 999px; font-weight: 600; font-size: 13px; }
.unpm-logout { font-size: 13px; }

/* Layout: left sidebar + main content */
.unpm-layout { display: flex; gap: 22px; align-items: flex-start; }
.unpm-layout .unpm-main { flex: 1 1 auto; min-width: 0; }
.unpm-sidebar { flex: 0 0 220px; position: sticky; top: 40px; }
.unpm-side-group { background: #fff; border: 1px solid var(--unpm-line); border-radius: 12px; padding: 8px; margin-bottom: 14px; }
.unpm-side-label { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--unpm-muted); padding: 8px 12px 4px; }
.unpm-side-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; text-decoration: none; color: var(--unpm-text); font-size: 14px; }
.unpm-side-item:hover { background: #f3f5f9; color: var(--unpm-accent); }
.unpm-side-item.is-active { background: #eef2ff; color: var(--unpm-accent); font-weight: 600; }
.unpm-side-ico { width: 18px; text-align: center; opacity: .8; }
.unpm-page-title { margin: 0 0 14px; font-size: 1.9rem; line-height: 1.15; }

/* Filter toggle (e.g. My Packages: All / Active / Expired-Used) */
.unpm-filter-tabs { display: inline-flex; border: 1px solid var(--unpm-line); border-radius: 8px; overflow: hidden; margin-bottom: 16px; }
.unpm-filter-tab { padding: 8px 14px; text-decoration: none; color: var(--unpm-text); font-size: 14px; border-right: 1px solid var(--unpm-line); }
.unpm-filter-tab:last-child { border-right: 0; }
.unpm-filter-tab:hover { background: #f3f5f9; }
.unpm-filter-tab.is-active { background: var(--unpm-accent); color: var(--unpm-btn-text); }
.unpm-filter-tab.is-active .unpm-muted { color: #dbe4ff; }

@media ( max-width: 782px ) {
	.unpm-layout { flex-direction: column; }
	.unpm-sidebar { position: static; flex-basis: auto; width: 100%; }
	.unpm-side-group { display: flex; flex-wrap: wrap; gap: 2px; }
	.unpm-side-label { flex: 0 0 100%; }
}

.unpm-section { background: #fff; border: 1px solid var(--unpm-line); border-radius: 12px; padding: 18px 20px; margin-bottom: 14px; }
.unpm-checkout { max-width: 560px; }

.unpm-notice { padding: 11px 14px; border-radius: 8px; margin-bottom: 16px; font-size: 14px; }
.unpm-notice--on { background: #d6f3e2; color: #0a6c39; }
.unpm-notice--off { background: #fde2e1; color: #b32d2e; }
.unpm-notice--warn { background: #fff4d6; color: #8a6d12; }

.unpm-order { width: 100%; border-collapse: collapse; margin: 8px 0 18px; }
.unpm-order td { padding: 8px 0; border-bottom: 1px solid var(--unpm-line); color: #475467; }
.unpm-order td:last-child { text-align: right; color: var(--unpm-navy); }
.unpm-order .unpm-order-total td { font-size: 16px; border-bottom: 2px solid var(--unpm-line); }

.unpm-pay-option { background: #f8fafc; border: 1px solid var(--unpm-line); border-radius: 10px; padding: 12px 14px; margin: 8px 0; }
.unpm-manual-box { background: #fbfcfe; border: 1px dashed var(--unpm-line); border-radius: 10px; padding: 12px 14px; margin: 0 0 10px; }

.unpm-pkg-list { list-style: none; margin: 0; padding: 0; }
.unpm-pkg-list li { padding: 10px 0; border-bottom: 1px solid var(--unpm-line); }
.unpm-pkg-list li:last-child { border-bottom: 0; }

.unpm-btn { display: inline-block; padding: 9px 16px; border-radius: 8px; background: #f0f1f3; color: var(--unpm-text, #111827); text-decoration: none; border: 0; cursor: pointer; font-size: 14px; }
.unpm-btn-primary { background: var(--unpm-btn-bg, #2563eb); color: var(--unpm-btn-text, #fff); }
.unpm-btn-primary:hover, .unpm-btn-primary:focus { color: var(--unpm-btn-text, #fff); }
.unpm-btn-sm { padding: 5px 12px; font-size: 13px; }
.unpm-btn-danger { background: #fde2e1; color: #b32d2e; }
.unpm-btn-danger:hover { background: #f8c9c7; }
.unpm-input { padding: 8px 11px; border: 1px solid var(--unpm-line); border-radius: 8px; font-size: 14px; }

/* Media-contact address book form */
.unpm-contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 8px 0 14px; }
.unpm-contact-grid label { display: flex; flex-direction: column; gap: 5px; }
.unpm-contact-grid label > span { font-weight: 600; font-size: 13px; color: var(--unpm-navy); }
.unpm-contact-grid .unpm-input { width: 100%; box-sizing: border-box; }
.unpm-contact-phone { display: flex; gap: 8px; }
.unpm-contact-phone select { flex: 0 0 96px; }
.unpm-contact-phone input { flex: 1 1 auto; }
@media ( max-width: 600px ) { .unpm-contact-grid { grid-template-columns: 1fr; } }

/* Marketplace */
.unpm-mkt-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0 20px; }
.unpm-mkt-toolbar .unpm-input { flex: 1 1 220px; }
.unpm-mkt-filter { padding: 8px 10px; border: 1px solid var(--unpm-line); border-radius: 8px; background: #fff; font-size: 14px; }
.unpm-mkt-reset { flex: 0 0 auto; align-self: center; }
.unpm-mkt-reset[hidden] { display: none; }
.unpm-mkt-spinner { width: 16px; height: 16px; border: 2px solid var(--unpm-line); border-top-color: var(--unpm-accent); border-radius: 50%; opacity: 0; }
.unpm-mkt-spinner.is-on { opacity: 1; animation: unpm-spin 0.7s linear infinite; }
@keyframes unpm-spin { to { transform: rotate( 360deg ); } }
.unpm-mkt-h { font-size: 16px; margin: 22px 0 10px; }
.unpm-cards-grid { display: grid; grid-template-columns: repeat( auto-fill, minmax( 260px, 1fr ) ); gap: 16px; }
.unpm-cards-grid .unpm-card { background: #fff; border: 1px solid var(--unpm-line); border-radius: 12px; padding: 16px 18px; }

/* Embedded shortcode block ([unpm_package]/[unpm_addon]) — a standalone card on
   any post/page (not inside .unpm-cards-grid), so re-apply the card chrome. */
.unpm-sc-card { max-width: 380px; }
.unpm-sc-card .unpm-card { background: #fff; border: 1px solid var(--unpm-line, #e5e7eb); border-radius: 12px; padding: 16px 18px; }
.unpm-sc-buy { display: inline-block; }
/* Embedded buttons land inside arbitrary theme content (e.g. .entry-content a,
   which can win on specificity or layers), so force the colours !important —
   scoped to the shortcode contexts only, so no collateral elsewhere. */
.unpm-sc .unpm-btn-primary, .unpm-sc .unpm-btn-primary:hover, .unpm-sc .unpm-btn-primary:focus, .unpm-sc .unpm-btn-primary:visited,
.unpm-sc-buy.unpm-btn-primary, .unpm-sc-buy.unpm-btn-primary:hover, .unpm-sc-buy.unpm-btn-primary:focus, .unpm-sc-buy.unpm-btn-primary:visited {
	color: var( --unpm-btn-text, #fff ) !important; background: var( --unpm-btn-bg, #2563eb ) !important; text-decoration: none !important;
}
.unpm-card-title { margin: 0 0 4px; font-size: 16px; }
.unpm-card-group { display: inline-block; background: #eef2ff; color: #3730a3; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; margin-bottom: 8px; }
.unpm-card-tags { color: var(--unpm-muted); font-size: 12px; margin-bottom: 8px; }
.unpm-card-specs { list-style: none; margin: 8px 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.unpm-card-specs li { background: #f3f5f9; border-radius: 6px; padding: 3px 9px; font-size: 12px; color: #475467; }
.unpm-card-sample { margin: 6px 0 0; font-size: 13px; }
.unpm-card-desc { color: #475467; font-size: 13px; margin: 0 0 12px; }
.unpm-tier-buy { list-style: none; margin: 0; padding: 0; }
.unpm-tier-buy li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 7px 0; border-top: 1px solid var(--unpm-line); font-size: 13px; }

/* Dashboard */
.unpm-tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--unpm-line); margin-bottom: 18px; }
.unpm-tab { padding: 9px 14px; text-decoration: none; color: var(--unpm-muted); border-bottom: 2px solid transparent; font-size: 14px; }
.unpm-tab.is-active { color: var(--unpm-text); border-bottom-color: var(--unpm-accent); font-weight: 600; }
.unpm-stat { text-align: center; }
.unpm-stat-num { font-size: 28px; font-weight: 700; }
.unpm-stat-label { color: var(--unpm-muted); font-size: 13px; margin-top: 4px; }

/* Clickable stat cards */
.unpm-stat-card { display: block; text-decoration: none; color: inherit; cursor: pointer; transition: box-shadow .12s, transform .12s, border-color .12s; }
.unpm-stat-card:hover { border-color: #c2cde4; box-shadow: 0 6px 18px rgba( 16, 24, 40, .09 ); transform: translateY( -1px ); color: inherit; }
.unpm-stat-go { margin-top: 8px; font-size: 13px; font-weight: 600; color: var(--unpm-accent); }

/* Compact breakdown tiles (PR statuses, reports) */
.unpm-mini-grid { display: grid; grid-template-columns: repeat( auto-fill, minmax( 150px, 1fr ) ); gap: 12px; margin-top: 4px; }
.unpm-mini { background: #fff; border: 1px solid var(--unpm-line); border-radius: 10px; padding: 14px 12px; text-align: center; }
.unpm-mini .unpm-stat-num { font-size: 24px; }
.unpm-stat-num--ink { color: var(--unpm-navy); }
.unpm-stat-num--on { color: #0a6c39; }
.unpm-stat-num--off { color: #b32d2e; }
.unpm-stat-num--warn { color: #8a6d12; }
/* Search + status filter toolbar */
.unpm-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.unpm-toolbar .unpm-table-search { flex: 1 1 240px; max-width: 360px; }
.unpm-toolbar .unpm-status-select { flex: 0 0 auto; background: #fff; cursor: pointer; }

.unpm-table { width: 100%; border-collapse: collapse; }
.unpm-table th, .unpm-table td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--unpm-line); font-size: 14px; }
.unpm-table th { color: var(--unpm-muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
.unpm-sort { color: inherit; text-decoration: none; white-space: nowrap; }
.unpm-sort:hover { color: var(--unpm-accent); }
.unpm-sort.is-sorted { color: var(--unpm-navy); }
.unpm-pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.unpm-pill--on { background: #d6f3e2; color: #0a6c39; }
.unpm-pill--off { background: #fde2e1; color: #b32d2e; }
.unpm-pill--warn { background: #fff4d6; color: #8a6d12; }

/* No-credit modal (shown when a user with 0 credits tries to write a PR) */
.unpm-modal { position: fixed; inset: 0; z-index: 100000; display: flex; align-items: center; justify-content: center; padding: 16px; }
.unpm-modal[hidden] { display: none; }
.unpm-modal-overlay { position: absolute; inset: 0; background: rgba( 16, 24, 40, .55 ); }
.unpm-modal-card { position: relative; z-index: 1; background: #fff; border-radius: 16px; padding: 34px 30px 30px; max-width: 420px; width: 100%; text-align: center; box-shadow: 0 24px 60px rgba( 0, 0, 0, .3 ); }
.unpm-modal-x { position: absolute; top: 8px; right: 14px; border: 0; background: none; font-size: 26px; line-height: 1; color: var(--unpm-muted); cursor: pointer; }
.unpm-modal-ico { font-size: 42px; margin-bottom: 6px; }
.unpm-modal-title { margin: 0 0 8px; font-size: 1.4rem; color: var(--unpm-text); }
.unpm-modal-text { color: var(--unpm-muted); font-size: 14px; margin: 0 0 22px; }

/* ===========================================================================
   Auth pages — login / sign-up. Three admin-selectable templates share the
   same fields (.unpm-input). The primary button uses the brand variables, so
   Branding colours recolour these too.
   ========================================================================= */
.unpm-auth { box-sizing: border-box; }
.unpm-auth * { box-sizing: border-box; }
.unpm-auth-inner { width: 100%; }

/* Form column (shared) */
.unpm-auth-form { width: 100%; }
.unpm-auth-brand { display: inline-block; font-weight: 800; font-size: 20px; letter-spacing: -.01em; text-decoration: none; color: var(--unpm-text); margin-bottom: 20px; }
.unpm-auth-eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: 12px; font-weight: 700; color: var(--unpm-accent); margin: 0 0 6px; }
.unpm-auth-h { font-size: 2rem; line-height: 1.1; margin: 0 0 8px; color: var(--unpm-text); }
.unpm-auth-sub { color: var(--unpm-muted); font-size: 14px; margin: 0 0 22px; }
.unpm-auth-sub a { font-weight: 600; }

.unpm-auth-fields { margin: 0; }
.unpm-auth-hp { position: absolute; left: -9999px; }
.unpm-auth-field { display: flex; flex-direction: column; gap: 6px; margin: 0 0 14px; }
.unpm-auth-field label { font-size: 13px; font-weight: 600; color: var(--unpm-text); }
.unpm-auth-field .unpm-input { width: 100%; box-sizing: border-box; padding: 12px 14px; font-size: 15px; }
.unpm-auth-hint { font-size: 12px; color: var(--unpm-muted); }
.unpm-auth-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 18px; font-size: 13px; }
.unpm-auth-remember { display: inline-flex; align-items: center; gap: 7px; color: var(--unpm-muted); }
.unpm-auth-forgot { font-size: 13px; }
.unpm-auth-submit { width: 100%; padding: 12px 16px; font-size: 15px; font-weight: 600; text-align: center; }

/* Show / hide password toggle (login + sign-up) */
.unpm-pass-wrap { position: relative; display: block; }
.unpm-pass-wrap .unpm-input { width: 100%; box-sizing: border-box; padding-right: 44px; }
.unpm-pass-toggle { position: absolute; top: 0; right: 0; height: 100%; width: 42px; display: inline-flex;
	align-items: center; justify-content: center; padding: 0; border: 0; background: transparent;
	color: var(--unpm-muted); cursor: pointer; }
.unpm-pass-toggle:hover { color: var(--unpm-text); }
.unpm-pass-toggle .unpm-eye-off { display: none; }
.unpm-pass-toggle.is-shown .unpm-eye { display: none; }
.unpm-pass-toggle.is-shown .unpm-eye-off { display: inline; }

/* Marketing-consent checkbox (sign-up) */
.unpm-auth-consent { display: flex; align-items: flex-start; gap: 8px; margin: 0 0 16px; font-size: 13px; color: var(--unpm-muted); line-height: 1.45; }
.unpm-auth-consent label { display: flex; align-items: flex-start; gap: 8px; cursor: pointer; }
.unpm-auth-consent input { margin-top: 2px; flex: 0 0 auto; }

/* Marketing / showcase aside (split + hero) */
.unpm-auth-aside { position: relative; overflow: hidden; display: flex; align-items: flex-end; min-height: 280px;
	background: linear-gradient( 145deg, var(--unpm-accent), #1e3a8a 90% ); }
.unpm-auth--split_showcase .unpm-auth-aside[style*="--unpm-auth-bg"],
.unpm-auth-aside[style*="--unpm-auth-bg"] { background-image: var(--unpm-auth-bg); background-size: cover; background-position: center; }
.unpm-auth-aside-body { padding: 40px; color: #fff; position: relative; z-index: 1; }
.unpm-auth-aside[style*="--unpm-auth-bg"] .unpm-auth-aside-body { background: linear-gradient( to top, rgba( 12, 18, 38, .8 ), transparent ); width: 100%; }
.unpm-auth-aside-h { color: #fff; font-size: 1.7rem; line-height: 1.2; margin: 0 0 10px; }
.unpm-auth-aside-t { color: rgba( 255, 255, 255, .85 ); font-size: 15px; margin: 0; max-width: 420px; }

/* ---- Template: Centered card ---- */
.unpm-auth--centered { min-height: 78vh; display: flex; align-items: center; justify-content: center; padding: 40px 16px;
	background: #f1f5f9; }
.unpm-auth--centered .unpm-auth-inner { max-width: 440px; background: #fff; border: 1px solid var(--unpm-line);
	border-radius: 16px; padding: 36px 34px; box-shadow: 0 10px 40px rgba( 16, 24, 40, .08 ); }

/* Full-screen templates render IN-FLOW (position:relative) between the theme
   header and footer — never a fixed/inset:0 overlay — so the header nav + footer
   stay reachable and a visitor can always leave the login / sign-up screen. A
   tall min-height keeps them feeling full-bleed without covering the chrome. */

/* ---- Template: Split showcase (light) ---- */
.unpm-auth--split_showcase { position: relative; overflow: hidden; background: #fff; min-height: 70vh; }
.unpm-auth--split_showcase .unpm-auth-inner { display: grid; grid-template-columns: 1fr 1fr; min-height: 100%; }
.unpm-auth--split_showcase .unpm-auth-form { max-width: 460px; margin: auto; padding: 56px 40px; }
.unpm-auth--split_showcase .unpm-auth-aside { border-radius: 0; }

/* ---- Template: Full-screen hero ---- */
.unpm-auth--hero { position: relative; overflow: hidden; display: flex; padding: 48px 16px; min-height: 70vh;
	background: var(--unpm-auth-bg, linear-gradient( 135deg, #0f172a, #1e3a8a )); background-size: cover; background-position: center; }
.unpm-auth--hero .unpm-auth-inner { margin: auto; }
.unpm-auth--hero .unpm-auth-inner { max-width: 440px; background: rgba( 17, 24, 39, .72 ); backdrop-filter: blur( 14px );
	-webkit-backdrop-filter: blur( 14px ); border: 1px solid rgba( 255, 255, 255, .14 ); border-radius: 18px;
	padding: 38px 34px; box-shadow: 0 20px 60px rgba( 0, 0, 0, .4 ); }
.unpm-auth--hero .unpm-auth-aside { display: none; }
.unpm-auth--hero .unpm-auth-brand,
.unpm-auth--hero .unpm-auth-h,
.unpm-auth--hero .unpm-auth-field label { color: #fff; }
.unpm-auth--hero .unpm-auth-sub,
.unpm-auth--hero .unpm-auth-remember,
.unpm-auth--hero .unpm-auth-hint { color: rgba( 255, 255, 255, .75 ); }
.unpm-auth--hero .unpm-auth-eyebrow { color: #c7d2fe; }
.unpm-auth--hero .unpm-input { background: rgba( 255, 255, 255, .08 ); border-color: rgba( 255, 255, 255, .25 ); color: #fff; }
.unpm-auth--hero .unpm-input::placeholder { color: rgba( 255, 255, 255, .5 ); }

@media ( max-width: 860px ) {
	.unpm-auth--split_showcase .unpm-auth-inner { grid-template-columns: 1fr; min-height: 0; }
	.unpm-auth--split_showcase .unpm-auth-aside { min-height: 220px; order: -1; }
	.unpm-auth--split_showcase .unpm-auth-form { min-height: 0; padding: 40px 24px; }
}
