/* HG Woo Affiliate Lite — My Account area. Self-contained, theme-adaptive (light/dark). */
.hgaff {
	--hg-accent: #4f46e5;
	--hg-accent-2: #7c3aed;
	--hg-green: #16a34a;
	--hg-amber: #d97706;
	--hg-red: #dc2626;
	--hg-blue: #2563eb;
	--hg-line: color-mix(in srgb, currentColor 14%, transparent);
	--hg-soft: color-mix(in srgb, currentColor 5%, transparent);
	--hg-mute: color-mix(in srgb, currentColor 62%, transparent);
	--hg-radius: 16px;
	position: relative;
	color: inherit;
	font-size: 15px;
	line-height: 1.55;
	-webkit-font-smoothing: antialiased;
}
.hgaff *, .hgaff *::before, .hgaff *::after { box-sizing: border-box; }
.hgaff svg.hg-i { width: 1.15em; height: 1.15em; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.2em; }

/* ---------- Hero ---------- */
.hgaff-hero {
	position: relative; overflow: hidden; border-radius: 20px; padding: 28px 30px; margin-bottom: 22px;
	color: #fff; background: linear-gradient(125deg, #4338ca 0%, #6d28d9 55%, #a21caf 100%);
	box-shadow: 0 18px 40px -22px rgba(79, 70, 229, .75);
}
.hgaff-hero::before, .hgaff-hero::after { content: ""; position: absolute; border-radius: 50%; background: rgba(255,255,255,.10); pointer-events: none; }
.hgaff-hero::before { width: 260px; height: 260px; right: -70px; top: -120px; }
.hgaff-hero::after  { width: 160px; height: 160px; right: 110px; bottom: -100px; background: rgba(255,255,255,.07); }
.hgaff-hero > * { position: relative; z-index: 1; }
.hgaff-hero .hgaff-eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; background: rgba(255,255,255,.16); padding: 5px 12px; border-radius: 99px; margin-bottom: 12px; }
.hgaff-hero h3 { margin: 0 0 6px; color: #fff; font-size: 26px; font-weight: 750; letter-spacing: -.01em; line-height: 1.2; }
.hgaff-hero p { margin: 0; color: rgba(255,255,255,.86); max-width: 560px; }

/* ---------- Tabs ---------- */
.hgaff-tabs { display: flex; gap: 6px; padding: 6px; margin: 0 0 22px; list-style: none; background: var(--hg-soft); border: 1px solid var(--hg-line); border-radius: 14px; overflow-x: auto; scrollbar-width: none; }
.hgaff-tabs::-webkit-scrollbar { display: none; }
.hgaff-tabs li { margin: 0; flex: 1 0 auto; }
.hgaff-tabs a {
	display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border-radius: 10px; white-space: nowrap;
	font-weight: 600; font-size: 14px; text-decoration: none !important; color: var(--hg-mute); transition: background .18s, color .18s, box-shadow .18s;
}
.hgaff-tabs a:hover { color: inherit; background: var(--hg-soft); }
.hgaff-tabs a.is-active { color: #fff !important; background: linear-gradient(135deg, var(--hg-accent), var(--hg-accent-2)); box-shadow: 0 8px 18px -10px rgba(79,70,229,.9); }

/* ---------- Notices ---------- */
.hgaff-notice { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; margin: 0 0 20px; border-radius: 14px; border: 1px solid; animation: hgaffIn .35s ease both; position: relative; }
.hgaff-notice .hgaff-notice-ico { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none; color: #fff; }
.hgaff-notice .hgaff-notice-ico svg { width: 18px; height: 18px; }
.hgaff-notice strong { display: block; font-size: 15px; margin-bottom: 1px; }
.hgaff-notice span.hgaff-notice-text { color: var(--hg-mute); font-size: 14px; }
.hgaff-notice button.hgaff-x { margin-left: auto; background: none; border: 0; cursor: pointer; color: var(--hg-mute); font-size: 22px; line-height: 1; padding: 0 2px; }
.hgaff-notice button.hgaff-x:hover { color: inherit; }
.hgaff-notice.is-success { background: rgba(22,163,74,.10); border-color: rgba(22,163,74,.35); }
.hgaff-notice.is-success .hgaff-notice-ico { background: var(--hg-green); }
.hgaff-notice.is-error { background: rgba(220,38,38,.09); border-color: rgba(220,38,38,.35); }
.hgaff-notice.is-error .hgaff-notice-ico { background: var(--hg-red); }
.hgaff-notice.is-info { background: rgba(37,99,235,.09); border-color: rgba(37,99,235,.32); }
.hgaff-notice.is-info .hgaff-notice-ico { background: var(--hg-blue); }
@keyframes hgaffIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ---------- Cards ---------- */
.hgaff-card { background: var(--hg-soft); border: 1px solid var(--hg-line); border-radius: var(--hg-radius); padding: 24px; margin-bottom: 22px; }
.hgaff-card h4 { margin: 0 0 4px; font-size: 18px; font-weight: 700; letter-spacing: -.005em; }
.hgaff-card .hgaff-sub { margin: 0 0 18px; color: var(--hg-mute); font-size: 14px; }
.hgaff-card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.hgaff-card-head h4 { margin: 0; }
.hgaff-card-head .hgaff-sub { margin: 2px 0 0; }
.hgaff-chip { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none; background: rgba(79,70,229,.14); color: var(--hg-accent); }
.hgaff-chip svg { width: 21px; height: 21px; }

/* ---------- Stat tiles ---------- */
.hgaff-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 22px; }
.hgaff-stat { position: relative; overflow: hidden; background: var(--hg-soft); border: 1px solid var(--hg-line); border-radius: var(--hg-radius); padding: 18px 18px 16px; display: flex; flex-direction: column; transition: transform .2s, box-shadow .2s, border-color .2s; }
.hgaff-stat:hover { transform: translateY(-3px); box-shadow: 0 16px 30px -22px rgba(0,0,0,.55); border-color: color-mix(in srgb, var(--tone) 45%, transparent); }
.hgaff-stat::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--tone); }
.hgaff-stat-top { display: flex; align-items: center; gap: 10px; color: var(--hg-mute); font-size: 13px; font-weight: 600; }
.hgaff-stat-top .hgaff-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: var(--tone); background: color-mix(in srgb, var(--tone) 15%, transparent); }
.hgaff-stat-top .hgaff-ico svg { width: 18px; height: 18px; }
.hgaff-stat-val { font-size: 27px; font-weight: 750; letter-spacing: -.02em; margin: 12px 0 2px; line-height: 1.15; }
.hgaff-stat-val .woocommerce-Price-amount { font-weight: inherit; }
.hgaff-stat-foot { margin-top: auto; padding-top: 12px; border-top: 1px dashed var(--hg-line); font-size: 12.5px; color: var(--hg-mute); }
.hgaff-stat-foot .ok { color: var(--hg-green); font-weight: 600; display: block; margin-bottom: 8px; }
.hgaff-tone-red { --tone: #ef4444; } .hgaff-tone-green { --tone: #16a34a; } .hgaff-tone-amber { --tone: #f59e0b; } .hgaff-tone-blue { --tone: #4f46e5; }

/* ---------- Buttons ---------- */
.hgaff-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; cursor: pointer; font: inherit; font-weight: 650; font-size: 14.5px; padding: 12px 22px; border-radius: 12px; color: #fff !important; text-decoration: none !important; background: linear-gradient(135deg, var(--hg-accent), var(--hg-accent-2)); box-shadow: 0 10px 22px -12px rgba(79,70,229,.9); transition: transform .15s, box-shadow .15s, filter .15s; }
.hgaff-btn:hover { transform: translateY(-1px); filter: brightness(1.07); box-shadow: 0 14px 26px -12px rgba(79,70,229,.95); }
.hgaff-btn:active { transform: none; }
.hgaff-btn.is-green { background: linear-gradient(135deg, #16a34a, #059669); box-shadow: 0 10px 22px -12px rgba(22,163,74,.9); }
.hgaff-btn.is-block { width: 100%; }
.hgaff-btn.is-sm { padding: 9px 14px; font-size: 13.5px; border-radius: 10px; }
.hgaff-btn.is-ghost { background: var(--hg-soft); color: inherit !important; border: 1px solid var(--hg-line); box-shadow: none; }
.hgaff-btn.is-ghost:hover { border-color: var(--hg-accent); color: var(--hg-accent) !important; filter: none; }
.hgaff-btn.is-loading { pointer-events: none; opacity: .75; }
.hgaff-btn.is-loading::after { content: ""; width: 15px; height: 15px; border-radius: 50%; border: 2px solid rgba(255,255,255,.45); border-top-color: #fff; animation: hgaffSpin .7s linear infinite; }
@keyframes hgaffSpin { to { transform: rotate(360deg); } }

/* ---------- Copy field ---------- */
.hgaff-copy { display: flex; gap: 10px; align-items: stretch; }
.hgaff-copy input, .hgaff-copy textarea { flex: 1; min-width: 0; }
.hgaff-copy textarea { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; resize: vertical; }
.hgaff-note { margin: 12px 0 0; font-size: 13px; color: var(--hg-mute); display: flex; gap: 8px; align-items: center; }
.hgaff-banner-preview { display: grid; place-items: center; padding: 18px; border-radius: 14px; border: 1px dashed var(--hg-line); background: var(--hg-soft); margin-bottom: 18px; }
.hgaff-banner-preview img { max-width: 100%; height: auto; max-height: 150px; border-radius: 10px; object-fit: contain; }
.hgaff-label { display: block; font-weight: 650; font-size: 13.5px; margin: 0 0 8px; }

/* ---------- Form controls ---------- */
.hgaff input[type="text"], .hgaff input[type="email"], .hgaff textarea, .hgaff select {
	width: 100%; font: inherit; color: inherit; background: color-mix(in srgb, currentColor 4%, transparent); border: 1.5px solid var(--hg-line); border-radius: 12px; padding: 12px 14px; height: auto; box-shadow: none; transition: border-color .15s, box-shadow .15s; outline: 0;
}
.hgaff input:focus, .hgaff textarea:focus, .hgaff select:focus { border-color: var(--hg-accent); box-shadow: 0 0 0 4px rgba(79,70,229,.18); }
.hgaff input.is-invalid, .hgaff select.is-invalid { border-color: var(--hg-red); box-shadow: 0 0 0 4px rgba(220,38,38,.14); }
.hgaff select { appearance: none; -webkit-appearance: none; padding-right: 40px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238b8fa3' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; }
.hgaff select option { color: #111827; background: #fff; }
.hgaff-field { margin-bottom: 20px; }
.hgaff-hint { margin: 7px 0 0; font-size: 12.5px; color: var(--hg-mute); }

/* Payout method cards */
.hgaff-methods { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.hgaff-method { position: relative; cursor: pointer; margin: 0; }
.hgaff-method input { position: absolute; opacity: 0; pointer-events: none; }
.hgaff-method-box { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 18px 12px; border-radius: 14px; border: 1.5px solid var(--hg-line); background: color-mix(in srgb, currentColor 3%, transparent); font-weight: 650; font-size: 14px; transition: border-color .15s, background .15s, transform .15s, box-shadow .15s; height: 100%; }
.hgaff-method-box .hgaff-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, currentColor 8%, transparent); color: var(--hg-mute); transition: inherit; }
.hgaff-method-box .hgaff-ico svg { width: 20px; height: 20px; }
.hgaff-method-box small { font-weight: 500; color: var(--hg-mute); font-size: 12px; }
.hgaff-method:hover .hgaff-method-box { transform: translateY(-2px); border-color: color-mix(in srgb, var(--hg-accent) 50%, transparent); }
.hgaff-method input:focus-visible + .hgaff-method-box { box-shadow: 0 0 0 4px rgba(79,70,229,.25); }
.hgaff-method input:checked + .hgaff-method-box { border-color: var(--hg-accent); background: rgba(79,70,229,.10); box-shadow: 0 10px 22px -16px rgba(79,70,229,.9); }
.hgaff-method input:checked + .hgaff-method-box .hgaff-ico { background: linear-gradient(135deg, var(--hg-accent), var(--hg-accent-2)); color: #fff; }
.hgaff-method input:checked + .hgaff-method-box::after { content: "✓"; position: absolute; top: 8px; right: 10px; width: 20px; height: 20px; border-radius: 50%; background: var(--hg-accent); color: #fff; font-size: 12px; display: grid; place-items: center; line-height: 1; }
.hgaff-crypto-wrap[hidden] { display: none; }
.hgaff-form-foot { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding-top: 6px; }
.hgaff-secure { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--hg-mute); }

/* Saved payout summary */
.hgaff-summary { display: flex; gap: 14px; align-items: center; padding: 14px 16px; border-radius: 14px; background: rgba(22,163,74,.09); border: 1px solid rgba(22,163,74,.3); margin-bottom: 22px; }
.hgaff-summary .hgaff-ico { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--hg-green); color: #fff; flex: none; }
.hgaff-summary b { display: block; font-size: 14px; }
.hgaff-summary code { word-break: break-all; font-size: 13px; background: none; padding: 0; color: var(--hg-mute); }

/* ---------- Tables ---------- */
.hgaff-table-wrap { overflow-x: auto; border: 1px solid var(--hg-line); border-radius: 14px; }
.hgaff-table { width: 100%; border-collapse: collapse; margin: 0; font-size: 14px; background: transparent; border: 0; }
.hgaff-table th { text-align: left; font-size: 11.5px; letter-spacing: .07em; text-transform: uppercase; font-weight: 700; color: var(--hg-mute); background: var(--hg-soft); padding: 13px 16px; border: 0; border-bottom: 1px solid var(--hg-line); white-space: nowrap; }
.hgaff-table td { padding: 14px 16px; border: 0; border-bottom: 1px solid var(--hg-line); vertical-align: middle; background: transparent; }
.hgaff-table tr:last-child td { border-bottom: 0; }
.hgaff-table tbody tr { transition: background .15s; }
.hgaff-table tbody tr:hover { background: var(--hg-soft); }
.hgaff-table td.hgaff-num { font-weight: 650; white-space: nowrap; }
.hgaff-table td.hgaff-date { color: var(--hg-mute); font-size: 13px; white-space: nowrap; }
.hgaff-empty { text-align: center; padding: 44px 16px !important; color: var(--hg-mute); }
.hgaff-empty svg { width: 38px; height: 38px; opacity: .5; display: block; margin: 0 auto 10px; }
.hgaff-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 99px; font-size: 12px; font-weight: 650; line-height: 1.4; background: var(--hg-soft); color: var(--hg-mute); border: 1px solid var(--hg-line); white-space: nowrap; }
.hgaff-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.hgaff-badge.is-paid { background: rgba(22,163,74,.13); color: #16a34a; border-color: rgba(22,163,74,.3); }
.hgaff-badge.is-processing, .hgaff-badge.is-pending { background: rgba(245,158,11,.14); color: #d97706; border-color: rgba(245,158,11,.35); }
.hgaff-badge.is-unpaid { background: rgba(100,116,139,.14); color: var(--hg-mute); }
.hgaff-badge.is-method::before { display: none; }
.hgaff-tx { display: inline-flex; align-items: center; gap: 8px; }
.hgaff-tx code { font-size: 12.5px; background: var(--hg-soft); border: 1px solid var(--hg-line); border-radius: 8px; padding: 3px 8px; }
.hgaff-tx button { background: none; border: 0; cursor: pointer; color: var(--hg-accent); padding: 2px; display: grid; }

/* ---------- Pagination ---------- */
.hgaff-pager { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin: 20px 0 0; padding: 0; list-style: none; }
.hgaff-pager a, .hgaff-pager span { display: grid; place-items: center; min-width: 38px; height: 38px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--hg-line); font-weight: 600; font-size: 14px; text-decoration: none !important; color: inherit; background: var(--hg-soft); transition: all .15s; }
.hgaff-pager a:hover { border-color: var(--hg-accent); color: var(--hg-accent); }
.hgaff-pager .is-current { background: linear-gradient(135deg, var(--hg-accent), var(--hg-accent-2)); border-color: transparent; color: #fff; }
.hgaff-pager .is-disabled { opacity: .4; pointer-events: none; }

/* ---------- Join (not registered) ---------- */
.hgaff-perks { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; margin-bottom: 22px; }
.hgaff-perk { padding: 20px; border-radius: var(--hg-radius); background: var(--hg-soft); border: 1px solid var(--hg-line); }
.hgaff-perk .hgaff-chip { margin-bottom: 12px; }
.hgaff-perk b { display: block; margin-bottom: 4px; }
.hgaff-perk p { margin: 0; color: var(--hg-mute); font-size: 13.5px; }
.hgaff-join { text-align: center; padding: 8px 0 4px; }

/* ---------- Toast ---------- */
.hgaff-toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 24px); opacity: 0; z-index: 99999; display: flex; align-items: center; gap: 10px; padding: 13px 20px; border-radius: 14px; background: #111827; color: #fff; font-size: 14px; font-weight: 600; box-shadow: 0 20px 40px -16px rgba(0,0,0,.6); transition: all .28s ease; pointer-events: none; }
.hgaff-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.hgaff-toast svg { width: 18px; height: 18px; flex: none; fill: none; stroke: #4ade80; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) { .hgaff-stats { grid-template-columns: repeat(2, minmax(0,1fr)); } .hgaff-perks { grid-template-columns: 1fr; } }
@media (max-width: 560px) {
	.hgaff-hero { padding: 22px 20px; } .hgaff-hero h3 { font-size: 22px; }
	.hgaff-stats { grid-template-columns: 1fr; }
	.hgaff-methods { grid-template-columns: 1fr; } .hgaff-method-box { flex-direction: row; text-align: left; padding: 14px; } .hgaff-method input:checked + .hgaff-method-box::after { top: 50%; transform: translateY(-50%); }
	.hgaff-copy { flex-direction: column; } .hgaff-card { padding: 18px; }
	.hgaff-form-foot .hgaff-btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { .hgaff *, .hgaff-toast { animation: none !important; transition: none !important; } }

/* ---------- Managed banners ---------- */
.hgaff-banner + .hgaff-banner { margin-top: 26px; padding-top: 26px; border-top: 1px dashed var(--hg-line); }
.hgaff-banner-empty { display: flex; gap: 12px; align-items: center; padding: 22px; border: 1px dashed var(--hg-line); border-radius: 14px; color: var(--hg-mute); }
.hgaff-banner-empty svg { width: 26px; height: 26px; opacity: .6; }
