/* ==========================================================================
   Personality Type Profile: quiz portal + A4 report
   Report pages avoid ancestor-dependent selectors so PDF export (which clones
   each page out of the booklet) keeps the exact same styling.
   ========================================================================== */

/* ---------- 1. Portal ---------- */
.tpp-app {
	max-width: 960px;
	margin: 24px auto;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	color: #0f172a;
	line-height: 1.5;
}
.tpp-app *, .tpp-app *::before, .tpp-app *::after { box-sizing: border-box; }

.tpp-screen {
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	padding: 32px;
	box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.06);
}
.tpp-eyebrow {
	display: inline-block;
	background: #eff6ff;
	color: #1d4ed8;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .08em;
	padding: 5px 12px;
	border-radius: 999px;
	margin-bottom: 12px;
	text-transform: uppercase;
}
.tpp-title { font-size: 28px; line-height: 1.2; font-weight: 800; margin: 0 0 10px; color: #0f172a; }
.tpp-lead { font-size: 16px; color: #475569; margin: 0 0 22px; }

.tpp-about { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 26px; }
.tpp-about-card { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; padding: 14px 16px; }
.tpp-about-card h3 { margin: 0 0 6px; font-size: 14px; color: #0f172a; }
.tpp-about-card p { margin: 0; font-size: 13.5px; color: #334155; }

.tpp-form { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.tpp-field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: #334155; }
.tpp-field input[type="text"], .tpp-field input[type="email"] {
	width: 100%; padding: 11px 14px; border: 1px solid #cbd5e1; border-radius: 8px; font-size: 15px; background: #fff; color: #0f172a;
}
.tpp-field input:focus-visible, .tpp-opt input:focus-visible + span, .tpp-btn:focus-visible {
	outline: 3px solid #93c5fd; outline-offset: 2px;
}
.tpp-field-wide { grid-column: 1 / -1; }
.tpp-consent { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: #334155; }
.tpp-consent input { margin-top: 3px; }
.tpp-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.tpp-fine { font-size: 12px; color: #64748b; margin-top: 18px; }

.tpp-btn {
	display: inline-block; border: 0; border-radius: 8px; padding: 12px 22px; font-size: 14px; font-weight: 600; cursor: pointer; line-height: 1.2;
}
.tpp-btn-primary { background: #0f172a; color: #fff; }
.tpp-btn-primary:hover { background: #1e293b; }
.tpp-btn-secondary { background: #f1f5f9; color: #0f172a; border: 1px solid #cbd5e1; }
.tpp-btn-light { background: #fff; color: #0f172a; }
.tpp-btn-ghost { background: transparent; color: #fff; border: 1px solid rgba(255, 255, 255, .45); }
.tpp-btn[disabled] { opacity: .5; cursor: not-allowed; }

.tpp-progress-head { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; color: #475569; margin-bottom: 8px; }
.tpp-progress-track { height: 8px; background: #e2e8f0; border-radius: 99px; overflow: hidden; margin-bottom: 20px; }
.tpp-progress-fill { height: 100%; width: 0; background: #2563eb; transition: width .25s ease; }

.tpp-howto { background: #f8fafc; border-left: 4px solid #2563eb; border-radius: 6px; padding: 10px 14px; font-size: 13.5px; color: #334155; margin-bottom: 20px; }

.tpp-item { border: 0; margin: 0 0 22px; padding: 0 0 20px; border-bottom: 1px solid #eef2f7; min-width: 0; }
.tpp-item:last-child { border-bottom: 0; }
.tpp-item legend { padding: 0; font-size: 17px; font-weight: 600; line-height: 1.4; color: #0f172a; margin-bottom: 12px; float: left; width: 100%; }
.tpp-item legend + * { clear: both; }
.tpp-item-num { display: inline-block; min-width: 26px; color: #64748b; font-weight: 700; }
.tpp-item.is-missing { background: #fffbeb; border-radius: 8px; padding: 12px; box-shadow: inset 0 0 0 2px #f59e0b; }

.tpp-scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.tpp-opt { display: block; position: relative; cursor: pointer; }
.tpp-opt input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.tpp-opt span {
	display: flex; align-items: center; justify-content: center; text-align: center; min-height: 52px; padding: 8px 6px;
	border: 2px solid #e2e8f0; border-radius: 10px; font-size: 13px; font-weight: 600; color: #334155; background: #fff; transition: all .12s ease;
}
.tpp-opt:hover span { border-color: #94a3b8; }
.tpp-opt input:checked + span { border-color: #2563eb; background: #eff6ff; color: #1e3a8a; }

.tpp-quiz-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 10px; padding-top: 18px; border-top: 1px solid #e2e8f0; }
.tpp-msg { font-size: 13.5px; color: #b45309; min-height: 20px; margin: 0 0 8px; }
.tpp-msg.is-error { color: #b91c1c; }

.tpp-loader { text-align: center; }
.tpp-spinner { width: 42px; height: 42px; margin: 8px auto 16px; border: 4px solid #e2e8f0; border-top-color: #2563eb; border-radius: 50%; animation: tpp-spin .9s linear infinite; }
@keyframes tpp-spin { to { transform: rotate(360deg); } }

@media (max-width: 720px) {
	.tpp-screen { padding: 20px 16px; }
	.tpp-title { font-size: 23px; }
	.tpp-about, .tpp-form { grid-template-columns: 1fr; }
	.tpp-scale { grid-template-columns: 1fr; }
	.tpp-opt span { min-height: 44px; justify-content: flex-start; padding: 8px 14px; font-size: 14px; }
	.tpp-item legend { font-size: 16px; }
}

/* ---------- 2. Report shell ---------- */
.tpp-toolbar {
	position: sticky; top: 32px; z-index: 50; background: #0f172a; color: #fff; padding: 12px 20px; border-radius: 10px;
	display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 20px;
	box-shadow: 0 10px 25px rgba(0, 0, 0, .2); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}
.tpp-toolbar-title { font-weight: 700; font-size: 14px; }
.tpp-toolbar-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.tpp-toolbar .tpp-btn { padding: 9px 16px; }

.tpp-booklet {
	display: flex; flex-direction: column; align-items: center; gap: 24px; background: #cbd5e1; padding: 24px 10px; border-radius: 12px; overflow-x: auto;
}

/* ---------- 3. A4 page (210 x 297 mm) ---------- */
.tpp-page {
	width: 210mm; height: 297mm; flex: 0 0 auto; background: #fff; color: #0f172a; position: relative; overflow: hidden;
	padding: 13mm 15mm 11mm; display: flex; flex-direction: column; box-shadow: 0 6px 20px rgba(15, 23, 42, .15);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; font-size: 13.5px; line-height: 1.55;
	-webkit-print-color-adjust: exact; print-color-adjust: exact; box-sizing: border-box; text-align: left;
}
.tpp-page *, .tpp-page *::before, .tpp-page *::after { box-sizing: border-box; }
.tpp-page-head {
	display: flex; justify-content: space-between; gap: 16px; align-items: center; border-bottom: 2px solid #0f172a; padding-bottom: 7px; margin-bottom: 14px;
	font-size: 9.5px; font-weight: 700; letter-spacing: .07em; color: #475569;
}
.tpp-page-head span:last-child { text-align: right; letter-spacing: .02em; }
.tpp-page-body { flex: 1; display: flex; flex-direction: column; gap: 15px; min-height: 0; }
.tpp-page-foot { display: flex; justify-content: space-between; gap: 16px; border-top: 1px solid #cbd5e1; padding-top: 7px; margin-top: 10px; font-size: 9.5px; color: #64748b; }

.tpp-h2 { font-size: 27px; line-height: 1.2; font-weight: 800; margin: 0; color: #0f172a; }
.tpp-h3 { font-size: 15.5px; font-weight: 700; margin: 0 0 8px; color: #0f172a; }
.tpp-p { font-size: 13.8px; line-height: 1.6; color: #334155; margin: 0; }
.tpp-small { font-size: 12.8px; line-height: 1.55; color: #334155; margin: 8px 0 0; }
.tpp-flush { margin: 0; }
.tpp-sub { font-size: 10.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #2563eb; margin: 8px 0 3px; }
.tpp-kicker { font-size: 10px; letter-spacing: .12em; color: #93c5fd; font-weight: 700; }
.tpp-kicker-dark { font-size: 10px; letter-spacing: .12em; color: #2563eb; font-weight: 800; margin-bottom: 4px; }

.tpp-list { margin: 0; padding-left: 18px; font-size: 13.2px; line-height: 1.55; color: #334155; }
.tpp-list li { margin-bottom: 5px; }

.tpp-card { border: 1px solid #cbd5e1; background: #f8fafc; border-radius: 8px; padding: 13px 17px; }
.tpp-card-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 6px; }
.tpp-card-top .tpp-h3 { margin: 0; }
.tpp-yours { border: 2px solid #2563eb; background: #eff6ff; }
.tpp-tag { display: inline-block; background: #2563eb; color: #fff; font-size: 9px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: 2px 8px; border-radius: 99px; margin-bottom: 6px; }
.tpp-badge { background: #0f172a; color: #fff; font-size: 11.5px; font-weight: 700; padding: 3px 10px; border-radius: 99px; white-space: nowrap; }
.tpp-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.tpp-note { background: #f8fafc; border-left: 4px solid #0f172a; border-radius: 4px; padding: 13px 18px; }
.tpp-note h3 { margin: 0 0 5px; font-size: 14.5px; color: #0f172a; }
.tpp-note p { margin: 0 0 5px; font-size: 12.8px; line-height: 1.55; color: #334155; }
.tpp-note p:last-child { margin-bottom: 0; }
.tpp-warn { border-left-color: #d97706; background: #fffbeb; }

/* Cover */
.tpp-hero { background: #0f172a; color: #fff; border-radius: 10px; padding: 24px 30px 24px; }
.tpp-hero-name { font-size: 16px; color: #cbd5e1; margin-top: 6px; }
.tpp-hero-code { font-size: 68px; font-weight: 800; letter-spacing: .14em; line-height: 1.05; margin-top: 2px; color: #fff; }
.tpp-hero-type { font-size: 23px; font-weight: 700; color: #93c5fd; margin-top: 2px; }
.tpp-hero-lead { font-size: 13.5px; line-height: 1.55; color: #cbd5e1; margin: 10px 0 0; }
.tpp-chips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.tpp-chip { border: 1px solid #cbd5e1; border-radius: 8px; padding: 9px 8px; text-align: center; background: #f8fafc; }
.tpp-chip-letter { font-size: 28px; font-weight: 800; color: #1d4ed8; line-height: 1.1; }
.tpp-chip-name { font-size: 12.5px; font-weight: 700; margin-top: 2px; color: #0f172a; }
.tpp-chip-meta { font-size: 11px; color: #64748b; margin-top: 2px; }

/* Split bars */
.tpp-split-labels { display: flex; justify-content: space-between; font-size: 12px; font-weight: 700; margin-bottom: 5px; }
.tpp-lab-a { color: #1d4ed8; }
.tpp-lab-b { color: #0f172a; }
.tpp-split-track { height: 15px; background: #0f172a; border-radius: 99px; overflow: hidden; }
.tpp-split-fill { display: block; height: 100%; background: #2563eb; }

/* Type page */
.tpp-typebanner { display: flex; gap: 22px; align-items: center; background: #eff6ff; border: 2px solid #1d4ed8; border-radius: 10px; padding: 20px 24px; }
.tpp-typecode { font-size: 52px; font-weight: 800; letter-spacing: .1em; color: #0f172a; }
.tpp-typename { font-size: 21px; font-weight: 800; color: #1d4ed8; margin-bottom: 4px; }

/* Tables */
.tpp-table { width: 100%; border-collapse: collapse; font-size: 12.6px; }
.tpp-table th, .tpp-table td { border: 1px solid #cbd5e1; padding: 8px 11px; text-align: left; vertical-align: top; line-height: 1.4; }
.tpp-table th { background: #f1f5f9; font-weight: 700; }
.tpp-appendix td, .tpp-appendix th { padding: 5px 8px; font-size: 10.8px; line-height: 1.32; }
.tpp-c-num { width: 28px; text-align: center !important; }
.tpp-c-ans { width: 108px; }

/* Cover contents and type letters */
.tpp-toc { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.tpp-toc td { padding: 2px 0; border-bottom: 1px solid #e2e8f0; color: #334155; }
.tpp-toc tr:last-child td { border-bottom: 0; }
.tpp-toc-n { width: 34px; font-weight: 800; color: #2563eb; }
.tpp-letters { width: 100%; border-collapse: collapse; font-size: 12.8px; line-height: 1.5; color: #334155; }
.tpp-letters td { padding: 7px 0; border-bottom: 1px solid #e2e8f0; vertical-align: top; }
.tpp-letters tr:last-child td { border-bottom: 0; }
.tpp-letter { width: 54px; font-size: 26px; font-weight: 800; color: #1d4ed8; line-height: 1.1; }

/* ---------- 4. Print ---------- */
@media print {
	@page { size: A4 portrait; margin: 0; }
	body * { visibility: hidden; }
	#tpp-booklet, #tpp-booklet * { visibility: visible; }
	.no-print, .tpp-toolbar, #wpadminbar { display: none !important; }
	#tpp-booklet { position: absolute; left: 0; top: 0; width: 210mm; background: transparent !important; padding: 0 !important; margin: 0 !important; gap: 0 !important; display: block; overflow: visible; }
	.tpp-page { margin: 0 !important; box-shadow: none !important; page-break-after: always; break-after: page; }
	.tpp-page:last-child { page-break-after: auto; break-after: auto; }
}

.tpp-phone-row{display:grid;grid-template-columns:minmax(145px, .75fr) 2fr;gap:10px}.tpp-phone-row select,.tpp-phone-row input{width:100%;min-width:0;padding:11px 12px;border:1px solid #cbd5e1;border-radius:8px;background:#fff;color:#0f172a;font-size:15px}.tpp-field-help{margin:6px 0 0;color:#64748b;font-size:12px}.tpp-polygon-wrap{display:flex;justify-content:center;align-items:center;max-width:600px;margin:8px auto 18px}.tpp-polygon{width:100%;max-height:410px;overflow:visible}.tpp-polygon text{font-size:12px;fill:#334155;font-weight:700}.tpp-polygon-stats{display:grid;grid-template-columns:1fr 1fr;gap:10px}.tpp-polygon-stat{display:flex;flex-direction:column;gap:3px;padding:12px;border:1px solid #dbe3ed;border-radius:9px;background:#f8fafc}.tpp-polygon-stat strong{font-size:11px;color:#64748b}.tpp-polygon-stat span{font-size:14px;font-weight:700;color:#0f172a}.tpp-polygon-stat small{font-size:11px;color:#475569}@media(max-width:520px){.tpp-phone-row{grid-template-columns:1fr}.tpp-polygon-stats{grid-template-columns:1fr}}
/* Compact preference map displayed on the opening score page. */
.tpp-polygon-compact{max-width:360px;margin:2px auto 8px}.tpp-polygon-compact .tpp-polygon{max-height:230px}.tpp-polygon-compact + .tpp-polygon-stats .tpp-polygon-stat{padding:7px 9px;gap:2px}.tpp-polygon-compact + .tpp-polygon-stats .tpp-polygon-stat span{font-size:12px}.tpp-polygon-compact + .tpp-polygon-stats .tpp-polygon-stat small{font-size:10px}

/* Page 2: deliberately compact composition so the complete preference map
   remains inside the fixed A4 canvas used by html2pdf/html2canvas. */
.tpp-score-page{gap:7px!important}
.tpp-score-page>.tpp-h2{font-size:23px;line-height:1.12}
.tpp-score-page>.tpp-p{font-size:11px;line-height:1.3}
.tpp-score-card{padding:7px 11px!important;border-radius:7px}
.tpp-score-card .tpp-card-top{margin-bottom:3px}
.tpp-score-card .tpp-h3{font-size:12px;line-height:1.2}
.tpp-score-card .tpp-badge{font-size:9px;padding:2px 7px}
.tpp-score-card .tpp-split-labels{font-size:9.5px;margin-bottom:3px}
.tpp-score-card .tpp-split-track{height:9px}
.tpp-score-card .tpp-small{font-size:9.2px;line-height:1.25;margin-top:3px}
.tpp-score-page>.tpp-note{padding:7px 11px}
.tpp-score-page>.tpp-note h3{font-size:11px;margin-bottom:2px}
.tpp-score-page>.tpp-note p{font-size:9px;line-height:1.25}
.tpp-map-heading{display:flex;align-items:baseline;justify-content:space-between;gap:12px;margin-top:1px}
.tpp-map-heading .tpp-h2{font-size:19px;line-height:1.1}
.tpp-map-heading .tpp-p{font-size:9px;line-height:1.2;text-align:right}
.tpp-polygon-compact{max-width:100%;margin:0 auto!important;height:142px;max-height:142px}
.tpp-polygon-compact .tpp-polygon{height:142px;max-height:142px;width:auto;max-width:100%;display:block}
.tpp-polygon-compact+.tpp-polygon-stats{grid-template-columns:repeat(4,minmax(0,1fr));gap:5px}
.tpp-polygon-compact+.tpp-polygon-stats .tpp-polygon-stat{padding:5px 6px;gap:1px;min-width:0}
.tpp-polygon-compact+.tpp-polygon-stats .tpp-polygon-stat strong{font-size:8px}
.tpp-polygon-compact+.tpp-polygon-stats .tpp-polygon-stat span{font-size:8.5px;line-height:1.15;overflow-wrap:anywhere}
.tpp-polygon-compact+.tpp-polygon-stats .tpp-polygon-stat small{font-size:7.5px;line-height:1.1}
