/* Copyright © Rob Art | Illustration 2026 */
/* RobArt CatchNet — admin settings-page chrome (RobArt house gold-standard).
   Full parity with the RobArt Email Guard admin shell (admin-base + admin-cards),
   racn- prefixed. Loaded only on the CatchNet settings page. All colours are tokens
   on :root so the page is themeable and consistent with the fleet. */

/* ── Tokens ─────────────────────────────────────────────────────────────── */
:root {
	--racn-blue:         #5184b3;
	--racn-blue-dark:    #456f98;
	--racn-gold:         #e6b325;
	--racn-green:        #2d7a4f;
	--racn-chrome-text:  #f5f7f9;
	--racn-text:         #1d2327;
	--racn-text-muted:   #6b7280;
	--racn-bg:           #f6f7f7;
	--racn-surface:      #ffffff;
	--racn-border:       #e2e4e7;
	--racn-radius:       8px;
	--racn-shadow:       0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
	--racn-toggle-off:   #c7ccd3;
}

/* ── Outer wrap ─────────────────────────────────────────────────────────── */
.racn-wrap {
	margin: 0 -20px -10px -2px;
	display: flex;
	flex-direction: column;
	min-height: calc(100vh - 32px);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	color: var(--racn-text);
	background: var(--racn-bg);
	box-sizing: border-box;
	width: calc(100% + 2px);
}

/* ── Header (branded topbar band) ───────────────────────────────────────── */
.racn-header {
	background: var(--racn-blue);
	color: var(--racn-chrome-text);
	border-radius: 0 0 var(--racn-radius) var(--racn-radius);
	padding: 14px 24px;
	display: flex;
	align-items: center;
	gap: 12px;
	flex-shrink: 0;
	width: 98%;
	box-sizing: border-box;
}
.racn-header-brand { height: 34px; width: auto; display: block; flex-shrink: 0; }
/* Full CatchNet wordmark logo (mark + text in one SVG) */
.racn-header-logo { height: 40px; width: auto; display: block; flex-shrink: 0; }
.racn-header-brand-name {
	font-size: 16px;
	font-weight: 700;
	letter-spacing: 0.02em;
	color: var(--racn-chrome-text);
}
.racn-header-sep {
	color: var(--racn-chrome-text);
	opacity: 0.4;
	font-weight: 300;
	font-size: 20px;
	line-height: 1;
}
.racn-header-icon {
	width: 36px;
	height: 36px;
	opacity: 0.85;
	filter: brightness(0) invert(1);
	flex-shrink: 0;
}
.racn-header-title {
	font-size: 17px;
	font-weight: 500;
	color: var(--racn-chrome-text);
}
.racn-header-right {
	margin-left: auto;
	font-size: 12px;
	opacity: 0.7;
	display: flex;
	align-items: center;
	gap: 16px;
	font-weight: 400;
	color: var(--racn-chrome-text);
}

/* ── Saved notice ───────────────────────────────────────────────────────── */
.racn-notice-saved {
	background: #1a7f4b;
	color: #fff;
	font-size: 13px;
	font-weight: 500;
	padding: 10px 24px;
	width: 98%;
	box-sizing: border-box;
	overflow: hidden;
	animation: racnFadeNotice 3s ease forwards;
}
.racn-notice-saved p { margin: 0; }
@keyframes racnFadeNotice {
	0%   { opacity: 1; max-height: 60px; padding-top: 10px; padding-bottom: 10px; }
	70%  { opacity: 1; max-height: 60px; padding-top: 10px; padding-bottom: 10px; }
	100% { opacity: 0; max-height: 0;    padding-top: 0;    padding-bottom: 0;    border: 0; }
}

/* ── Body (main + sidebar row) ──────────────────────────────────────────── */
.racn-body {
	display: flex;
	flex: 1;
	gap: 24px;
	padding: 28px;
	width: 98%;
	box-sizing: border-box;
	align-items: stretch;
}
.racn-main { flex: 1; min-width: 0; }

/* ── 2-column settings card grid (stacks to 1 col when narrow) ──────────── */
.racn-cards-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.racn-cards-2col > .racn-card { margin: 0; }
@media (max-width: 1100px) { .racn-cards-2col { grid-template-columns: 1fr; } }

