/*
 * Seraphina Core base styles. Brand tokens from the brand guide. Body text is
 * dark (#333) for readability; grey is reserved for input placeholders only.
 * Minimum font size is 16px, scaling up from there. Primary CTAs carry a right
 * arrow to signal progress. UK English, no em dashes.
 */

:root {
	--sx-signal: #4F3FE0;
	--sx-signal-2: #7E73EF;
	--sx-signal-soft: #ECEAFD;
	--sx-ink: #15161B;
	--sx-text-2: #333333;     /* body and secondary text (never lighter) */
	--sx-placeholder: #6A6E78; /* the only place grey is allowed */
	--sx-paper: #FAFAF8;
	--sx-cloud: #F2F1ED;
	--sx-line: #E8E7E2;
	--sx-bar: #9CA0AA;        /* non-text bar fill for peer rows */
	--sx-pos: #2F7D5B;
	--sx-pos-soft: #E7F1EC;
	--sx-neg: #C0553C;
	--sx-neg-soft: #F8ECE7;
	--sx-r: 14px;
	--sx-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	--sx-mono: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
}

.seraphina-surface {
	font-family: var(--sx-sans);
	color: var(--sx-ink);
	line-height: 1.55;
	font-size: 16px;
	-webkit-font-smoothing: antialiased;
}
.seraphina-surface *,
.seraphina-surface *::before,
.seraphina-surface *::after { box-sizing: border-box; }

.sx-wrap { max-width: 560px; margin: 0 auto; padding: 32px 20px 64px; }
.sx-wrap-wide { max-width: 920px; }

.sx-card {
	background: #fff;
	border: 1px solid var(--sx-line);
	border-radius: var(--sx-r);
	padding: 28px;
}

.sx-h1 { font-size: 30px; line-height: 1.2; font-weight: 600; margin: 0 0 10px; letter-spacing: -0.01em; color: var(--sx-ink); }
.sx-h2 { font-size: 22px; font-weight: 600; margin: 0 0 8px; color: var(--sx-ink); }
.sx-sub { color: var(--sx-text-2); margin: 0 0 22px; font-size: 18px; }
.sx-label { display: block; font-size: 16px; font-weight: 600; margin: 0 0 6px; color: var(--sx-ink); }
.sx-eyebrow { font-family: var(--sx-mono); font-size: 16px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--sx-signal); margin: 0 0 12px; }

.sx-field { margin: 0 0 16px; }
.sx-input, .sx-select {
	width: 100%;
	font-family: var(--sx-sans);
	font-size: 18px;
	padding: 16px 16px;
	min-height: 58px;
	border: 1px solid var(--sx-line);
	border-radius: 10px;
	background: var(--sx-paper);
	color: var(--sx-ink);
}
.sx-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2315161B' stroke-width='2' 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 12px center; background-size: 18px; padding-right: 40px; }
.sx-input:focus, .sx-select:focus { outline: none; border-color: var(--sx-signal); box-shadow: 0 0 0 3px var(--sx-signal-soft); }
.seraphina-surface input::placeholder,
.seraphina-surface textarea::placeholder { color: var(--sx-placeholder); }

