/* Response Buddy — scoped styles. Accent color comes from --rb-accent (set in plugin settings). */
.rb-app {
	--rb-accent: #2f6fed;
	--rb-text: #1c2230;
	--rb-muted: #5b6474;
	--rb-border: #d9dee7;
	--rb-bg: #ffffff;
	--rb-soft: #f5f7fb;
	--rb-error: #b42318;
	--rb-radius: 14px;
	box-sizing: border-box;
	max-width: 720px;
	margin: 1.5rem auto;
	padding: 1.5rem;
	background: var(--rb-bg);
	color: var(--rb-text);
	border: 1px solid var(--rb-border);
	border-radius: 18px;
	box-shadow: 0 6px 24px rgba(20, 30, 60, 0.06);
	font-size: 16px;
	line-height: 1.5;
}
.rb-app *, .rb-app *::before, .rb-app *::after { box-sizing: border-box; }

.rb-title { margin: 0 0 0.35rem; font-size: 1.5rem; line-height: 1.25; color: var(--rb-text); }
.rb-sub { margin: 0 0 1.25rem; color: var(--rb-muted); }

.rb-form { display: flex; flex-direction: column; }
.rb-label { display: block; margin: 0.9rem 0 0.35rem; font-weight: 600; font-size: 0.95rem; }
.rb-label:first-child { margin-top: 0; }
.rb-optional { font-weight: 400; color: var(--rb-muted); }

.rb-field {
	width: 100%;
	padding: 0.75rem 0.85rem;
	font: inherit;
	color: var(--rb-text);
	background: var(--rb-bg);
	border: 1px solid var(--rb-border);
	border-radius: 10px;
	transition: border-color 0.15s, box-shadow 0.15s;
}
.rb-field:focus {
	outline: none;
	border-color: var(--rb-accent);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--rb-accent) 22%, transparent);
}
textarea.rb-field { resize: vertical; min-height: 130px; }

.rb-input-wrap { position: relative; }
.rb-has-mic .rb-message { padding-right: 4rem; }