/* ── Sidebar (solid blue panel) ─────────────────────────────────────────── */
.racn-sidebar {
	flex: 0 0 300px;
	background: var(--racn-blue);
	border-radius: var(--racn-radius);
	padding: 20px;
	color: var(--racn-chrome-text);
	font-size: 13px;
	min-width: 0;
	align-self: stretch;
}
.racn-sidebar-section { margin-bottom: 20px; }
.racn-sidebar-section:last-child { margin-bottom: 0; }
.racn-sidebar-heading {
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	opacity: 0.6;
	margin-bottom: 8px;
}
.racn-sidebar-text  { opacity: 0.85; line-height: 1.5; color: var(--racn-chrome-text); margin: 0; }
.racn-sidebar-small { font-size: 11px; opacity: 0.7; margin: 0; }
.racn-sidebar-text + .racn-sidebar-text { margin-top: 6px; }
.racn-sidebar-section .racn-sidebar-text + .racn-sidebar-btn { margin-top: 6px; }
.racn-debug-hint { margin-bottom: 8px; }
.racn-debug-copy-btn { margin-top: 8px; font-size: 11px; padding: 5px 10px; }
.racn-debug-copied { margin-top: 4px; font-size: 11px; color: rgba(255,255,255,0.7); }

.racn-sidebar-link {
	color: var(--racn-chrome-text);
	opacity: 0.9;
	text-decoration: underline;
	text-underline-offset: 2px;
}
.racn-sidebar-link:hover { opacity: 1; color: var(--racn-chrome-text); }

.racn-sidebar-steps {
	margin: 4px 0 0 16px;
	padding: 0;
	opacity: 0.85;
	color: var(--racn-chrome-text);
	line-height: 1.6;
	font-size: 12px;
}
.racn-sidebar-steps li { margin-bottom: 6px; }

.racn-sidebar-actions { display: flex; flex-direction: column; gap: 7px; }

