/* =========================================================================
   Complete IT — Business IT Health Check
   Scoped under .cihc so it never bleeds into the Avada theme.
   Brand colours live in the :root block below — change them in ONE place.
   ========================================================================= */

/* Self-hosted brand typeface (variable weight 200–800). No external request. */
@font-face {
	font-family: "Plus Jakarta Sans";
	src: url("../fonts/PlusJakartaSans-VariableFont_wght.ttf") format("truetype-variations"),
	     url("../fonts/PlusJakartaSans-VariableFont_wght.ttf") format("truetype");
	font-weight: 200 800;
	font-style: normal;
	font-display: swap;
}

.cihc {
	/* ---- Brand tokens (Complete IT — near-black + orange, per layout) ---- */
	--cihc-ink:       #1E1E1E;   /* primary text + dark panels (near-black)   */
	--cihc-panel:     #1E1E1E;   /* intro / results dark header band          */
	--cihc-panel-2:   #2A2A2A;   /* panel gradient partner                    */
	--cihc-surface:   #ffffff;   /* card background                           */
	--cihc-surface-2: #F7F6F3;   /* subtle option background                  */
	--cihc-line:      #E6E3DD;   /* hairline borders                          */
	--cihc-accent:    #F79420;   /* bright brand orange — header band, fills  */
	--cihc-accent-2:  #F05A29;   /* deep red-orange — progress fill + buttons */
	--cihc-peach:     #FCDCB6;   /* selected-option background                */
	--cihc-btn-text:  #ffffff;   /* text on the deep-orange buttons (AA)      */
	--cihc-on-accent: #1E1E1E;   /* text on the bright orange header band     */
	--cihc-muted:     #6B6A66;   /* secondary text                           */

	/* ---- Status band colours (semantic risk scale — leave as-is) ---- */
	--cihc-green:  #16A34A;
	--cihc-yellow: #D69E00;
	--cihc-orange: #F26419;
	--cihc-red:    #E5484D;

	/* ---- Type + shape ---- */
	--cihc-font-display: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
	--cihc-font-body:    "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
	--cihc-radius:   16px;
	--cihc-radius-sm:11px;
	--cihc-shadow:   0 24px 60px -22px rgba(20, 20, 20, .34);

	/* container */
	max-width: 760px;
	margin: 0 auto;
	font-family: var(--cihc-font-body);
	color: var(--cihc-ink);
	line-height: 1.55;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

/* Reset just inside the component so the theme can't distort it. */
.cihc *,
.cihc *::before,
.cihc *::after { box-sizing: border-box; }

.cihc p { margin: 0 0 1em; }
.cihc h1, .cihc h2, .cihc h3 { font-family: var(--cihc-font-display); margin: 0; line-height: 1.15; font-weight: 700; letter-spacing: -0.01em; }

.cihc-noscript {
	background: var(--cihc-surface);
	border: 1px solid var(--cihc-line);
	border-radius: var(--cihc-radius);
	padding: 32px;
	text-align: center;
}

/* The app shell that the JS renders into. */
.cihc-app {
	position: relative;
	background: var(--cihc-surface);
	border-radius: var(--cihc-radius);
	box-shadow: var(--cihc-shadow);
	overflow: hidden;
	min-height: 420px;
}

/* =========================================================================
   Screen transitions (honour reduced motion)
   ========================================================================= */
.cihc-screen { display: none; }
.cihc-screen.is-active { display: block; animation: cihc-fade .32s ease both; }

@keyframes cihc-fade {
	from { opacity: 0; transform: translateY(10px); }
	to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
	.cihc-screen.is-active { animation: none; }
	.cihc-gauge-arc { transition: none !important; }
}

/* =========================================================================
   Progress rail
   ========================================================================= */
/* =========================================================================
   Question header band (orange) — back arrow, section title, counter, ticks
   ========================================================================= */
.cihc-qhead {
	background: var(--cihc-accent);
	color: var(--cihc-on-accent);
	padding: 22px 26px 20px;
	border-radius: var(--cihc-radius) var(--cihc-radius) 22px 22px;
}
.cihc-qhead__top { display: flex; align-items: center; gap: 14px; }
.cihc-qhead__back {
	-webkit-appearance: none; appearance: none;
	flex: 0 0 auto;
	width: 42px; height: 42px;
	padding: 0;
	border: none; border-radius: 50%;
	background: var(--cihc-ink);
	color: #fff;
	display: flex; align-items: center; justify-content: center;
	line-height: 0;
	cursor: pointer;
	transition: transform .08s, opacity .2s;
}
.cihc-qhead__back svg { display: block; }
.cihc-qhead__back:hover { opacity: .9; }
.cihc-qhead__back:active { transform: scale(.94); }
.cihc-qhead__back:focus-visible { outline: 2px solid var(--cihc-ink); outline-offset: 3px; }
.cihc-qhead__title {
	font-family: var(--cihc-font-display);
	font-size: 20px; font-weight: 700; letter-spacing: -0.01em;
	color: var(--cihc-on-accent);
}
.cihc-qhead__meta {
	display: flex; align-items: baseline; justify-content: space-between;
	margin: 16px 0 12px;
	font-family: var(--cihc-font-display);
	font-weight: 600; font-size: 15px;
	color: var(--cihc-on-accent);
}
.cihc-qhead__total { opacity: .9; }
.cihc-qhead__bar { display: flex; gap: 6px; }
.cihc-qhead__tick {
	flex: 1; height: 5px; border-radius: 999px;
	background: rgba(30,30,30,.18);
	transition: background .3s;
}
.cihc-qhead__tick.is-on { background: var(--cihc-accent-2); }

/* =========================================================================
   Intro screen
   ========================================================================= */
.cihc-intro {
	position: relative;
	padding: 56px 44px 48px;
	color: #fff;
	background:
		radial-gradient(120% 120% at 100% 0%, rgba(247,148,32,.20), transparent 55%),
		linear-gradient(160deg, var(--cihc-panel) 0%, var(--cihc-panel-2) 100%);
	overflow: hidden;
}
/* subtle scan-grid motif — the brand is network/security */
.cihc-intro::before {
	content: "";
	position: absolute; inset: 0;
	background-image:
		linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px),
		linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
	background-size: 38px 38px;
	mask-image: radial-gradient(80% 80% at 70% 10%, #000, transparent 75%);
	pointer-events: none;
}
.cihc-intro > * { position: relative; }
.cihc-eyebrow {
	display: inline-flex; align-items: center; gap: 8px;
	font-family: var(--cihc-font-display);
	font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
	color: var(--cihc-accent);
	margin-bottom: 18px;
}
.cihc-eyebrow::before {
	content: ""; width: 8px; height: 8px; border-radius: 50%;
	background: var(--cihc-accent);
	box-shadow: 0 0 0 4px rgba(247,148,32,.25);
}
.cihc-intro h1 { font-size: clamp(28px, 5vw, 40px); margin-bottom: 14px; color: #fff; }
.cihc-intro__desc { color: rgba(255,255,255,.82); font-size: 16px; max-width: 52ch; }
.cihc-intro__meta {
	margin: 26px 0 30px;
	font-size: 13px; color: rgba(255,255,255,.62);
	font-family: var(--cihc-font-display); letter-spacing: .02em;
}

/* =========================================================================
   Question screens
   ========================================================================= */
.cihc-q { padding: 34px 44px 40px; }
.cihc .cihc-q__prompt {
	font-size: clamp(20px, 3.4vw, 26px);
	margin-bottom: 40px;
	max-width: 30ch;
}
.cihc-options { display: flex; flex-direction: column; gap: 12px; }

.cihc-option {
	display: flex;
	align-items: flex-start;
	gap: 14px;
	width: 100%;
	text-align: left;
	font-family: var(--cihc-font-body);
	font-size: 15.5px;
	line-height: 1.45;
	color: var(--cihc-ink);
	background: var(--cihc-surface-2);
	border: 1.5px solid transparent;
	border-radius: var(--cihc-radius-sm);
	padding: 16px 18px;
	cursor: pointer;
	transition: border-color .15s, background .15s, transform .08s;
}
.cihc-option:hover { border-color: var(--cihc-accent); background: rgba(247, 148, 32, .14); }
.cihc-option:active { transform: scale(.995); }
.cihc-option.is-selected { border-color: var(--cihc-accent); background: var(--cihc-peach); }
.cihc-option:focus-visible { outline: 2px solid var(--cihc-accent); outline-offset: 2px; }
.cihc-option__label { flex: 1 1 auto; min-width: 0; white-space: normal; overflow-wrap: break-word; word-break: break-word; }

.cihc-option__marker {
	flex: 0 0 auto;
	width: 22px; height: 22px;
	border-radius: 50%;
	border: 2px solid #D2CEC4;
	margin-top: 1px;
	display: grid; place-items: center;
	transition: border-color .15s;
}
.cihc-option.is-selected .cihc-option__marker { border-color: var(--cihc-accent); }
.cihc-option.is-selected .cihc-option__marker::after {
	content: ""; width: 11px; height: 11px; border-radius: 50%; background: var(--cihc-accent);
}

/* =========================================================================
   Buttons
   ========================================================================= */
.cihc-btn {
	-webkit-appearance: none; appearance: none;
	font-family: var(--cihc-font-display);
	font-weight: 700;
	font-size: 19px;
	letter-spacing: .01em;
	border: none;
	border-radius: 999px;
	padding: 16px 34px;
	cursor: pointer;
	transition: transform .08s, box-shadow .2s, background .2s, opacity .2s;
}
.cihc-btn:focus-visible { outline: 2px solid var(--cihc-accent-2); outline-offset: 3px; }
.cihc-btn--primary {
	color: var(--cihc-btn-text);
	background: var(--cihc-accent-2);
	box-shadow: 0 12px 26px -10px rgba(240,90,41,.5);
}
.cihc-btn--primary:hover { transform: translateY(-1px); box-shadow: 0 16px 30px -10px rgba(240,90,41,.6); }
.cihc-btn--primary:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.cihc-btn--block { display: block; width: 100%; text-align: center; }

.cihc-btn--ghost {
	background: transparent;
	color: var(--cihc-muted);
	font-size: 14px;
	font-weight: 600;
	padding: 8px 6px;
	border-radius: 8px;
}
.cihc-btn--ghost:hover { color: var(--cihc-ink); }
.cihc-btn--ghost:focus-visible { outline: 2px solid var(--cihc-accent); outline-offset: 2px; }

.cihc-q__nav { margin-top: 26px; display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.cihc-q__next { display: none; } /* shown on mobile only; desktop auto-advances */

/* =========================================================================
   Lead capture
   ========================================================================= */
.cihc-lead { padding: 40px 44px 44px; }
.cihc-lead h2 { font-size: clamp(22px, 3.6vw, 28px); margin-bottom: 8px; }
.cihc-lead__sub { color: var(--cihc-muted); margin-bottom: 26px; }
.cihc-field { margin-bottom: 18px; }
.cihc-field label {
	display: block;
	font-family: var(--cihc-font-display);
	font-size: 13px; font-weight: 600;
	margin-bottom: 7px;
}
.cihc-field input[type="text"],
.cihc-field input[type="email"] {
	width: 100%;
	font-family: var(--cihc-font-body);
	font-size: 16px; /* 16px prevents iOS zoom-on-focus */
	color: var(--cihc-ink);
	background: var(--cihc-surface-2);
	border: 1.5px solid var(--cihc-line);
	border-radius: var(--cihc-radius-sm);
	padding: 14px 16px;
	transition: border-color .15s, background .15s;
}
.cihc-field input:focus {
	outline: none;
	border-color: var(--cihc-accent);
	background: #fff;
	box-shadow: 0 0 0 3px rgba(247,148,32,.16);
}
.cihc-field.has-error input { border-color: var(--cihc-red); background: #fff5f5; }
.cihc-field__error { display: none; color: var(--cihc-red); font-size: 13px; margin-top: 6px; }
.cihc-field.has-error .cihc-field__error { display: block; }
.cihc-field__warn { color: var(--cihc-orange); font-size: 13px; margin-top: 6px; }

.cihc-consent { display: flex; gap: 10px; align-items: flex-start; margin: 4px 0 22px; font-size: 14px; color: var(--cihc-muted); }
.cihc-consent input { margin-top: 3px; width: 17px; height: 17px; accent-color: var(--cihc-accent); }

/* honeypot — visually hidden, kept in DOM for bots */
.cihc-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

.cihc-form-error {
	display: none;
	background: #fff5f5;
	border: 1px solid #f3c2c2;
	color: #a11;
	border-radius: var(--cihc-radius-sm);
	padding: 12px 16px;
	margin-bottom: 18px;
	font-size: 14px;
}
.cihc-form-error.is-visible { display: block; }

/* =========================================================================
   Results
   ========================================================================= */
.cihc-results__head {
	padding: 44px 44px 40px;
	color: #fff;
	text-align: center;
	background:
		radial-gradient(110% 130% at 50% -10%, rgba(247,148,32,.16), transparent 60%),
		linear-gradient(160deg, var(--cihc-panel) 0%, var(--cihc-panel-2) 100%);
}

/* signature element: animated semicircular score gauge */
.cihc-gauge { width: 230px; height: 132px; margin: 0 auto 6px; position: relative; }
.cihc-gauge svg { width: 100%; height: 100%; display: block; }
.cihc-gauge-track { fill: none; stroke: rgba(255,255,255,.14); stroke-width: 14; stroke-linecap: round; }
.cihc-gauge-arc   { fill: none; stroke: var(--cihc-accent-2); stroke-width: 14; stroke-linecap: round;
	transition: stroke-dashoffset 1.1s cubic-bezier(.32,.72,.27,1); }
.cihc-gauge__num {
	position: absolute; left: 0; right: 0; bottom: 8px; text-align: center;
	font-family: var(--cihc-font-display); font-weight: 700;
}
.cihc-gauge__num b { font-size: 46px; line-height: 1; }
.cihc-gauge__num span { font-size: 16px; color: rgba(255,255,255,.6); }

.cihc-pill {
	display: inline-flex; align-items: center; gap: 8px;
	font-family: var(--cihc-font-display);
	font-weight: 600; font-size: 15px;
	padding: 8px 16px; border-radius: 999px;
	margin: 8px 0 14px;
	color: #fff;
}
.cihc-pill[data-color="green"]  { background: var(--cihc-green); }
.cihc-pill[data-color="yellow"] { background: var(--cihc-yellow); }
.cihc-pill[data-color="orange"] { background: var(--cihc-orange); }
.cihc-pill[data-color="red"]    { background: var(--cihc-red); }

.cihc-results__head .cihc-results__headline { color: rgba(255,255,255,.88); font-size: 16px; max-width: 46ch; margin-left: auto; margin-right: auto; }

.cihc-results__body { padding: 36px 44px 44px; }
.cihc-section-title {
	font-family: var(--cihc-font-display);
	font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
	color: var(--cihc-ink);
	margin: 0 0 16px;
}
.cihc-gaps { list-style: none; margin: 0 0 32px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.cihc-gap {
	display: flex; flex-direction: column; gap: 9px; align-items: flex-start;
	background: var(--cihc-surface-2);
	border-left: 3px solid var(--cihc-line);
	border-radius: 10px;
	padding: 14px 16px;
}
.cihc-gap[data-kind="trap"]   { border-left-color: var(--cihc-orange); }
.cihc-gap[data-kind="unsure"] { border-left-color: var(--cihc-muted); }
.cihc-gap[data-kind="none"]   { border-left-color: var(--cihc-green); }
.cihc-gap__tag {
	align-self: flex-start;
	font-family: var(--cihc-font-display);
	font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
	padding: 4px 10px; border-radius: 6px;
	color: #fff;
}
.cihc-gap[data-kind="trap"] .cihc-gap__tag   { background: var(--cihc-orange); }
.cihc-gap[data-kind="unsure"] .cihc-gap__tag { background: var(--cihc-muted); }
.cihc-gap[data-kind="none"] .cihc-gap__tag   { background: var(--cihc-green); }
.cihc-gap__text { font-size: 15px; width: 100%; }
.cihc-gap__text strong { display: block; margin-bottom: 3px; }

.cihc-next { background: var(--cihc-surface-2); border-radius: var(--cihc-radius); padding: 26px 26px 8px; margin-bottom: 28px; }
.cihc-next p { font-size: 15px; color: #3A3833; }

.cihc-cta-wrap { text-align: center; }
.cihc-restart {
	-webkit-appearance: none; appearance: none;
	display: flex; align-items: center; justify-content: center; gap: 8px;
	width: fit-content;
	margin: 18px auto 0;
	background: transparent;
	border: none;
	cursor: pointer;
	font-family: var(--cihc-font-display);
	font-size: 14px; font-weight: 600;
	color: var(--cihc-muted);
	padding: 8px 12px;
	border-radius: 999px;
	transition: color .15s, background .15s;
}
.cihc-restart:hover { color: var(--cihc-accent-2); background: rgba(247, 148, 32, .12); }
.cihc-restart:focus-visible { outline: 2px solid var(--cihc-accent); outline-offset: 2px; }
.cihc-restart svg { display: block; }
.cihc-cta {
	display: inline-flex; align-items: center; gap: 10px;
	font-family: var(--cihc-font-display); font-weight: 700; font-size: 19px;
	color: var(--cihc-btn-text); text-decoration: none;
	background: var(--cihc-accent-2);
	padding: 17px 36px; border-radius: 999px;
	box-shadow: 0 14px 30px -10px rgba(240,90,41,.5);
	transition: transform .1s, box-shadow .2s;
}
.cihc-cta:hover { transform: translateY(-1px); box-shadow: 0 18px 34px -10px rgba(240,90,41,.6); color: var(--cihc-btn-text); }
.cihc-cta:focus-visible { outline: 2px solid var(--cihc-accent-2); outline-offset: 3px; }

/* loading + error states */
.cihc-loading { text-align: center; padding: 60px 30px; color: var(--cihc-muted); }
.cihc-spinner {
	width: 34px; height: 34px; margin: 0 auto 16px;
	border: 3px solid var(--cihc-line); border-top-color: var(--cihc-accent);
	border-radius: 50%; animation: cihc-spin .8s linear infinite;
}
@keyframes cihc-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .cihc-spinner { animation-duration: 1.6s; } }

.cihc-expired { text-align: center; padding: 56px 40px; }
.cihc-expired h2 { font-size: 24px; margin-bottom: 10px; }
.cihc-expired p { color: var(--cihc-muted); margin-bottom: 22px; }

/* =========================================================================
   Mobile  (single column, visible Next button, 44px targets)
   ========================================================================= */
@media (max-width: 767px) {
	.cihc-intro,
	.cihc-q,
	.cihc-lead,
	.cihc-results__body { padding-left: 22px; padding-right: 22px; }
	.cihc-intro { padding-top: 42px; padding-bottom: 38px; }
	.cihc-results__head { padding-left: 22px; padding-right: 22px; }
	.cihc-qhead { padding-left: 22px; padding-right: 22px; }

	.cihc-option { font-size: 15px; padding: 15px 16px; min-height: 44px; }
	.cihc-btn { min-height: 48px; }

	/* auto-advance is OFF on mobile — show a deliberate full-width Continue */
	.cihc-q__next { display: inline-flex; justify-content: center; width: 100%; }
	.cihc-q__nav { margin-top: 22px; }
}

@media (max-width: 380px) {
	.cihc-intro h1 { font-size: 26px; }
	.cihc .cihc-q__prompt { font-size: 19px; }
}

/* =========================================================================
   Theme hardening
   Some themes (e.g. Avada) aggressively repaint every <button>/<a> with their
   own accent colour, which can turn the quiz buttons pink/magenta. These rules
   re-assert the Complete IT palette with extra weight (.cihc prefix + !important)
   so the brand colours always win, regardless of the host theme.
   ========================================================================= */
.cihc .cihc-btn--primary,
.cihc .cihc-cta {
	background-color: var(--cihc-accent-2) !important;
	background-image: none !important;
	color: var(--cihc-btn-text) !important;
	border: 0 !important;
	text-decoration: none !important;
}
.cihc .cihc-btn--primary:hover,
.cihc .cihc-cta:hover {
	background-color: var(--cihc-accent-2) !important;
	color: var(--cihc-btn-text) !important;
}
.cihc .cihc-btn--ghost,
.cihc .cihc-restart {
	background-color: transparent !important;
	background-image: none !important;
	border: 0 !important;
	color: var(--cihc-muted) !important;
	text-decoration: none !important;
}
.cihc .cihc-btn--ghost:hover { color: var(--cihc-ink) !important; }
.cihc .cihc-restart:hover { color: var(--cihc-accent-2) !important; background-color: rgba(247, 148, 32, .12) !important; }
.cihc .cihc-qhead__back {
	background-color: var(--cihc-ink) !important;
	background-image: none !important;
	color: #fff !important;
	border: 0 !important;
}
.cihc .cihc-option {
	background-color: var(--cihc-surface-2) !important;
	background-image: none !important;
	border: 1.5px solid transparent !important;
	color: var(--cihc-ink) !important;
}
.cihc .cihc-option:hover { border-color: var(--cihc-accent) !important; background-color: rgba(247, 148, 32, .14) !important; }
.cihc .cihc-option.is-selected { border-color: var(--cihc-accent) !important; background-color: var(--cihc-peach) !important; }
/* Keep the answer text dark in every state — themes often force button text white on hover/active. */
.cihc .cihc-option,
.cihc .cihc-option:hover,
.cihc .cihc-option:focus,
.cihc .cihc-option:active,
.cihc .cihc-option.is-selected,
.cihc .cihc-option .cihc-option__label,
.cihc .cihc-option:hover .cihc-option__label,
.cihc .cihc-option.is-selected .cihc-option__label {
	color: var(--cihc-ink) !important;
	-webkit-text-fill-color: var(--cihc-ink) !important;
}
.cihc .cihc-qhead { background-color: var(--cihc-accent) !important; }
.cihc .cihc-q__prompt { margin-bottom: 40px !important; }
/* Keep long answers wrapping inside the option card (themes can force nowrap). */
.cihc .cihc-option { white-space: normal !important; flex-wrap: nowrap !important; align-items: flex-start !important; }
.cihc .cihc-option__label { flex: 1 1 auto !important; min-width: 0 !important; white-space: normal !important; overflow-wrap: break-word !important; word-break: break-word !important; }
.cihc .cihc-qhead__tick.is-on { background-color: var(--cihc-accent-2) !important; }
.cihc .cihc-option.is-selected .cihc-option__marker { border-color: var(--cihc-accent) !important; }
.cihc .cihc-option.is-selected .cihc-option__marker::after { background-color: var(--cihc-accent) !important; }
