/*
Theme Name: Connection Protocol
Theme URI: https://theconnectionprotocol.com
Author: Narpender
Description: A single-purpose landing theme for The Connection Protocol baseline diagnostic. Clean white ground, dark text, no navigation on the funnel pages and large tap targets throughout. Built mobile-first for a quiz that is taken almost entirely on phones. Includes styling for the Quiz Maker (AYS) question screens and the Connection Protocol scorecard.
Version: 1.0.4
Requires at least: 5.8
Tested up to: 6.6
Requires PHP: 7.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: connection-protocol
Tags: one-column, custom-colors, custom-menu, editor-style, full-width-template, threaded-comments, translation-ready
*/

/* ==========================================================================
   1. TOKENS
   A cool, slightly blue-leaning neutral rather than a flat grey, so the
   white ground reads as chosen rather than default. Navy accent: calm and
   clinical, which is the register this subject needs. Nothing bright.
   ========================================================================== */

:root {
	--cp-ink:       #1a1c20;
	--cp-ink-soft:  #55585f;
	--cp-ink-faint: #8b8f98;
	--cp-line:      #e3e5e9;
	--cp-bg:        #ffffff;
	--cp-tint:      #f6f7f9;
	--cp-accent:    #1f3a5f;
	--cp-accent-d:  #16293f;
	--cp-accent-bg: #e7ecf3;

	--cp-s1: #2f6b46;   /* stable      */
	--cp-s2: #8a5a12;   /* moderate    */
	--cp-s3: #96341f;   /* critical    */

	--cp-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
	           "Helvetica Neue", Arial, sans-serif;

	--cp-measure: 640px;
	--cp-radius:  10px;
}

/* ==========================================================================
   2. RESET AND BASE
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
	margin: 0;
	background: var(--cp-bg);
	color: var(--cp-ink);
	font-family: var(--cp-font);
	font-size: 17px;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

img, svg, video { max-width: 100%; height: auto; }

a { color: var(--cp-accent); }
a:hover, a:focus { color: var(--cp-accent-d); }

:focus-visible {
	outline: 2px solid var(--cp-accent);
	outline-offset: 3px;
}

h1, h2, h3, h4 {
	margin: 0 0 .5em;
	line-height: 1.2;
	font-weight: 700;
	text-wrap: balance;
}
h1 { font-size: clamp(28px, 6vw, 40px); letter-spacing: -.015em; }
h2 { font-size: clamp(22px, 4.5vw, 28px); }
h3 { font-size: 20px; }

p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}

.skip-link:focus {
	position: fixed;
	top: 8px; left: 8px;
	z-index: 100000;
	width: auto; height: auto;
	clip: auto;
	padding: 12px 18px;
	background: var(--cp-accent);
	color: #fff;
	border-radius: 6px;
	text-decoration: none;
}

/* ==========================================================================
   3. LAYOUT
   ========================================================================== */

.cp-shell {
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}

.cp-main {
	flex: 1 0 auto;
	width: 100%;
	max-width: var(--cp-measure);
	margin: 0 auto;
	padding: 40px 18px 56px;
}

/* The funnel pages get no chrome at all - nothing to click away to. */
.cp-funnel .cp-siteheader,
.cp-funnel .cp-sitenav { display: none; }

.cp-funnel .cp-main { padding-top: 26px; }

@media (max-width: 600px) {
	.cp-main { padding: 24px 14px 44px; }
}

/* ---- header (content pages only) ---- */

.cp-siteheader {
	border-bottom: 1px solid var(--cp-line);
	background: var(--cp-bg);
}
.cp-siteheader-inner {
	max-width: var(--cp-measure);
	margin: 0 auto;
	padding: 18px;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}
.cp-sitetitle {
	margin: 0;
	font-size: 18px;
	font-weight: 700;
	letter-spacing: -.01em;
}
.cp-sitetitle a { color: var(--cp-ink); text-decoration: none; }

.cp-sitenav ul {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: 18px;
	margin: 0;
	padding: 0;
	font-size: 15px;
}
.cp-sitenav a { text-decoration: none; color: var(--cp-ink-soft); }
.cp-sitenav a:hover { color: var(--cp-accent); }