.racn-sidebar-btn {
	display: block;
	padding: 8px 12px;
	border-radius: var(--racn-radius);
	font-size: 13px;
	font-weight: 500;
	text-decoration: none;
	color: var(--racn-chrome-text);
	background: rgba(255,255,255,0.12);
	border: 1px solid rgba(255,255,255,0.22);
	cursor: pointer;
	transition: background 0.15s, border-color 0.15s;
	font-family: inherit;
	width: 100%;
	box-sizing: border-box;
	text-align: left;
}
.racn-sidebar-btn:hover {
	background: rgba(255,255,255,0.22);
	border-color: rgba(255,255,255,0.4);
	color: var(--racn-chrome-text);
}
.racn-sidebar-btn.is-copied { background: var(--racn-green); border-color: transparent; }
.racn-sidebar-btn--accent {
	background: var(--racn-gold);
	border-color: transparent;
	color: #1a1a2e;
	font-weight: 600;
}
.racn-sidebar-btn--accent:hover { background: #d7a71f; color: #1a1a2e; }

/* ── Sidebar credits list ───────────────────────────────────────────────── */
.racn-sidebar-credits {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 6px;
}
.racn-sidebar-credits li {
	font-size: 12px;
	color: rgba(255,255,255,0.8);
	line-height: 1.5;
	padding-left: 10px;
	position: relative;
}
.racn-sidebar-credits li::before {
	content: '–';
	position: absolute;
	left: 0;
	color: rgba(255,255,255,0.4);
}
.racn-sidebar-credits li a { color: var(--racn-chrome-text); text-decoration: underline; text-underline-offset: 2px; }
.racn-sidebar-credits li a:hover { color: var(--racn-chrome-text); }

/* ── Sidebar debug block ────────────────────────────────────────────────── */
.racn-debug-block {
	font-family: monospace;
	font-size: 10px;
	line-height: 1.6;
	color: rgba(255,255,255,0.75);
	background: rgba(0,0,0,0.2);
	border-radius: 4px;
	padding: 8px 10px;
	white-space: pre;
	overflow-x: auto;
	word-break: break-all;
}

/* ── Footer bar ─────────────────────────────────────────────────────────── */
.racn-footer {
	background: var(--racn-blue);
	color: var(--racn-chrome-text);
	border-radius: var(--racn-radius) var(--racn-radius) 0 0;
	padding: 12px 24px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	font-size: 12px;
	opacity: 0.92;
	flex-shrink: 0;
	width: 98%;
	box-sizing: border-box;
	gap: 12px;
}
.racn-footer-left,
.racn-footer-centre,
.racn-footer-right { color: var(--racn-chrome-text); }

/* ── Cards ──────────────────────────────────────────────────────────────── */
.racn-card {
	background: var(--racn-surface);
	border: 1px solid var(--racn-border);
	border-radius: var(--racn-radius);
	box-shadow: var(--racn-shadow);
	margin-bottom: 16px;
	overflow: hidden;
}
.racn-card:last-child { margin-bottom: 0; }
.racn-card-header {
	display: flex; align-items: center; gap: 8px;
	padding: 10px 16px;
	background: var(--racn-blue);
	color: var(--racn-chrome-text);
	font-size: 13px; font-weight: 600;
	border-radius: var(--racn-radius) var(--racn-radius) 0 0;
}
.racn-card-header img,
.racn-card-icon { width: 24px; height: 24px; filter: brightness(0) invert(1); flex-shrink: 0; }
/* Placeholder mask for headers whose real icon isn't in place yet. */
.racn-card-header:not(:has(img))::before {
	content: ""; width: 24px; height: 24px; flex-shrink: 0;
	background-color: currentColor;
	-webkit-mask: url(../icons/default.svg) center / contain no-repeat;
	mask: url(../icons/default.svg) center / contain no-repeat;
}
.racn-card-header-badge { margin-left: auto; font-size: 10px; }
.racn-card-body { padding: 16px; }
.racn-card-body > p:first-child { margin-top: 0; }
.racn-card-body > :last-child { margin-bottom: 0; }

/* ── Status / key table rows ────────────────────────────────────────────── */
.racn-rows { width: 100%; border-collapse: collapse; font-size: 13px; }
.racn-rows th, .racn-rows td { padding: 9px 10px; border-bottom: 1px solid #eef0f2; text-align: left; vertical-align: middle; }
.racn-rows tr:last-child th, .racn-rows tr:last-child td { border-bottom: none; }
.racn-rows th { width: 150px; color: var(--racn-text-muted); font-weight: 600; }
.racn-rows td { font-weight: 600; color: var(--racn-text); }
/* Status value cues (house convention: green on / muted off / amber warn). */
.racn-rows .is-on   { color: var(--racn-green); }
.racn-rows .is-off  { color: var(--racn-text-muted); }
.racn-rows .is-warn { color: #b26b00; }
.racn-key-display { font-size: 12px; background: #f4f5f6; padding: 2px 8px; border-radius: 3px; letter-spacing: 1px; font-family: monospace; }
.racn-tier-badge { display: inline-block; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 2px 9px; border-radius: 20px; }
.racn-tier-badge--pro { background: var(--racn-gold); color: #1a1a2e; }
.racn-tier-badge--free { background: var(--racn-bg); color: var(--racn-text-muted); border: 1px solid var(--racn-border); }
.racn-muted { color: var(--racn-text-muted); }

/* ── Form fields ────────────────────────────────────────────────────────── */
.racn-field { margin-bottom: 18px; }
.racn-field:last-child { margin-bottom: 0; }
.racn-field-row--toggle { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.racn-label { display: block; font-size: 13px; font-weight: 600; color: #444; margin-bottom: 6px; }
.racn-hint { font-size: 12px; color: var(--racn-text-muted); margin: 6px 0 0; line-height: 1.5; }
.racn-hint--flush { margin-top: 0; }
.racn-rangerow { display: flex; align-items: center; gap: 12px; }
.racn-range { flex: 1; min-width: 0; cursor: pointer; accent-color: var(--racn-blue); }
.racn-range-val { font-size: 12px; font-weight: 700; color: var(--racn-blue); min-width: 42px; }

/* Radio list */
.racn-radios { display: flex; flex-direction: column; gap: 8px; }
.racn-radios label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--racn-text); cursor: pointer; }

/* ── Toggle switch (RobArt house pattern — slider is a sibling span) ─────── */
.racn-toggle {
	display: flex !important;
	align-items: center;
	gap: 0;
	cursor: pointer;
	margin: 0 !important;
	flex-shrink: 0;
}
.racn-toggle input { display: none; }
.racn-toggle__slider {
	width: 44px;
	height: 24px;
	background: var(--racn-toggle-off);
	border-radius: 12px;
	position: relative;
	flex-shrink: 0;
	transition: background 0.2s;
}
.racn-toggle__slider::after {
	content: '';
	position: absolute;
	top: 3px; left: 3px;
	width: 18px; height: 18px;
	background: #fff;
	border-radius: 50%;
	transition: transform 0.2s;
	box-shadow: 0 1px 3px rgba(0,0,0,0.3);
	z-index: 1;
}
.racn-toggle__slider::before {
	content: '\2715';                 /* ✕ */
	position: absolute;
	top: 0; right: 8px;
	height: 24px;
	display: flex; align-items: center;
	font-size: 10px; font-weight: 700;
	color: #fff;
	opacity: 0.9;
}
.racn-toggle input:checked ~ .racn-toggle__slider { background: var(--racn-blue); }
.racn-toggle input:checked ~ .racn-toggle__slider::after { transform: translateX(20px); }
.racn-toggle input:checked ~ .racn-toggle__slider::before {
	content: '\2713';                 /* ✓ */
	right: auto; left: 8px;
}
.racn-toggle--activate input:checked ~ .racn-toggle__slider { background: var(--racn-green); }
.racn-toggle--disabled .racn-toggle__slider { opacity: 0.4; cursor: not-allowed; }

/* ── Buttons ────────────────────────────────────────────────────────────── */
.racn-btn { display: inline-block; padding: 8px 20px; border-radius: 5px; font-size: 13px; font-weight: 600; cursor: pointer; border: none; text-decoration: none; line-height: 1.4; font-family: inherit; transition: opacity .15s; }
.racn-btn:hover { opacity: .85; }
.racn-btn:disabled { opacity: 0.35; cursor: not-allowed; pointer-events: none; }
.racn-btn--primary { background: var(--racn-blue); color: var(--racn-chrome-text); }
.racn-btn--accent { background: var(--racn-gold); color: #1a1a2e; }
.racn-btn--secondary { background: var(--racn-bg); color: var(--racn-blue); border: 1.5px solid var(--racn-border); }
.racn-btn--secondary:hover { background: var(--racn-border); opacity: 1; }
.racn-btn--sm { font-size: 12px; padding: 4px 12px; }
.racn-btn-hero { background: var(--racn-blue); color: #fff; padding: 11px 26px; font-size: 14px; border-radius: 6px; }

/* ── Save bar (per-form footer button row) ──────────────────────────────── */
.racn-form-actions { margin-top: 16px; }

/* ── Sidebar card links (legacy in-card links, kept harmless) ───────────── */
.racn-card-body a { color: var(--racn-blue); text-decoration: none; }
.racn-card-body a:hover { text-decoration: underline; }

/* Link-buttons keep their own colours. The card-link rule above (.racn-card-body a)
   is more specific than .racn-btn-*, and turned the blue "Get CatchNet Pro" button's
   text blue on blue. */
.racn-card-body a.racn-btn,
.racn-card-body a.racn-btn:hover,
.racn-card-body a.racn-btn:focus { text-decoration: none; }
.racn-card-body a.racn-btn--primary { color: var(--racn-chrome-text); }
.racn-card-body a.racn-btn--accent { color: #1a1a2e; }
.racn-card-body a.racn-btn--secondary { color: var(--racn-blue); }
a.racn-btn-hero,
a.racn-btn-hero:visited,
a.racn-btn-hero:hover,
a.racn-btn-hero:focus,
.racn-card-body a.racn-btn-hero { color: #fff; }

/* ── Hidden utility ─────────────────────────────────────────────────────── */
.racn-hidden { display: none !important; }

/* ── Upgrade panel (Free tier) ──────────────────────────────────────────── */
.racn-upsell__lead { font-size: 14px; line-height: 1.6; color: #3c434a; margin: 0 0 14px; }
.racn-upsell__features { margin: 0 0 20px; padding: 0; list-style: none; }
.racn-upsell__features li { position: relative; padding-left: 24px; margin: 0 0 8px; color: var(--racn-text); font-size: 13.5px; }
.racn-upsell__features li::before { content: "\2713"; position: absolute; left: 0; top: 0; color: var(--racn-blue); font-weight: 700; }
.racn-upsell__tiers { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin: 0 0 22px; }
.racn-upsell__tier { position: relative; border: 1px solid var(--racn-border); border-radius: 10px; padding: 18px 14px; text-align: center; background: var(--racn-bg); }
.racn-upsell__tier--hl { border-color: var(--racn-blue); background: #fff; box-shadow: 0 0 0 2px rgba(81,132,179,.25); }
.racn-upsell__badge { position: absolute; top: -10px; left: 50%; transform: translateX(-50%); background: var(--racn-blue); color: #fff; font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 3px 10px; border-radius: 20px; white-space: nowrap; }
.racn-upsell__tier-name { display: block; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--racn-text-muted); margin: 2px 0 6px; }
.racn-upsell__price { display: block; font-size: 30px; font-weight: 800; color: var(--racn-text); line-height: 1.1; }
.racn-upsell__note { display: block; font-size: 12px; color: var(--racn-text-muted); margin-top: 4px; }
.racn-upsell__cta { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin: 0; }
.racn-upsell__reassure { color: var(--racn-text-muted); font-size: 12.5px; }

/* ── Doc viewer ─────────────────────────────────────────────────────────── */
.racn-doc {
	max-width: 820px;
	background: #fff;
	border: 1px solid var(--racn-border);
	border-radius: 6px;
	padding: 8px 22px;
}
.racn-doc pre { white-space: pre-wrap; word-break: break-word; }
.racn-doc-back { display: inline-block; margin-bottom: 4px; }
