/* ============================================================
   GA4 Traffic Auditor — Frontend Styles
   Accent color: #ff6e4e
   ============================================================ */

/* ── Base ──────────────────────────────────────────────────── */
.ga4-audit-wrap {
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
	max-width: 880px;
	margin: 0 auto;
	padding: 48px 20px 64px;
	color: #1a1a2e;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
}
.ga4-audit-wrap *, .ga4-audit-wrap *::before, .ga4-audit-wrap *::after {
	box-sizing: border-box;
}

/* ── Hero (Step 1) ─────────────────────────────────────────── */
.ga4-hero {
	text-align: center;
	margin-bottom: 40px;
}
.ga4-badge {
	display: inline-block;
	background: #ff6e4e;
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 1.5px;
	text-transform: uppercase;
	padding: 5px 14px;
	border-radius: 20px;
	margin-bottom: 20px;
}
.ga4-hero h2 {
	font-size: clamp(1.6rem, 4vw, 2.4rem);
	font-weight: 800;
	line-height: 1.2;
	margin: 0 0 14px;
	color: #1a1a2e;
}
.ga4-hero p {
	font-size: 1.1rem;
	color: #555;
	max-width: 540px;
	margin: 0 auto;
}

/* ── Form card ─────────────────────────────────────────────── */
.ga4-form-card {
	background: #fff;
	border-radius: 20px;
	padding: 36px;
	box-shadow: 0 8px 40px rgba(0, 0, 0, .10);
	max-width: 480px;
	margin: 0 auto 28px;
}
.ga4-field { margin-bottom: 20px; }
.ga4-field label {
	display: block;
	font-size: 13px;
	font-weight: 600;
	color: #333;
	margin-bottom: 7px;
}
.ga4-field input {
	width: 100%;
	padding: 13px 16px;
	border: 2px solid #e2e8f0;
	border-radius: 12px;
	font-size: 15px;
	color: #1a1a2e;
	background: #fafafa;
	transition: border-color .18s, background .18s;
	outline: none;
}
.ga4-field input:focus {
	border-color: #ff6e4e;
	background: #fff;
}
.ga4-inline-error {
	color: #ef4444;
	font-size: 13px;
	margin-bottom: 12px;
	padding: 10px 14px;
	background: #fff5f5;
	border-radius: 8px;
	border-left: 3px solid #ef4444;
}

/* ── Buttons ───────────────────────────────────────────────── */
.ga4-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 9px;
	padding: 14px 28px;
	border-radius: 12px;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	text-decoration: none;
	transition: transform .18s, box-shadow .18s, opacity .18s, background .18s;
	border: none;
	line-height: 1;
}
.ga4-btn:disabled { opacity: .6; pointer-events: none; }

.ga4-btn-primary {
	background: #ff6e4e;
	color: #fff;
	width: 100%;
	font-size: 16px;
}
.ga4-btn-primary:hover {
	background: #e85d3d;
	transform: translateY(-2px);
	box-shadow: 0 8px 24px rgba(255, 110, 78, .40);
}

.ga4-btn-google {
	background: #fff;
	color: #333;
	border: 2px solid #e2e8f0;
	font-size: 15px;
}
.ga4-btn-google:hover {
	border-color: #4285f4;
	background: #f0f4ff;
}