/* ---- footer ---- */

.cp-sitefooter {
	flex-shrink: 0;
	border-top: 1px solid var(--cp-line);
	padding: 22px 18px 30px;
	text-align: center;
	font-size: 13px;
	color: var(--cp-ink-faint);
}
.cp-sitefooter ul {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 16px;
	margin: 0 0 10px;
	padding: 0;
}
.cp-sitefooter a { color: var(--cp-ink-faint); text-decoration: none; }
.cp-sitefooter a:hover { color: var(--cp-accent); text-decoration: underline; }

/* ==========================================================================
   4. QUIZ MAKER (AYS) QUESTION SCREENS
   Class names drift between AYS releases, hence the doubled-up selectors.
   ========================================================================== */

.ays-quiz-container,
.ays_quiz_container {
	max-width: 100% !important;
	margin: 0 auto !important;
	background: var(--cp-bg) !important;
	color: var(--cp-ink) !important;
	border: none !important;
	box-shadow: none !important;
	font-family: var(--cp-font) !important;
	font-size: 17px !important;
}

.ays-quiz-container .ays_quiz_question,
.ays-quiz-container .ays-question-container h3,
.ays-quiz-container .ays_question_text {
	font-size: 20px !important;
	line-height: 1.4 !important;
	font-weight: 600 !important;
	color: var(--cp-ink) !important;
	text-align: left !important;
}

/* answer rows: full-width targets, comfortably above the 44px thumb minimum */
.ays-quiz-container .ays-field,
.ays-quiz-container .ays_quiz_answers label,
.ays-quiz-container .ays-question-container label {
	display: block !important;
	width: 100% !important;
	margin: 0 0 12px !important;
	padding: 16px 18px !important;
	min-height: 56px !important;
	border: 1px solid var(--cp-line) !important;
	border-radius: 8px !important;
	background: var(--cp-bg) !important;
	color: var(--cp-ink) !important;
	font-size: 16px !important;
	line-height: 1.45 !important;
	text-align: left !important;
	cursor: pointer !important;
	transition: border-color .12s ease, background-color .12s ease;
}
.ays-quiz-container .ays-field:hover,
.ays-quiz-container .ays-field:focus-within {
	border-color: var(--cp-accent) !important;
	background: var(--cp-tint) !important;
}

.ays-quiz-container .ays_quiz_progress_bar,
.ays-quiz-container .ays-progress-bar,
.ays-quiz-container .ays-progress {
	background: var(--cp-line) !important;
	border-radius: 999px !important;
	height: 8px !important;
	overflow: hidden !important;
}
.ays-quiz-container .ays_progress_bar_line,
.ays-quiz-container .ays-progress-bar > div,
.ays-quiz-container .ays-progress-value {
	background: var(--cp-accent) !important;
	border-radius: 999px !important;
}

.ays-quiz-container button,
.ays-quiz-container .ays_next_button,
.ays-quiz-container .ays_finish_button,
.ays-quiz-container input[type="submit"] {
	border: none !important;
	border-radius: 8px !important;
	padding: 15px 26px !important;
	background: var(--cp-accent) !important;
	color: #fff !important;
	font-family: var(--cp-font) !important;
	font-size: 16px !important;
	font-weight: 600 !important;
	box-shadow: none !important;
	cursor: pointer !important;
}
.ays-quiz-container .ays_prev_button {
	background: var(--cp-bg) !important;
	color: var(--cp-ink-soft) !important;
	border: 1px solid var(--cp-line) !important;
}

/* 16px stops iOS zooming the viewport when a field takes focus */
.ays-quiz-container input[type="text"],
.ays-quiz-container input[type="email"] {
	width: 100% !important;
	padding: 15px 16px !important;
	font-family: var(--cp-font) !important;
	font-size: 16px !important;
	border: 1px solid var(--cp-line) !important;
	border-radius: 8px !important;
	background: var(--cp-bg) !important;
	color: var(--cp-ink) !important;
}

