/**
 * Care Clinic – KHT booking widget.
 * Override the variables below to re-theme without touching the rest.
 */

.kht-booking {
	/* Brand colours sampled from the Care Clinic logo. */
	--kht-plum: #9a4c8a;
	--kht-plum-dark: #7d3c70;
	--kht-magenta: #ea3d8d;
	--kht-magenta-dark: #cf2b76;

	--kht-accent: var(--kht-plum);
	--kht-accent-dark: var(--kht-plum-dark);
	--kht-accent-soft: #f7edf5;
	--kht-cta: var(--kht-magenta);
	--kht-cta-dark: var(--kht-magenta-dark);

	--kht-ink: #33203a;
	--kht-muted: #7d7183;
	--kht-line: #e7dbe6;
	--kht-bg: #ffffff;
	--kht-radius: 14px;

	max-width: 780px;
	margin: 0 auto;
	padding: 28px;
	background: var(--kht-bg);
	border: 1px solid var(--kht-line);
	border-radius: var(--kht-radius);
	color: var(--kht-ink);
	font-size: 16px;
	line-height: 1.55;
	box-sizing: border-box;
}

.kht-booking *,
.kht-booking *::before,
.kht-booking *::after {
	box-sizing: inherit;
}

.kht-booking.is-busy {
	pointer-events: none;
	opacity: 0.75;
}

/* ---------------------------------------------------------------- Head */

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

/* Plum-to-magenta rule, echoing the logo wordmark. */
.kht-head::after {
	content: "";
	display: block;
	width: 64px;
	height: 3px;
	margin: 12px auto 0;
	border-radius: 2px;
	background: linear-gradient( 90deg, var(--kht-plum), var(--kht-magenta) );
}

.kht-title {
	margin: 0 0 6px;
	font-size: 1.6rem;
	line-height: 1.25;
	color: var(--kht-ink);
}

.kht-subtitle {
	margin: 0;
	color: var(--kht-muted);
	font-size: 0.95rem;
}

.kht-h3 {
	margin: 0 0 14px;
	font-size: 1.15rem;
	color: var(--kht-ink);
}

/* --------------------------------------------------------------- Steps */

.kht-steps {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 0 0 22px;
	padding: 0;
	list-style: none;
	font-size: 0.8rem;
	color: var(--kht-muted);
}

.kht-steps li {
	display: flex;
	align-items: center;
	gap: 7px;
	flex: 1 1 110px;
	padding: 8px 10px;
	border-radius: 999px;
	background: #faf5f9;
	white-space: nowrap;
}

.kht-steps li span {
	display: grid;
	place-items: center;
	width: 22px;
	height: 22px;
	flex: 0 0 22px;
	border-radius: 50%;
	background: #d9cdd8;
	color: #fff;
	font-size: 0.75rem;
	font-weight: 700;
}

.kht-steps li.is-active {
	background: var(--kht-accent-soft);
	color: var(--kht-accent-dark);
	font-weight: 600;
}

.kht-steps li.is-active span,
.kht-steps li.is-done span {
	background: var(--kht-accent);
}

.kht-steps li.is-done {
	color: var(--kht-accent-dark);
}

/* --------------------------------------------------------- Alert, load */

.kht-alert {
	margin: 0 0 16px;
	padding: 12px 14px;
	border-radius: 10px;
	background: #fdeceb;
	border: 1px solid #f5c2be;
	color: #99201a;
	font-size: 0.92rem;
}

.kht-loading {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	padding: 34px 0;
	color: var(--kht-muted);
	font-size: 0.95rem;
}

.kht-spinner {
	width: 18px;
	height: 18px;
	border: 2px solid var(--kht-line);
	border-top-color: var(--kht-accent);
	border-radius: 50%;
	animation: kht-spin 0.7s linear infinite;
}

@keyframes kht-spin {
	to { transform: rotate( 360deg ); }
}

@media ( prefers-reduced-motion: reduce ) {
	.kht-spinner { animation-duration: 2s; }
}

.kht-empty {
	padding: 26px 0;
	text-align: center;
	color: var(--kht-muted);
}

.kht-note {
	margin: 12px 0 0;
	font-size: 0.88rem;
	color: var(--kht-muted);
}

.kht-summary {
	margin: 0 0 18px;
	padding: 10px 14px;
	background: var(--kht-accent-soft);
	border-radius: 10px;
	font-size: 0.9rem;
	color: var(--kht-accent-dark);
}

.kht-label {
	margin: 18px 0 8px;
	font-weight: 600;
	font-size: 0.92rem;
}

/* ------------------------------------------------------ Choice buttons */

.kht-grid {
	display: grid;
	grid-template-columns: repeat( auto-fill, minmax( 190px, 1fr ) );
	gap: 10px;
}

.kht-card {
	padding: 16px 14px;
	border: 1px solid var(--kht-line);
	border-radius: 12px;
	background: #fff;
	color: var(--kht-ink);
	font: inherit;
	font-weight: 600;
	font-size: 0.95rem;
	text-align: left;
	cursor: pointer;
	transition: border-color 0.15s, background 0.15s, transform 0.15s;
}

.kht-card:hover,
.kht-card:focus-visible {
	border-color: var(--kht-accent);
	background: var(--kht-accent-soft);
	transform: translateY( -1px );
}

.kht-list {
	display: grid;
	gap: 10px;
}