.sx-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	font-family: var(--sx-sans); font-size: 16px; font-weight: 600;
	padding: 13px 22px; border-radius: 10px; border: 1px solid transparent;
	cursor: pointer; text-decoration: none; transition: background .15s, opacity .15s;
}
.sx-btn-primary { background: var(--sx-signal); color: #fff; width: 100%; }
.sx-btn-primary:hover { background: #4536c4; }
.sx-btn-primary:disabled { opacity: .55; cursor: default; }
/* Right arrow on every primary CTA, hidden while the button is working. */
.sx-btn-primary::after {
	content: ""; width: 18px; height: 18px; flex: 0 0 auto;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E");
	background-size: contain; background-repeat: no-repeat; background-position: center;
}
.sx-btn-primary:disabled::after { display: none; }
.sx-btn-ghost { background: #fff; color: var(--sx-ink); border-color: var(--sx-line); }
.sx-btn-ghost:hover { background: var(--sx-cloud); }
.sx-btn-link { background: none; border: none; color: var(--sx-signal); cursor: pointer; font-weight: 600; padding: 0; font-size: 16px; }
.sx-btn-link.is-disabled, .sx-btn-link:disabled { color: var(--sx-placeholder); cursor: default; }

.sx-choice-row { display: grid; gap: 12px; margin: 0 0 18px; }
.sx-choice {
	display: flex; align-items: center; gap: 14px;
	padding: 16px 18px; border: 1px solid var(--sx-line); border-radius: 12px;
	background: #fff; cursor: pointer; font-size: 17px; font-weight: 600; text-align: left; width: 100%; color: var(--sx-ink);
	transition: border-color .15s, background .15s, box-shadow .15s, transform .05s;
}
.sx-choice:hover { border-color: var(--sx-signal); background: var(--sx-signal-soft); box-shadow: 0 4px 14px rgba(79,63,224,.10); }
.sx-choice:active { transform: translateY(1px); }
.sx-choice-ico { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: var(--sx-cloud); flex: 0 0 auto; }
.sx-choice:hover .sx-choice-ico { background: #fff; }
.sx-choice-ico svg { display: block; }
.sx-ico-linkedin { color: #0A66C2; }
.sx-ico-instagram { color: #E1306C; }
.sx-ico-x { color: #15161B; }
.sx-choice-label { flex: 1; }
.sx-choice::after {
	content: ""; width: 18px; height: 18px; flex: 0 0 auto; opacity: .5;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2315161B' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6l6 6-6 6'/%3E%3C/svg%3E");
	background-size: contain; background-repeat: no-repeat; background-position: center;
}
.sx-choice:hover::after { opacity: 1; }

.sx-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.sx-chip {
	font-size: 16px; padding: 8px 14px; border-radius: 999px;
	border: 1px solid var(--sx-line); background: #fff; cursor: pointer; color: var(--sx-ink);
}
.sx-chip.is-selected { border-color: var(--sx-signal); background: var(--sx-signal-soft); color: var(--sx-signal); }

.sx-err { color: var(--sx-neg); font-size: 16px; margin: 10px 0 0; min-height: 20px; }
.sx-muted { color: var(--sx-text-2); font-size: 16px; }

/* OTP */
.sx-otp { display: flex; gap: 8px; justify-content: space-between; margin: 0 0 8px; }
.sx-otp input {
	width: 100%; aspect-ratio: 1 / 1; text-align: center; font-size: 24px; font-family: var(--sx-mono);
	border: 1px solid var(--sx-line); border-radius: 10px; background: var(--sx-paper); color: var(--sx-ink);
}
.sx-otp input:focus { outline: none; border-color: var(--sx-signal); box-shadow: 0 0 0 3px var(--sx-signal-soft); }

/* Scan animation */
.sx-scan { text-align: center; padding: 24px 0; }
.sx-scan-orb {
	width: 64px; height: 64px; margin: 0 auto 22px; border-radius: 50%;
	background: radial-gradient(circle at 35% 30%, var(--sx-signal-2), var(--sx-signal));
	animation: sx-pulse 1.4s ease-in-out infinite;
}
@keyframes sx-pulse { 0%,100% { transform: scale(1); opacity: .85; } 50% { transform: scale(1.12); opacity: 1; } }
.sx-scan-list { height: 28px; overflow: hidden; position: relative; margin-top: 14px; }
.sx-scan-item { font-family: var(--sx-mono); font-size: 16px; color: var(--sx-text-2); height: 28px; line-height: 28px; }

.sx-spin { width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.5); border-top-color: #fff; border-radius: 50%; animation: sx-rot .7s linear infinite; display: inline-block; }
@keyframes sx-rot { to { transform: rotate(360deg); } }

/* Reveal */
.sx-hero-count { font-size: 40px; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 6px; color: var(--sx-ink); }
.sx-hero-count .sx-num { color: var(--sx-signal); }
.sx-mention { border: 1px solid var(--sx-line); border-radius: var(--sx-r); padding: 20px; margin: 18px 0; background: var(--sx-pos-soft); }
.sx-quote { font-size: 18px; line-height: 1.45; margin: 0 0 12px; color: var(--sx-ink); }
.sx-meta { font-family: var(--sx-mono); font-size: 16px; color: var(--sx-text-2); display: flex; flex-wrap: wrap; gap: 12px; }

.sx-locked {
	display: flex; align-items: center; justify-content: space-between; gap: 12px;
	border: 1px dashed var(--sx-line); border-radius: 12px; padding: 16px 18px; margin: 12px 0; background: var(--sx-cloud);
}
.sx-locked .sx-locked-label { font-weight: 600; font-size: 16px; color: var(--sx-ink); }
.sx-locked .sx-locked-sub { font-size: 16px; color: var(--sx-text-2); }
.sx-lock { font-family: var(--sx-mono); font-size: 16px; color: var(--sx-signal); white-space: nowrap; font-weight: 600; text-decoration: none; }

/* Share of voice */
.sx-sov { margin: 18px 0; }
.sx-sov-row { display: grid; grid-template-columns: 120px 1fr 48px; align-items: center; gap: 10px; margin: 0 0 8px; font-size: 16px; }
.sx-sov-name { color: var(--sx-text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sx-sov-row.is-you .sx-sov-name { color: var(--sx-ink); font-weight: 600; }
.sx-sov-bar { background: var(--sx-cloud); border-radius: 999px; height: 12px; overflow: hidden; }
.sx-sov-fill { height: 100%; background: var(--sx-bar); border-radius: 999px; }
.sx-sov-row.is-you .sx-sov-fill { background: var(--sx-signal); }
.sx-sov-pct { font-family: var(--sx-mono); font-size: 16px; text-align: right; color: var(--sx-text-2); }

.sx-cta { margin-top: 24px; }
.sx-fade { animation: sx-fade .35s ease; }
@keyframes sx-fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.sx-stub { color: var(--sx-text-2); font-family: var(--sx-mono); font-size: 16px; }

/* ------------------------------------------------------------------ */
/* App surfaces                                                        */
/* ------------------------------------------------------------------ */

.sx-app { display: grid; grid-template-columns: 200px 1fr; gap: 24px; }
@media (max-width: 720px) { .sx-app { grid-template-columns: 1fr; } }
.sx-nav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 20px; align-self: start; }
@media (max-width: 720px) { .sx-nav { flex-direction: row; flex-wrap: wrap; position: static; } }
.sx-nav-link {
	display: block; padding: 10px 12px; border-radius: 10px; color: var(--sx-text-2);
	text-decoration: none; font-weight: 500; font-size: 16px; background: none; border: none; cursor: pointer; text-align: left;
}
.sx-nav-link:hover { background: var(--sx-cloud); color: var(--sx-ink); }
.sx-nav-out { color: var(--sx-text-2); margin-top: 8px; }
.sx-app-body { min-width: 0; }
.sx-app-body .sx-card { margin: 0 0 16px; }

.sx-stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 0 0 16px; }
.sx-stat { background: #fff; border: 1px solid var(--sx-line); border-radius: var(--sx-r); padding: 18px; text-align: center; }
.sx-stat-n { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; color: var(--sx-ink); }
.sx-stat-l { font-size: 16px; color: var(--sx-text-2); }

.sx-pulse-row { display: flex; align-items: center; gap: 16px; margin: 6px 0 14px; }
.sx-pulse-index { font-size: 44px; font-weight: 700; color: var(--sx-signal); letter-spacing: -0.02em; line-height: 1; }
.sx-pulse-head { font-weight: 600; font-size: 16px; color: var(--sx-ink); }
.sx-meter { background: var(--sx-cloud); border-radius: 999px; height: 10px; overflow: hidden; }
.sx-meter-fill { height: 100%; background: linear-gradient(90deg, var(--sx-signal-2), var(--sx-signal)); border-radius: 999px; }

.sx-mention-row { border-top: 1px solid var(--sx-line); padding: 14px 0; }
.sx-mention-row:first-of-type { border-top: none; }
.sx-snippet { margin: 0 0 8px; font-size: 16px; color: var(--sx-ink); }
.sx-row-foot { display: flex; align-items: center; gap: 14px; margin-top: 8px; flex-wrap: wrap; }
.sx-badge { font-size: 16px; font-weight: 600; padding: 4px 12px; border-radius: 999px; }
.sx-badge-pos { background: var(--sx-pos-soft); color: var(--sx-pos); }
.sx-badge-neg { background: var(--sx-neg-soft); color: var(--sx-neg); }
.sx-badge-neu { background: var(--sx-cloud); color: var(--sx-text-2); }

.sx-filters { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 14px; }

.sx-opp-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.sx-opp-target { font-size: 18px; font-weight: 600; color: var(--sx-ink); }
.sx-opp-type { font-family: var(--sx-mono); font-size: 16px; color: var(--sx-text-2); text-transform: uppercase; letter-spacing: 0.06em; }
.sx-opp-score { font-family: var(--sx-mono); font-size: 22px; font-weight: 600; color: var(--sx-signal); }
.sx-opp-rationale { margin: 10px 0; font-size: 16px; color: var(--sx-ink); }
.sx-opp-angle { margin: 10px 0; font-size: 16px; color: var(--sx-ink); }
.sx-draft { width: 100%; font-family: var(--sx-mono); font-size: 16px; resize: vertical; margin: 8px 0; color: var(--sx-ink); }
.sx-opp-fb { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--sx-line); }

.sx-tier-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 640px) { .sx-tier-grid { grid-template-columns: 1fr; } }
.sx-tier { background: #fff; border: 1px solid var(--sx-line); border-radius: var(--sx-r); padding: 26px; position: relative; }
.sx-tier.is-featured { border-color: var(--sx-signal); box-shadow: 0 8px 30px rgba(79,63,224,.08); }
.sx-tier.is-featured::after {
	content: 'Most popular'; position: absolute; top: -10px; right: 18px;
	background: var(--sx-signal); color: #fff; font-size: 16px; font-weight: 600;
	padding: 4px 12px; border-radius: 999px;
}
.sx-tier-name { font-family: var(--sx-mono); text-transform: uppercase; letter-spacing: 0.06em; font-size: 16px; color: var(--sx-signal); }
.sx-tier-price { font-size: 34px; font-weight: 700; margin: 6px 0; letter-spacing: -0.02em; color: var(--sx-ink); }
.sx-feat { list-style: none; padding: 0; margin: 16px 0 20px; }
.sx-feat li { padding: 8px 0 8px 26px; position: relative; border-top: 1px solid var(--sx-line); font-size: 16px; color: var(--sx-ink); }
.sx-feat li::before { content: ''; position: absolute; left: 4px; top: 15px; width: 8px; height: 8px; border-radius: 50%; background: var(--sx-signal); }
.sx-current { text-align: center; font-weight: 600; color: var(--sx-pos); padding: 13px; font-size: 16px; }

.sx-term-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px solid var(--sx-line); font-size: 16px; color: var(--sx-ink); }
.sx-kv { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--sx-line); font-size: 16px; }
.sx-kv:first-of-type { border-top: none; }
.sx-kv-k { color: var(--sx-text-2); }
.sx-kv-v { font-weight: 600; color: var(--sx-ink); }

/* ------------------------------------------------------------------ */
/* Polish                                                              */
/* ------------------------------------------------------------------ */

.seraphina-surface a:not(.sx-btn) { color: var(--sx-signal); }
.sx-btn-primary, .sx-btn-primary:hover, .sx-btn-primary:focus { color: #fff; }
.sx-btn-ghost, .sx-btn-ghost:hover, .sx-btn-ghost:focus { color: var(--sx-ink); }
.seraphina-surface button:focus-visible,
.seraphina-surface a:focus-visible,
.seraphina-surface input:focus-visible,
.seraphina-surface select:focus-visible,
.seraphina-surface textarea:focus-visible { outline: 2px solid var(--sx-signal); outline-offset: 2px; }
.sx-btn:active { transform: translateY(1px); }

.seraphina-surface[data-surface="seraphina_landing"] .sx-card { padding: 36px 32px; }
.seraphina-surface[data-surface="seraphina_landing"] .sx-h1 { font-size: 34px; }
.seraphina-surface[data-surface="seraphina_landing"] .sx-sub { font-size: 19px; }
.seraphina-surface[data-surface="seraphina_landing"] .sx-card::before {
	content: ''; display: block; width: 40px; height: 4px; border-radius: 999px;
	background: linear-gradient(90deg, var(--sx-signal-2), var(--sx-signal)); margin: 0 0 18px;
}

@media (max-width: 600px) {
	.sx-wrap { padding: 20px 16px 48px; }
	.sx-card { padding: 22px; }
	.sx-h1 { font-size: 26px; }
}

/* ------------------------------------------------------------------ */
/* Developer console (development only)                                */
/* ------------------------------------------------------------------ */

.sxc-panel {
	position: fixed; left: 0; right: 0; bottom: 0; z-index: 999999;
	background: #15161B; color: #E8E7E2;
	font-family: var(--sx-mono); font-size: 13px; line-height: 1.5;
	border-top: 2px solid #4F3FE0; box-shadow: 0 -6px 24px rgba(0,0,0,.25);
}
.sxc-head { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: #1d1f27; border-bottom: 1px solid #2a2d38; }
.sxc-title { font-weight: 600; color: #fff; }
.sxc-count { background: #4F3FE0; color: #fff; border-radius: 999px; padding: 1px 9px; font-size: 12px; }
.sxc-spacer { flex: 1; }
.sxc-btn { background: #2a2d38; color: #E8E7E2; border: 1px solid #3a3e4b; border-radius: 7px; padding: 5px 12px; font-family: var(--sx-mono); font-size: 13px; cursor: pointer; }
.sxc-btn:hover { background: #353945; }
.sxc-body { max-height: 38vh; overflow-y: auto; padding: 8px 12px; }
.sxc-panel.is-collapsed .sxc-body { display: none; }

.sxc-row { padding: 4px 0; border-bottom: 1px solid #20232c; white-space: pre-wrap; word-break: break-word; }
.sxc-time { color: #6A6E78; margin-right: 8px; }
.sxc-lvl { display: inline-block; min-width: 42px; margin-right: 8px; font-weight: 600; }
.sxc-msg { color: #E8E7E2; }
.sxc-detail { margin: 4px 0 2px 50px; padding: 8px 10px; background: #0f1014; border: 1px solid #20232c; border-radius: 6px; color: #C9CCD4; overflow-x: auto; font-size: 12px; }
.sxc-req .sxc-lvl { color: #A6C8FF; }
.sxc-res .sxc-lvl { color: #6FCF97; }
.sxc-err .sxc-lvl, .sxc-error .sxc-lvl { color: #E88; }
.sxc-warn .sxc-lvl { color: #F6C75E; }
.sxc-info .sxc-lvl { color: #B9A8FF; }