/* ==========================================================================
   5. THE SCORECARD
   ========================================================================== */

.cp-result {
	max-width: var(--cp-measure);
	margin: 0 auto;
	color: var(--cp-ink);
	font-size: 17px;
	line-height: 1.6;
	text-align: left !important;
}
.cp-result .cp-body,
.cp-result .cp-note,
.cp-result .cp-coach-wrap { text-align: left !important; }
.cp-result .cp-score,
.cp-result .cp-callout    { text-align: center !important; }

.cp-score {
	padding: 24px 20px;
	margin-bottom: 22px;
	border: 1px solid var(--cp-line);
	border-radius: var(--cp-radius);
	background: var(--cp-tint);
}
.cp-score-label {
	display: block;
	font-size: 11px;
	letter-spacing: .16em;
	text-transform: uppercase;
	color: var(--cp-ink-soft);
	margin-bottom: 8px;
}
.cp-score-value {
	display: block;
	font-size: 42px;
	line-height: 1.05;
	font-weight: 700;
	margin-bottom: 12px;
	font-variant-numeric: tabular-nums;
}
.cp-stage {
	display: block;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.4;
	color: var(--cp-accent);
}
.cp-stage-1 { color: var(--cp-s1); }
.cp-stage-2 { color: var(--cp-s2); }
.cp-stage-3 { color: var(--cp-s3); }

.cp-body { margin: 0 0 22px; }
.cp-note { margin: 0 0 14px; font-size: 15px; color: var(--cp-ink-soft); }

.cp-coach-wrap { margin: 0 0 30px; }
.cp-coach-btn,
a.cp-coach-btn {
	display: block;
	width: 100%;
	padding: 15px 20px;
	border: 1.5px solid var(--cp-accent);
	border-radius: 8px;
	background: var(--cp-bg);
	color: var(--cp-accent);
	font-size: 16px;
	font-weight: 600;
	line-height: 1.35;
	text-align: center;
	text-decoration: none;
}
.cp-coach-btn:hover,
.cp-coach-btn:focus { background: var(--cp-tint); color: var(--cp-accent-d); }

