/* ===========================================================
   Reset Cohort Application — conversational, text-message feel
   Palette: deep plum + warm cream, faith-forward and unhurried
   =========================================================== */

#rca-app, #rca-status-app {
	--rca-plum: #6b2d5e;
	--rca-plum-deep: #4a1f40;
	--rca-cream: #faf5ee;
	--rca-cream-deep: #f1e6d8;
	--rca-ink: #2c2420;
	--rca-muted: #8a7f78;
	--rca-line: #e8ddd0;
	--rca-crisis: #fbeae6;
	--rca-crisis-ink: #7a2e1f;

	max-width: 560px;
	margin: 0 auto;
	background: var(--rca-cream);
	border: 1px solid var(--rca-line);
	border-radius: 18px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	min-height: 560px;
	max-height: 78vh;
	box-shadow: 0 18px 50px -25px rgba(74, 31, 64, 0.35);
	font-family: Georgia, 'Times New Roman', serif;
	color: var(--rca-ink);
}

.rca-progress {
	height: 4px;
	background: var(--rca-line);
	flex-shrink: 0;
}
.rca-progress-bar {
	height: 100%;
	width: 0%;
	background: var(--rca-plum);
	transition: width 0.4s ease;
}

.rca-header {
	flex-shrink: 0;
	min-height: 8px;
	display: flex;
	align-items: center;
	padding: 8px 14px 0;
}
.rca-back-btn {
	background: none;
	border: none;
	color: var(--rca-plum);
	font-family: Georgia, serif;
	font-size: 14px;
	cursor: pointer;
	padding: 4px 8px;
	margin: 0 0 0 -8px;
	border-radius: 6px;
	transition: background 0.15s ease;
}
.rca-back-btn:hover { background: var(--rca-cream-deep); }
.rca-back-btn[hidden] { display: none; }

.rca-other-wrap { margin-top: 8px; }
.rca-other-wrap input[type="text"] {
	width: 100%;
	border: 1px solid var(--rca-line);
	background: #fff;
	border-radius: 20px;
	padding: 11px 16px;
	font-family: Georgia, serif;
	font-size: 15px;
	color: var(--rca-ink);
}
.rca-other-wrap input:focus {
	outline: 2px solid var(--rca-plum);
	outline-offset: 1px;
}

.rca-thread {
	flex: 1 1 auto;
	overflow-y: auto;
	padding: 28px 22px 14px;
	display: flex;
	flex-direction: column;
	gap: 14px;
	scroll-behavior: smooth;
}

.rca-bubble {
	max-width: 84%;
	padding: 13px 17px;
	border-radius: 18px;
	font-size: 16px;
	line-height: 1.5;
	animation: rca-pop 0.28s ease;
	white-space: pre-wrap;
}
.rca-bubble p { margin: 0; }

.rca-bubble-in {
	align-self: flex-start;
	background: var(--rca-cream-deep);
	color: var(--rca-plum-deep);
	border-bottom-left-radius: 6px;
}
.rca-bubble-in .rca-eyebrow {
	display: block;
	font-family: 'Playfair Display SC', Georgia, serif;
	font-size: 11px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--rca-plum);
	margin-bottom: 4px;
	opacity: 0.75;
}

.rca-bubble-out .rca-eyebrow {
	display: block;
	font-family: 'Playfair Display SC', Georgia, serif;
	font-size: 11px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, 0.78);
	margin-bottom: 4px;
	text-align: right;
}

.rca-crisis-panel .rca-eyebrow {
	display: block;
	font-family: 'Playfair Display SC', Georgia, serif;
	font-size: 11px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--rca-crisis-ink);
	margin-bottom: 6px;
	opacity: 0.7;
}

.rca-bubble-out {
	align-self: flex-end;
	background: var(--rca-plum);
	color: #fff;
	border-bottom-right-radius: 6px;
}

.rca-typing {
	align-self: flex-start;
	display: flex;
	gap: 4px;
	padding: 14px 17px;
	background: var(--rca-cream-deep);
	border-radius: 18px;
	border-bottom-left-radius: 6px;
}
.rca-typing span {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--rca-plum);
	opacity: 0.5;
	animation: rca-bounce 1.1s infinite ease-in-out;
}
.rca-typing span:nth-child(2) { animation-delay: 0.15s; }
.rca-typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes rca-bounce {
	0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
	30% { transform: translateY(-4px); opacity: 1; }
}
@keyframes rca-pop {
	from { opacity: 0; transform: translateY(6px); }
	to { opacity: 1; transform: translateY(0); }
}

/* Composer / reply area, pinned at the bottom like a messaging app */
.rca-composer {
	flex-shrink: 0;
	border-top: 1px solid var(--rca-line);
	background: var(--rca-cream);
	padding: 14px 16px;
}