.rb-mic {
	position: absolute;
	right: 0.6rem;
	bottom: 0.7rem;
	width: 48px;
	height: 48px;
	display: grid;
	place-items: center;
	border: 0;
	border-radius: 50%;
	background: var(--rb-accent);
	color: #fff;
	cursor: pointer;
	box-shadow: 0 3px 10px color-mix(in srgb, var(--rb-accent) 40%, transparent);
	transition: transform 0.15s;
}
.rb-mic:hover { transform: scale(1.05); }
.rb-mic:focus-visible { outline: 3px solid var(--rb-text); outline-offset: 2px; }
.rb-mic.is-listening { background: #d92d20; animation: rb-pulse 1.4s ease-out infinite; }
@keyframes rb-pulse {
	0% { box-shadow: 0 0 0 0 rgba(217, 45, 32, 0.45); }
	100% { box-shadow: 0 0 0 16px rgba(217, 45, 32, 0); }
}

.rb-status { min-height: 1.25em; margin: 0.35rem 0 0; font-size: 0.9rem; color: var(--rb-muted); }

.rb-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

.rb-submit, .rb-btn {
	font: inherit;
	font-weight: 600;
	cursor: pointer;
	border-radius: 10px;
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}
.rb-submit {
	margin-top: 1.25rem;
	padding: 0.9rem 1.2rem;
	min-height: 52px;
	border: 0;
	background: var(--rb-accent);
	color: #fff;
	font-size: 1.05rem;
}
.rb-submit:hover { filter: brightness(1.07); }
.rb-submit:disabled { opacity: 0.7; cursor: progress; }
.rb-submit:focus-visible, .rb-btn:focus-visible { outline: 3px solid var(--rb-text); outline-offset: 2px; }

.rb-error {
	margin-top: 1rem;
	padding: 0.8rem 1rem;
	border-radius: 10px;
	background: #fef3f2;
	color: var(--rb-error);
	border: 1px solid #fecdca;
}

.rb-results { display: grid; gap: 0.9rem; margin-top: 1.25rem; }
.rb-results:empty { display: none; }

.rb-card {
	padding: 1rem 1.1rem;
	background: var(--rb-soft);
	border: 1px solid var(--rb-border);
	border-radius: var(--rb-radius);
}
.rb-tone {
	display: inline-block;
	margin-bottom: 0.5rem;
	padding: 0.15rem 0.6rem;
	font-size: 0.8rem;
	font-weight: 700;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	color: var(--rb-accent);
	background: color-mix(in srgb, var(--rb-accent) 12%, transparent);
	border-radius: 999px;
}
.rb-text { margin: 0 0 0.9rem; white-space: pre-wrap; }
.rb-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.rb-btn {
	padding: 0.55rem 1rem;
	min-height: 44px;
	border: 1px solid var(--rb-border);
	background: var(--rb-bg);
	color: var(--rb-text);
	font-size: 0.95rem;
}
.rb-btn:hover { border-color: var(--rb-accent); }
.rb-btn-primary { background: var(--rb-accent); border-color: var(--rb-accent); color: #fff; }
.rb-btn-primary:hover { filter: brightness(1.07); color: #fff; }
.rb-btn.is-speaking { border-color: var(--rb-accent); color: var(--rb-accent); }

.rb-skeleton {
	height: 150px;
	background: linear-gradient(90deg, var(--rb-soft) 25%, #e9edf4 50%, var(--rb-soft) 75%);
	background-size: 200% 100%;
	animation: rb-shimmer 1.2s linear infinite;
}
@keyframes rb-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.rb-note { margin: 0; font-size: 0.85rem; color: var(--rb-muted); }

.rb-cta {
	margin-top: 1.25rem;
	padding: 1.1rem;
	border-radius: var(--rb-radius);
	border: 1px dashed var(--rb-accent);
	text-align: center;
}
.rb-cta p { margin: 0 0 0.75rem; font-weight: 600; }

@media (max-width: 600px) {
	.rb-app { padding: 1.1rem; margin: 1rem 0; border-radius: 14px; }
	.rb-title { font-size: 1.3rem; }
	.rb-actions .rb-btn { flex: 1 1 auto; }
}

@media (prefers-reduced-motion: reduce) {
	.rb-mic.is-listening, .rb-skeleton { animation: none; }
}

/* ---------- Signup + inquiry boxes ---------- */
.rb-box {
	--rb-accent: #2f6fed;
	--rb-text: #1c2230;
	--rb-muted: #5b6474;
	--rb-border: #d9dee7;
	--rb-bg: #ffffff;
	--rb-soft: #f5f7fb;
	--rb-error: #b42318;
	box-sizing: border-box;
	max-width: 720px;
	margin: 1.5rem auto;
	padding: 1.5rem;
	background: var(--rb-soft);
	color: var(--rb-text);
	border: 1px solid var(--rb-border);
	border-radius: 18px;
	font-size: 16px;
	line-height: 1.5;
}
.rb-box *, .rb-box *::before, .rb-box *::after { box-sizing: border-box; }
.rb-box .rb-field { background: var(--rb-bg); }
.rb-box-title { margin: 0 0 0.35rem; font-size: 1.3rem; line-height: 1.3; color: var(--rb-text); }
.rb-signup { text-align: center; border-top: 4px solid var(--rb-accent); }
.rb-inline-form { display: flex; flex-wrap: wrap; gap: 0.6rem; justify-content: center; }
.rb-inline-form .rb-field { flex: 1 1 200px; min-height: 52px; }
.rb-inline-form .rb-submit { margin-top: 0; flex: 0 0 auto; }
.rb-fine { margin: 0.75rem 0 0; font-size: 0.82rem; color: var(--rb-muted); }
.rb-fine a { color: inherit; }
.rb-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.rb-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.rb-grid .rb-label { margin-top: 0.9rem; }
.rb-contact .rb-form > .rb-label:first-of-type { margin-top: 0.9rem; }
.rb-form-msg { margin-top: 1rem; padding: 1rem; border-radius: 12px; background: var(--rb-bg); border: 1px solid var(--rb-border); font-weight: 600; }
.rb-form-msg p { margin: 0 0 0.75rem; }
.rb-form-msg p:last-child { margin-bottom: 0; }
.rb-form-msg.is-error { color: var(--rb-error); background: #fef3f2; border-color: #fecdca; }
.rb-box .rb-submit, .rb-box .rb-btn { font: inherit; font-weight: 600; }
.rb-box .rb-submit { padding: 0.9rem 1.3rem; min-height: 52px; border: 0; border-radius: 10px; background: var(--rb-accent); color: #fff; cursor: pointer; }
.rb-box .rb-btn-primary { display: inline-flex; align-items: center; padding: 0.6rem 1.1rem; min-height: 44px; border-radius: 10px; background: var(--rb-accent); color: #fff; text-decoration: none; }
@media (max-width: 600px) {
	.rb-grid { grid-template-columns: 1fr; }
	.rb-box { padding: 1.1rem; }
	.rb-inline-form .rb-submit { width: 100%; }
}

/* ---------- Reply templates inside articles ---------- */
.rb-template { position: relative; padding-bottom: 3.4rem !important; }
.rb-template .rb-template-label { font-size: 0.8rem; letter-spacing: 0.04em; text-transform: uppercase; opacity: 0.75; margin-bottom: 0.4rem; }
.rb-copy-template {
	position: absolute;
	left: 1em;
	bottom: 0.9rem;
	padding: 0.45rem 0.9rem;
	min-height: 40px;
	font: inherit;
	font-size: 0.85rem;
	font-weight: 600;
	font-style: normal;
	border-radius: 8px;
	border: 1px solid currentColor;
	background: transparent;
	color: inherit;
	cursor: pointer;
}
.rb-copy-template:hover { background: rgba(127, 127, 127, 0.12); }

/* ---------- "Done-for-you" call-to-action box in articles ---------- */
.rb-cta-box {
	margin: 2rem 0;
	padding: 1.25rem 1.5rem !important;
	border: 1px solid #d9dee7;
	border-left: 5px solid #2f6fed;
	border-radius: 14px;
	background: #f5f7fb;
	color: #1c2230;
}
.rb-cta-box h3 { margin-top: 0; color: #1c2230; }
.rb-cta-box .wp-block-button__link { background: #2f6fed; color: #fff; }