.cp-callout {
	padding: 26px 20px;
	border: 1px solid var(--cp-line);
	border-radius: 12px;
	background: var(--cp-tint);
}
.cp-callout-kicker {
	margin: 0 0 8px;
	font-size: 11px;
	letter-spacing: .16em;
	text-transform: uppercase;
	color: var(--cp-ink-soft);
}
.cp-callout-text { margin: 0 0 18px; font-size: 16px; }
.cp-cta-btn,
a.cp-cta-btn,
label.cp-cta-btn {
	display: block;
	width: 100%;
	padding: 18px 22px;
	border: none;
	border-radius: 8px;
	background: var(--cp-accent);
	color: #fff;
	font-family: var(--cp-font);
	font-size: 17px;
	font-weight: 700;
	line-height: 1.35;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
}
.cp-cta-btn:hover,
.cp-cta-btn:focus { background: var(--cp-accent-d); color: #fff; }
.cp-callout-fine { margin: 12px 0 0; font-size: 13px; color: var(--cp-ink-soft); }

/* ---- CSS-only modal, kept for the demand-gate fallback ---- */
.cp-gate-toggle { position: absolute; opacity: 0; pointer-events: none; }
.cp-modal-overlay {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 99999;
	padding: 24px;
	align-items: center;
	justify-content: center;
}
.cp-gate-toggle:checked ~ .cp-modal-overlay { display: flex; }
.cp-modal-backdrop { position: absolute; inset: 0; background: rgba(16,18,22,.55); cursor: pointer; }
.cp-modal {
	position: relative;
	width: 100%;
	max-width: 420px;
	padding: 30px 26px 24px;
	border-radius: 12px;
	background: #fff;
	box-shadow: 0 18px 50px rgba(0,0,0,.24);
	text-align: center;
}
.cp-modal-text { margin: 0 0 22px; font-size: 17px; line-height: 1.55; }
.cp-modal-close {
	display: inline-block;
	padding: 12px 30px;
	border-radius: 8px;
	background: var(--cp-accent);
	color: #fff;
	font-weight: 600;
	cursor: pointer;
}

/* ==========================================================================
   6. EDITOR CONTENT
   ========================================================================== */

.cp-content > * + * { margin-top: 1.1em; }
.cp-content ul, .cp-content ol { padding-left: 1.4em; }
.cp-content li + li { margin-top: .4em; }
.cp-content blockquote {
	margin: 1.4em 0;
	padding: 4px 0 4px 18px;
	border-left: 3px solid var(--cp-accent);
	color: var(--cp-ink-soft);
}
.cp-content table { width: 100%; border-collapse: collapse; }
.cp-content th, .cp-content td {
	padding: 10px 12px;
	border-bottom: 1px solid var(--cp-line);
	text-align: left;
}
.cp-content .wp-block-table { overflow-x: auto; }

.cp-entry-title { margin-bottom: 26px; }
.cp-entry-meta { font-size: 14px; color: var(--cp-ink-faint); margin-bottom: 26px; }

@media (max-width: 600px) {
	body           { font-size: 16px; }
	.cp-score-value { font-size: 36px; }
	.cp-stage      { font-size: 15px; }
	.cp-callout    { padding: 22px 16px; }
	.ays-quiz-container .ays_quiz_question,
	.ays-quiz-container .ays_question_text { font-size: 18px !important; }
}

@media (prefers-reduced-motion: reduce) {
	* { transition: none !important; animation: none !important; }
}


/* =======================================================================
   ACCOUNT GATE
   Shown before question one when the quiz is limited to logged-in users.
   Same white ground and navy accent as the rest of the funnel, so it does
   not feel like WordPress has interrupted the experience.
   ======================================================================= */

.cpk-auth {
  max-width: 460px;
  margin: 0 auto;
  padding: 4px 0 8px;
  color: var(--cp-ink, #1a1a1a);
  font-size: 16px;
  line-height: 1.6;
  text-align: left;
}

.cpk-auth-head { margin-bottom: 22px; text-align: center; }

.cpk-auth-title {
  margin: 0 0 8px;
  font-size: 24px;
  line-height: 1.25;
  font-weight: 700;
  color: var(--cp-ink, #1a1a1a);
}
.cpk-auth-sub {
  margin: 0;
  font-size: 15px;
  color: var(--cp-ink-soft, #55565a);
}

/* ---- tabs ---- */
.cpk-auth-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
  padding: 4px;
  border: 1px solid var(--cp-line, #e2e2e4);
  border-radius: 10px;
  background: var(--cp-tint, #f7f7f8);
}
.cpk-auth-tab {
  flex: 1;
  padding: 11px 10px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--cp-ink-soft, #55565a);
  font: 600 14px/1.2 inherit;
  cursor: pointer;
}
.cpk-auth-tab.is-active {
  background: #fff;
  color: var(--cp-accent, #1f3a5f);
  box-shadow: 0 1px 3px rgba(20,24,31,.10);
}
.cpk-auth-tab:focus-visible {
  outline: 2px solid var(--cp-accent, #1f3a5f);
  outline-offset: 2px;
}

/* ---- fields ---- */
.cpk-auth-label {
  display: block;
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 600;
}
.cpk-auth-input,
.cpk-auth-form input[type="text"],
.cpk-auth-form input[type="email"],
.cpk-auth-form input[type="password"] {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin: 0 0 16px;
  padding: 14px 15px;
  border: 1px solid var(--cp-line, #e2e2e4);
  border-radius: 8px;
  background: #fff;
  color: var(--cp-ink, #1a1a1a);
  font-family: inherit;
  font-size: 16px;   /* 16px stops iOS zooming the page on focus */
  line-height: 1.4;
}
.cpk-auth-input:focus,
.cpk-auth-form input:focus {
  border-color: var(--cp-accent, #1f3a5f);
  outline: none;
  box-shadow: 0 0 0 3px rgba(31,58,95,.12);
}

.cpk-auth-hint {
  margin: -10px 0 18px;
  font-size: 13px;
  color: var(--cp-ink-soft, #55565a);
}

.cpk-auth-submit,
.cpk-auth-form .button,
.cpk-auth-form input[type="submit"],
.cpk-auth-form #wp-submit {
  display: block;
  width: 100%;
  padding: 16px 20px;
  border: none;
  border-radius: 8px;
  background: var(--cp-accent, #1f3a5f);
  color: #fff;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
  cursor: pointer;
}
.cpk-auth-submit:hover,
.cpk-auth-form #wp-submit:hover { background: var(--cp-accent-d, #16293f); }

.cpk-auth-error {
  margin: 0 0 18px;
  padding: 12px 14px;
  border: 1px solid #e6c3bb;
  border-left: 3px solid #96341f;
  border-radius: 6px;
  background: #fdf4f2;
  color: #7c2b19;
  font-size: 14px;
}

/* WordPress's own login form, tidied to match */
.cpk-auth .login-remember { margin: 0 0 16px; font-size: 14px; color: var(--cp-ink-soft, #55565a); }
.cpk-auth .login-remember input { width: auto; margin-right: 6px; }
.cpk-auth p.login-submit { margin: 0; }

/* Honeypot - visible to bots, never to people */
.cpk-hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

@media (max-width: 600px) {
  .cpk-auth-title { font-size: 21px; }
}


/* =======================================================================
   ORDER SUMMARY, GUARANTEE AND THE ONE-CLICK BUMP
   Drawn above the $27 button, inside the callout box. Stripe's own
   checkout page cannot be edited from outside, so everything that has to
   reassure the buyer has to live here, before they leave the page.
   ======================================================================= */

.cp-order {
  margin: 0 0 18px;
  padding: 16px 16px 6px;
  border: 1px solid var(--cp-line, #e2e2e4);
  border-radius: 10px;
  background: #fff;
  text-align: left;
}

.cp-order-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding: 0 0 12px;
  font-size: 15px;
  line-height: 1.45;
  color: var(--cp-ink, #1a1a1a);
}
.cp-order-amount { font-variant-numeric: tabular-nums; white-space: nowrap; }

.cp-order-total {
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--cp-line, #e2e2e4);
  font-weight: 700;
  font-size: 16px;
}

/* ---- the bump ---- */
.cp-bump {
  display: flex;
  gap: 11px;
  margin: 0 0 12px;
  padding: 13px 14px;
  border: 1px dashed var(--cp-accent, #1f3a5f);
  border-radius: 8px;
  background: var(--cp-tint, #f7f7f8);
  cursor: pointer;
  text-align: left;
}
.cp-bump:hover { background: #eef1f6; }

.cp-bump-check {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  accent-color: var(--cp-accent, #1f3a5f);
  cursor: pointer;
}

.cp-bump-text { display: block; }

.cp-bump-head {
  display: block;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--cp-ink, #1a1a1a);
}

.cp-bump-note {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--cp-ink-soft, #55565a);
}

/* ---- reassurance under the button ---- */
.cp-assure { margin-top: 12px; }

.cp-guarantee,
.cp-trust {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--cp-ink-soft, #55565a);
  text-align: center;
}
.cp-guarantee {
  font-weight: 600;
  color: var(--cp-ink, #1a1a1a);
  margin-bottom: 4px;
}

@media (max-width: 600px) {
  .cp-order      { padding: 14px 13px 4px; }
  .cp-order-row  { font-size: 14px; }
  .cp-bump-head  { font-size: 14px; }
}

/* ---- security badge ---------------------------------------------------- */

.cp-badge-wrap {
  margin: 0 0 6px;
  text-align: center;
}

.cp-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border: 1px solid var(--cp-line, #e2e2e4);
  border-radius: 999px;
  background: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
  line-height: 1;
  color: var(--cp-ink, #1a1a1a);
  white-space: nowrap;
}

.cp-badge-lock {
  display: block;
  flex: 0 0 auto;
  color: #2f6b46;   /* a padlock reads as green; the accent is used elsewhere */
}

@media (max-width: 380px) {
  .cp-badge { font-size: 11px; padding: 6px 11px; }
}