.rca-input-row {
	display: flex;
	align-items: flex-end;
	gap: 10px;
}
.rca-input-row input[type="text"],
.rca-input-row input[type="email"],
.rca-input-row textarea {
	flex: 1 1 auto;
	border: 1px solid var(--rca-line);
	background: #fff;
	border-radius: 20px;
	padding: 11px 16px;
	font-family: Georgia, serif;
	font-size: 15px;
	color: var(--rca-ink);
	resize: none;
	max-height: 110px;
	line-height: 1.4;
}
.rca-input-row input:focus,
.rca-input-row textarea:focus {
	outline: 2px solid var(--rca-plum);
	outline-offset: 1px;
}

.rca-send-btn {
	flex-shrink: 0;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: var(--rca-plum);
	color: #fff;
	border: none;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: background 0.15s ease, transform 0.1s ease;
}
.rca-send-btn:hover { background: var(--rca-plum-deep); }
.rca-send-btn:active { transform: scale(0.92); }
.rca-send-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Choice / yesno / confirm buttons */
.rca-choices {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}
.rca-choice-btn {
	border: 1.5px solid var(--rca-plum);
	background: #fff;
	color: var(--rca-plum-deep);
	padding: 10px 16px;
	border-radius: 20px;
	font-family: Georgia, serif;
	font-size: 14.5px;
	cursor: pointer;
	transition: all 0.15s ease;
}
.rca-choice-btn:hover { background: var(--rca-cream-deep); }
.rca-choice-btn.is-selected,
.rca-choice-btn:active {
	background: var(--rca-plum);
	color: #fff;
}

.rca-confirm-btn {
	border: none;
	background: var(--rca-plum);
	color: #fff;
	padding: 12px 22px;
	border-radius: 22px;
	font-family: 'Playfair Display SC', Georgia, serif;
	font-size: 14px;
	letter-spacing: 0.02em;
	cursor: pointer;
	width: 100%;
}
.rca-confirm-btn:hover { background: var(--rca-plum-deep); }

.rca-error {
	color: #a3372a;
	font-size: 13px;
	margin: 0 0 8px 4px;
}

/* Start screen */
.rca-start {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: 44px 30px;
	gap: 16px;
}
.rca-start h2 {
	font-family: 'Playfair Display SC', Georgia, serif;
	font-size: 26px;
	color: var(--rca-plum-deep);
	margin: 0;
	line-height: 1.25;
}
.rca-start p {
	color: var(--rca-muted);
	font-size: 15.5px;
	line-height: 1.6;
	margin: 0;
	max-width: 380px;
}
.rca-start-btn {
	margin-top: 10px;
	border: none;
	background: var(--rca-plum);
	color: #fff;
	padding: 13px 30px;
	border-radius: 26px;
	font-family: 'Playfair Display SC', Georgia, serif;
	font-size: 15px;
	letter-spacing: 0.02em;
	cursor: pointer;
	transition: background 0.15s ease, transform 0.1s ease;
}
.rca-start-btn:hover { background: var(--rca-plum-deep); transform: translateY(-1px); }

/* Crisis takeover panel */
.rca-crisis-panel {
	background: var(--rca-crisis);
	color: var(--rca-crisis-ink);
	border-radius: 14px;
	padding: 18px 20px;
	align-self: stretch;
	max-width: 100%;
}
.rca-crisis-panel h3 {
	font-family: 'Playfair Display SC', Georgia, serif;
	font-size: 17px;
	margin: 0 0 8px;
	line-height: 1.35;
}
.rca-crisis-panel p {
	margin: 0 0 12px;
	font-size: 14.5px;
	line-height: 1.55;
}
.rca-crisis-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 8px;
}
.rca-crisis-list li {
	background: rgba(255,255,255,0.55);
	border-radius: 8px;
	padding: 9px 12px;
	font-size: 14px;
}
.rca-crisis-list strong { display: block; font-size: 14.5px; }

/* Final confirmation state */
.rca-done {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: 12px;
	padding: 36px 26px;
}
.rca-done h3 {
	font-family: 'Playfair Display SC', Georgia, serif;
	color: var(--rca-plum-deep);
	font-size: 21px;
	margin: 0;
}
.rca-done p {
	color: var(--rca-ink);
	font-size: 15px;
	line-height: 1.6;
	max-width: 400px;
	margin: 0;
}
.rca-checkmark {
	width: 46px;
	height: 46px;
	border-radius: 50%;
	background: var(--rca-plum);
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
}

/* Status lookup widget */
.rca-status-app { min-height: 220px; max-height: none; }
.rca-status-result {
	margin-top: 4px;
}

@media (max-width: 480px) {
	#rca-app, #rca-status-app {
		border-radius: 0;
		min-height: 100vh;
		max-height: 100vh;
		border-left: none;
		border-right: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.rca-bubble, .rca-typing span { animation: none !important; }
}