.ga4-btn-secondary {
	background: #f1f5f9;
	color: #333;
}
.ga4-btn-secondary:hover { background: #e2e8f0; }

.ga4-cta-btn {
	background: #fff;
	color: #ff6e4e;
	font-size: 16px;
	padding: 16px 32px;
	box-shadow: 0 4px 16px rgba(0,0,0,.15);
	font-weight: 700;
}
.ga4-cta-btn:hover { transform: translateY(-2px); background: #fff5f3; }

/* ── Disclaimer / proof ────────────────────────────────────── */
.ga4-disclaimer {
	font-size: 12px;
	color: #aaa;
	text-align: center;
	margin: 14px 0 0;
}
.ga4-proof-bar {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px 24px;
	font-size: 13px;
	color: #666;
}

/* ── Connect / property selector card ─────────────────────── */
.ga4-connect-card {
	text-align: center;
	background: #fff;
	border-radius: 20px;
	padding: 52px 36px;
	box-shadow: 0 8px 40px rgba(0,0,0,.10);
	max-width: 480px;
	margin: 0 auto;
}
.ga4-connect-icon { font-size: 52px; margin-bottom: 18px; }
.ga4-connect-card h2 { font-size: 1.7rem; font-weight: 800; margin: 0 0 12px; }
.ga4-connect-card > p { color: #666; margin-bottom: 28px; font-size: 15px; }

/* Property list */
#ga4-property-list { margin-top: 20px; text-align: left; }
.ga4-property-btn {
	display: flex;
	flex-direction: column;
	width: 100%;
	padding: 14px 18px;
	margin-bottom: 10px;
	border: 2px solid #e2e8f0;
	border-radius: 12px;
	background: #fff;
	cursor: pointer;
	text-align: left;
	transition: border-color .18s, background .18s;
}
.ga4-property-btn:hover { border-color: #ff6e4e; background: #fff5f3; }
.ga4-property-btn .pname { font-weight: 700; font-size: 15px; color: #1a1a2e; }
.ga4-property-btn .pacct { font-size: 12px; color: #888; margin-top: 2px; }

/* ── Loading ───────────────────────────────────────────────── */
.ga4-loading-card { text-align: center; padding: 64px 20px; }
.ga4-spinner {
	width: 52px;
	height: 52px;
	border: 4px solid #e2e8f0;
	border-top-color: #ff6e4e;
	border-radius: 50%;
	animation: ga4spin .75s linear infinite;
	margin: 0 auto 28px;
}
@keyframes ga4spin { to { transform: rotate(360deg); } }
.ga4-loading-card h2 { font-size: 1.5rem; margin: 0 0 28px; }
.ga4-loading-steps { display: inline-block; text-align: left; }
.ga4-loading-item {
	padding: 9px 12px;
	font-size: 14px;
	color: #bbb;
	border-radius: 8px;
	transition: color .3s, background .3s;
}
.ga4-loading-item.active { color: #ff6e4e; font-weight: 600; background: #fff5f3; }
.ga4-loading-item.done   { color: #22c55e; }

/* ── Results header ────────────────────────────────────────── */
.ga4-results-header {
	text-align: center;
	margin-bottom: 44px;
}
.ga4-results-header h2 { font-size: clamp(1.5rem,3.5vw,2rem); font-weight: 800; margin: 0 0 6px; }
.ga4-results-sub { font-size: 13px; color: #999; margin-bottom: 36px; }

/* Score ring */
.ga4-score-wrap {
	display: inline-flex;
	align-items: center;
	gap: 32px;
	background: #fff;
	border-radius: 20px;
	padding: 32px 40px;
	box-shadow: 0 4px 24px rgba(0,0,0,.07);
	flex-wrap: wrap;
	justify-content: center;
}
.ga4-ring-svg {
	width: 140px;
	height: 140px;
	transform: rotate(-90deg);
	display: block;
}
.ga4-ring-bg   { fill: none; stroke: #f1f5f9; stroke-width: 9; }
.ga4-ring-fill {
	fill: none;
	stroke: #ff6e4e;
	stroke-width: 9;
	stroke-linecap: round;
	stroke-dasharray: 314.16;
	stroke-dashoffset: 314.16;
	transition: stroke-dashoffset 1.6s cubic-bezier(.4,0,.2,1), stroke .4s;
}
.ga4-score-ring-container {
	position: relative;
	width: 140px;
	height: 140px;
	flex-shrink: 0;
}
.ga4-score-inner {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
}
.ga4-score-number { font-size: 2.6rem; font-weight: 900; line-height: 1; color: #1a1a2e; }
.ga4-score-label  { font-size: 11px; color: #aaa; margin-top: 2px; }

.ga4-score-grade {
	font-size: 4.5rem;
	font-weight: 900;
	line-height: 1;
	color: #ff6e4e;
}
.ga4-score-grade-label { font-size: 12px; color: #999; text-transform: uppercase; letter-spacing: 1px; margin-top: 4px; }
.ga4-score-breakdown {
	margin-top: 14px;
	font-size: 12px;
	color: #666;
	line-height: 1.9;
}
.ga4-score-breakdown span { display: block; }

/* ── KPI grid ──────────────────────────────────────────────── */
.ga4-kpi-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
	gap: 16px;
	margin-bottom: 24px;
}
.ga4-kpi {
	background: #fff;
	border-radius: 14px;
	padding: 20px 18px;
	box-shadow: 0 2px 12px rgba(0,0,0,.06);
	text-align: center;
}
.ga4-kpi-label { font-size: 11px; color: #999; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 6px; }
.ga4-kpi-value { font-size: 1.9rem; font-weight: 800; color: #1a1a2e; line-height: 1.1; }
.ga4-kpi-delta { font-size: 11px; margin-top: 5px; }
.ga4-kpi-delta.up   { color: #22c55e; }
.ga4-kpi-delta.down { color: #ef4444; }
.ga4-kpi-delta.flat { color: #aaa; }

/* ── Cards ─────────────────────────────────────────────────── */
.ga4-card {
	background: #fff;
	border-radius: 16px;
	padding: 28px;
	box-shadow: 0 2px 16px rgba(0,0,0,.06);
	margin-bottom: 20px;
}
.ga4-card h3 { font-size: 1rem; font-weight: 700; color: #1a1a2e; margin: 0 0 20px; }
.ga4-card-meta { font-size: 12px; color: #aaa; font-weight: 400; margin-left: 8px; }

.ga4-two-col {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 20px;
	margin-bottom: 20px;
}
@media (max-width: 620px) {
	.ga4-two-col { grid-template-columns: 1fr; }
}

/* ── Table ─────────────────────────────────────────────────── */
.ga4-table-wrap { overflow-x: auto; }
.ga4-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 14px;
}
.ga4-table th {
	text-align: left;
	padding: 8px 14px;
	font-size: 11px;
	font-weight: 700;
	color: #aaa;
	text-transform: uppercase;
	letter-spacing: .5px;
	border-bottom: 2px solid #f1f5f9;
	white-space: nowrap;
}
.ga4-table td {
	padding: 11px 14px;
	border-bottom: 1px solid #f8fafc;
	vertical-align: middle;
}
.ga4-table tr:last-child td { border-bottom: none; }
.ga4-page-path {
	font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
	font-size: 12px;
	color: #ff6e4e;
	max-width: 260px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	display: block;
}
.ga4-bar-cell { white-space: nowrap; }
.ga4-inline-bar {
	display: inline-block;
	height: 6px;
	border-radius: 3px;
	background: #ff6e4e;
	vertical-align: middle;
	margin-right: 6px;
}

/* ── Recommendations ───────────────────────────────────────── */
.ga4-rec-item {
	border-left: 4px solid #e2e8f0;
	padding: 16px 20px;
	margin-bottom: 14px;
	border-radius: 0 12px 12px 0;
	background: #f9fafb;
}
.ga4-rec-item.high   { border-color: #ef4444; background: #fff5f5; }
.ga4-rec-item.medium { border-color: #f59e0b; background: #fffbeb; }
.ga4-rec-item.good   { border-color: #22c55e; background: #f0fdf4; }
.ga4-rec-title  { font-weight: 700; font-size: 15px; margin-bottom: 6px; }
.ga4-rec-body   { color: #555; font-size: 14px; line-height: 1.55; margin-bottom: 10px; }
.ga4-rec-actions { list-style: none; padding: 0; margin: 0; }
.ga4-rec-actions li {
	font-size: 13px;
	color: #444;
	padding: 3px 0 3px 20px;
	position: relative;
	line-height: 1.5;
}
.ga4-rec-actions li::before { content: '→'; position: absolute; left: 0; color: #ff6e4e; font-weight: 700; }

/* ── PageSpeed Insights ────────────────────────────────────── */
.ga4-psi-loading {
	text-align: center;
	padding: 32px;
	color: #aaa;
	font-size: 14px;
}
.ga4-psi-loading .ga4-spinner { width: 32px; height: 32px; margin: 0 auto 12px; }

.ga4-psi-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 20px;
	margin-bottom: 24px;
}
@media (max-width: 580px) { .ga4-psi-grid { grid-template-columns: 1fr; } }

.ga4-psi-score-card {
	text-align: center;
	padding: 24px 16px;
	background: #f9fafb;
	border-radius: 12px;
}
.ga4-psi-score-card h4 { font-size: 12px; font-weight: 700; color: #999; text-transform: uppercase; letter-spacing: .5px; margin: 0 0 12px; }
.ga4-psi-score-num {
	font-size: 3rem;
	font-weight: 900;
	line-height: 1;
}
.ga4-psi-score-num.good   { color: #22c55e; }
.ga4-psi-score-num.medium { color: #f59e0b; }
.ga4-psi-score-num.poor   { color: #ef4444; }
.ga4-psi-score-label { font-size: 11px; color: #aaa; margin-top: 4px; }

.ga4-cwv-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
	gap: 12px;
	margin-bottom: 20px;
}
.ga4-cwv-item {
	background: #f9fafb;
	border-radius: 10px;
	padding: 14px;
	text-align: center;
}
.ga4-cwv-label { font-size: 10px; font-weight: 700; color: #999; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 6px; }
.ga4-cwv-value { font-size: 1.2rem; font-weight: 800; }
.ga4-cwv-value.good   { color: #22c55e; }
.ga4-cwv-value.medium { color: #f59e0b; }
.ga4-cwv-value.poor   { color: #ef4444; }
.ga4-cwv-sub { font-size: 10px; color: #aaa; margin-top: 2px; }

.ga4-opp-item {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding: 12px 0;
	border-bottom: 1px solid #f1f5f9;
}
.ga4-opp-item:last-child { border-bottom: none; }
.ga4-opp-savings {
	background: #fff5f3;
	color: #ff6e4e;
	font-size: 11px;
	font-weight: 700;
	padding: 3px 8px;
	border-radius: 20px;
	white-space: nowrap;
	flex-shrink: 0;
	margin-top: 1px;
}
.ga4-opp-title { font-size: 13px; font-weight: 600; color: #1a1a2e; }
.ga4-opp-desc  { font-size: 12px; color: #888; margin-top: 2px; line-height: 1.4; }

/* ── Events table ──────────────────────────────────────────── */
.ga4-event-name {
	font-weight: 600;
	font-size: 13px;
	color: #1a1a2e;
}
.ga4-event-tag {
	display: inline-block;
	font-size: 10px;
	font-weight: 700;
	padding: 2px 7px;
	border-radius: 20px;
	margin-left: 6px;
	text-transform: uppercase;
	letter-spacing: .3px;
}
.ga4-event-tag.conversion { background: #fff5f3; color: #ff6e4e; }
.ga4-event-tag.engagement { background: #f0fdf4; color: #22c55e; }

/* ── New vs Returning chart ────────────────────────────────── */
.ga4-user-type-wrap canvas { max-height: 200px; }

/* ── CTA card ──────────────────────────────────────────────── */
.ga4-cta-card {
	background: #ff6e4e;
	border-radius: 20px;
	padding: 48px 40px;
	text-align: center;
	color: #fff;
	margin-top: 8px;
}
.ga4-cta-card h3 { font-size: 1.6rem; font-weight: 800; margin: 0 0 12px; }
.ga4-cta-card  p { opacity: .9; font-size: 15px; margin-bottom: 28px; }

/* ── Error ─────────────────────────────────────────────────── */
.ga4-error-card {
	text-align: center;
	padding: 64px 24px;
}
.ga4-error-icon { font-size: 52px; margin-bottom: 16px; }
.ga4-error-card h3 { font-size: 1.4rem; margin-bottom: 8px; }
.ga4-error-card  p { color: #666; margin-bottom: 24px; }

/* ── Responsive tweaks ─────────────────────────────────────── */
@media (max-width: 480px) {
	.ga4-form-card    { padding: 24px 18px; }
	.ga4-connect-card { padding: 36px 20px; }
	.ga4-score-wrap   { padding: 24px 20px; gap: 20px; }
	.ga4-cta-card     { padding: 32px 20px; }
	.ga4-kpi-grid     { grid-template-columns: repeat(2, 1fr); }
}