.kht-doc {
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 14px 16px;
	border: 1px solid var(--kht-line);
	border-radius: 12px;
	background: #fff;
	font: inherit;
	text-align: left;
	cursor: pointer;
	transition: border-color 0.15s, background 0.15s;
}

.kht-doc:hover,
.kht-doc:focus-visible {
	border-color: var(--kht-accent);
	background: var(--kht-accent-soft);
}

.kht-doc-name {
	font-weight: 600;
	color: var(--kht-ink);
}

.kht-doc-role {
	font-size: 0.85rem;
	color: var(--kht-muted);
}

.kht-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.kht-chip {
	padding: 9px 14px;
	border: 1px solid var(--kht-line);
	border-radius: 999px;
	background: #fff;
	color: var(--kht-ink);
	font: inherit;
	font-size: 0.9rem;
	cursor: pointer;
	transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.kht-chip:hover,
.kht-chip:focus-visible {
	border-color: var(--kht-accent);
	background: var(--kht-accent-soft);
}

.kht-chip.is-selected {
	background: var(--kht-accent);
	border-color: var(--kht-accent);
	color: #fff;
	font-weight: 600;
}

.kht-slots {
	margin-top: 8px;
}

/* ---------------------------------------------------------------- Form */

.kht-form {
	display: grid;
	gap: 14px;
}

.kht-row {
	display: grid;
	grid-template-columns: repeat( auto-fit, minmax( 180px, 1fr ) );
	gap: 14px;
}

.kht-field {
	display: flex;
	flex-direction: column;
	gap: 5px;
}

.kht-field-sm {
	max-width: 120px;
}

.kht-field label {
	font-size: 0.86rem;
	font-weight: 600;
	color: var(--kht-ink);
}

.kht-optional {
	font-weight: 400;
	color: var(--kht-muted);
}

.kht-field input,
.kht-field select,
.kht-field textarea {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid var(--kht-line);
	border-radius: 10px;
	background: #fff;
	color: var(--kht-ink);
	font: inherit;
	font-size: 0.95rem;
}

.kht-field input:focus,
.kht-field select:focus,
.kht-field textarea:focus {
	outline: none;
	border-color: var(--kht-accent);
	box-shadow: 0 0 0 3px rgba( 154, 76, 138, 0.18 );
}

.kht-field textarea {
	resize: vertical;
}

.kht-hint {
	font-size: 0.8rem;
	color: var(--kht-muted);
}

.kht-field-otp {
	max-width: 230px;
	margin-bottom: 18px;
}

.kht-field-otp input {
	font-size: 1.3rem;
	letter-spacing: 0.25em;
	text-align: center;
}

/* ------------------------------------------------------------- Confirm */

.kht-confirm {
	display: grid;
	gap: 8px;
	padding: 14px 16px;
	border: 1px dashed var(--kht-line);
	border-radius: 12px;
	font-size: 0.93rem;
}

.kht-confirm div {
	display: flex;
	gap: 10px;
}

.kht-confirm span {
	flex: 0 0 78px;
	color: var(--kht-muted);
}

/* ------------------------------------------------------------- Actions */

.kht-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	align-items: center;
	margin-top: 22px;
}

.kht-btn {
	display: inline-block;
	padding: 11px 20px;
	border: 1px solid transparent;
	border-radius: 999px;
	background: var(--kht-accent);
	color: #fff;
	font: inherit;
	font-size: 0.95rem;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
	transition: background 0.15s, border-color 0.15s;
}

.kht-btn:hover,
.kht-btn:focus-visible {
	background: var(--kht-accent-dark);
	color: #fff;
}

.kht-btn[disabled] {
	opacity: 0.6;
	cursor: default;
}

.kht-btn-primary {
	margin-left: auto;
	background: var(--kht-cta);
}

.kht-btn-primary:hover,
.kht-btn-primary:focus-visible {
	background: var(--kht-cta-dark);
}

.kht-btn-ghost {
	background: transparent;
	border-color: var(--kht-line);
	color: var(--kht-muted);
	font-weight: 500;
}

.kht-btn-ghost:hover,
.kht-btn-ghost:focus-visible {
	background: #faf5f9;
	border-color: var(--kht-accent);
	color: var(--kht-accent-dark);
}

/* ------------------------------------------------------------- Success */

.kht-success {
	text-align: center;
	padding: 10px 0;
}

.kht-success .kht-confirm {
	max-width: 360px;
	margin: 0 auto;
	text-align: left;
}

.kht-tick {
	width: 56px;
	height: 56px;
	margin: 0 auto 14px;
	display: grid;
	place-items: center;
	border-radius: 50%;
	background: var(--kht-accent-soft);
	color: var(--kht-cta);
	font-size: 1.8rem;
	font-weight: 700;
}

.kht-success .kht-btn-ghost {
	margin-top: 18px;
}

/* -------------------------------------------------------------- Mobile */

@media ( max-width: 600px ) {
	.kht-booking {
		padding: 20px 16px;
	}

	.kht-steps {
		font-size: 0.72rem;
	}

	.kht-steps li {
		flex: 1 1 auto;
		padding: 6px 8px;
	}

	.kht-field-sm {
		max-width: none;
	}

	.kht-btn-primary {
		margin-left: 0;
		width: 100%;
		text-align: center;
	}

	.kht-actions .kht-btn-ghost {
		width: 100%;
		text-align: center;
	}
}
